* { box-sizing: border-box; } :root { --darkest: #171B19; --dark: #1D2B26; --med: #2D3B36; --light: #39574C; --lightest: #475650; --size-scale: 50; --size-scale-px: calc(var(--size-scale) * 1px); } body { margin: 0; min-height: 100vh; background-color: var(--light); color: var(--darkest); /* 為文字顏色添加一個變量 */ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; /* 選擇一個基本字體 */ } header { background-color: var(--darkest); color: var(--lightest); padding: 0.25em; display: flex; justify-content: space-between; align-items: center; /* 垂直居中對齊 */ } header h1 { margin: 0; padding: 0; font-size: 1.5em; } .displayNone { display: none; } .card { display: inline-block; background: var(--lightest); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); border-radius: 5px; overflow: hidden; max-width: 300px; /* 最大寬度設定 */ /* 你可以根據實際的網站佈局需要調整這個最大寬度 */ } .card-size-1 { width: 25%; } .card-size-2 { width: 50%; } .card-size-3 { width: 75%; } .card-size-4 { width: 100%; } .mood-image { width: 100%; /* 使圖片寬度適應容器 */ height: auto; /* 高度自動 */ object-fit: cover; /* 保持圖片比例,並填滿整個格子 */ } /* 模態視窗背景樣式 */ .modal { display: none; /* Hidden by default */ position: fixed; /* Stay in place */ z-index: 1; /* Sit on top */ left: 0; top: 0; width: 100%; /* Full width */ height: 100%; /* Full height */ overflow: auto; /* Enable scroll if needed */ background-color: rgb(0,0,0); /* Fallback color */ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ } /* 模態視窗內容樣式 */ .modal-content { background-color: #fefefe; margin: 15% auto; /* 15% from the top and centered */ padding: 20px; border: 1px solid #888; width: 80%; /* Could be more or less, depending on screen size */ } /* The Close Button */ .close { color: #aaa; float: right; font-size: 28px; font-weight: bold; } .close:hover, .close:focus { color: black; text-decoration: none; cursor: pointer; }