@font-face { font-family: 'GenSenRounded'; src: url('./500.otf') format('opentype'); font-weight: 500; }
@font-face { font-family: 'GenSenRounded'; src: url('./700.otf') format('opentype'); font-weight: 700; }
@font-face { font-family: 'GenSenRounded'; src: url('./900.otf') format('opentype'); font-weight: 900; }

:root {
    --bg-color: #F4F7F6; --primary-text: #333333;
    --mint-green: #48CDB0; --mint-dark: #36A58D;
    --sunny-yellow: #FFD166; --soft-gray: #E0E5E2; --card-bg: #FFFFFF;
}

body { font-family: 'GenSenRounded', sans-serif; background-color: var(--bg-color); color: var(--primary-text); margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
.app-container { max-width: 600px; margin: 0 auto; padding: 20px; padding-bottom: 80px; }
.text-center { text-align: center; }
.main-logo { width: 70px; height: 70px; border-radius: 18px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); margin-bottom: 10px; }
h1 { font-weight: 900; font-size: 26px; margin: 0 0 5px 0; color: #222;}
.subtitle { font-weight: 500; color: #777; margin-bottom: 24px; font-size: 14px;}

.card-3d { background: var(--card-bg); border-radius: 24px; padding: 20px; margin-bottom: 20px; box-shadow: 0 8px 20px rgba(0,0,0,0.05), inset 0 -4px 0 rgba(0,0,0,0.02); }
h2, h3 { font-weight: 700; margin-top: 0; color: #333; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 14px;}
input[type="text"], textarea { width: 100%; box-sizing: border-box; padding: 12px; border-radius: 12px; border: 2px solid #EEE; font-family: 'GenSenRounded', sans-serif; font-size: 16px; background: #FAFAFA; transition: 0.2s; }
input[type="text"]:focus { border-color: var(--mint-green); outline: none; background: #FFF; }
.flex-row { display: flex; gap: 10px; align-items: center; }

/* 基礎按鈕 3D 效果 */
.primary-btn { width: 100%; padding: 14px; background: var(--mint-green); color: #FFF; border: none; border-radius: 16px; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 6px 0 var(--mint-dark); transition: 0.1s; font-family: 'GenSenRounded', sans-serif; }
.primary-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--mint-dark); }

/* 次要按鈕 3D 效果 */
.secondary-btn { width: 100%; padding: 14px; background: #FFF; color: var(--primary-text); border: 2px solid #DDD; border-radius: 16px; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 0 #DDD; transition: 0.1s; font-family: 'GenSenRounded', sans-serif; }
.secondary-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #DDD; }

/* 特定情境按鈕配色 */
.btn-danger-outline { color: #FF6B6B; border-color: #FF6B6B; box-shadow: 0 4px 0 #FF6B6B; }
.btn-danger-outline:active { box-shadow: 0 2px 0 #FF6B6B; }
.btn-mint-outline { color: var(--mint-dark); border-color: var(--mint-green); box-shadow: 0 4px 0 var(--mint-green); }
.btn-mint-outline:active { box-shadow: 0 2px 0 var(--mint-green); }
.btn-danger { background: #FF6B6B; box-shadow: 0 6px 0 #D9534F; }
.btn-danger:active { box-shadow: 0 2px 0 #D9534F; }

.btn-narrow { flex: 1; padding: 14px 8px; }
.btn-wide { flex: 2.2; white-space: nowrap; padding: 14px 8px; }

.icon-btn { width: 45px; height: 45px; border-radius: 12px; border: none; background: #EEE; font-size: 20px; font-weight: bold; cursor: pointer; color: #555; box-shadow: 0 4px 0 #DDD; transition: 0.1s;}
.icon-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #DDD; }

.avatar-select-btn { width: 45px; height: 45px; border-radius: 50%; border: 3px solid #EEE; cursor: pointer; object-fit: cover; transition: 0.2s; background: #FFF; flex-shrink: 0; padding: 0;}
.avatar-select-btn:active { transform: scale(0.9); }
.emoji-btn { display: flex; justify-content: center; align-items: center; font-size: 24px; }

/* 膠囊標籤 */
.pill-container { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pill { background: #E8F5F2; color: var(--mint-dark); padding: 6px 14px; border-radius: 20px; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; cursor: pointer; border: 1px solid var(--mint-green); transition: 0.2s;}
.pill .delete { color: #999; font-size: 16px; margin-left: 4px; }
.pill .delete:hover { color: #FF6B6B; }
.pill.date-pill { border-color: #DDD; background: #FFF; color: #666; }
.pill.date-pill.selected { border-color: var(--mint-green); background: var(--mint-green); color: #FFF; }

/* 月曆 UI */
.calendar-card { background: #FFF; border: 2px solid #EEE; border-radius: 16px; padding: 15px; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; font-weight: 900; font-size: 16px; margin-bottom: 10px; }
.cal-nav { background: none; border: none; font-size: 18px; color: var(--mint-green); cursor: pointer; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-weight: 700; font-size: 12px; color: #999; margin-bottom: 5px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-day { padding: 10px 0; text-align: center; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; transition: 0.1s; background: #FAFAFA; border: 1px solid #F0F0F0; }
.cal-day.disabled { color: #CCC; background: #FFF; border: none; cursor: not-allowed; }
.cal-day.selected { background: var(--mint-green); color: #FFF; border-color: var(--mint-dark); box-shadow: 0 2px 0 var(--mint-dark); transform: translateY(-2px); }

/* 成員卡片排版 (增加呼吸感) */
.member-header-row { display: flex; align-items: center; white-space: nowrap; }
.member-title { margin: 0; white-space: nowrap; font-size: 18px; }
.scroll-hint-container { text-align: right; margin-top: 5px; margin-right: 15px; margin-bottom: 15px; }
.scroll-hint { font-size: 12px; color: #999; white-space: nowrap; }

.member-cards-scroll { display: flex; overflow-x: auto; gap: 12px; padding-bottom: 10px; scroll-behavior: smooth; }
.member-cards-scroll::-webkit-scrollbar { height: 6px; }
.member-cards-scroll::-webkit-scrollbar-thumb { background: #DDD; border-radius: 10px; }
.member-card { min-width: 80px; background: #FAFAFA; border: 2px solid #EEE; border-radius: 16px; padding: 12px 8px; text-align: center; cursor: pointer; transition: 0.3s; display: flex; flex-direction: column; align-items: center; }
.member-card:hover, .member-card.active { border-color: var(--mint-green); background: #F2FBF9; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(72,205,176,0.15);}
.member-card.done { border-color: #DDD; background: #FFF; opacity: 0.7;}
.member-card img { width: 42px; height: 42px; border-radius: 50%; margin-bottom: 5px; border: 2px solid #FFF;}
.member-card span { display: block; font-size: 13px; font-weight: 700; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;}

/* 狀態膠囊 */
.badge { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 12px; font-weight: 700; margin: 0 2px; }
.badge-pending { background: #FFE8A1; color: #856404; margin-top: 4px; font-size: 10px; }
.badge-done { background: #E0E5E2; color: #666; margin-top: 4px; font-size: 10px; }
.badge-yes { background: var(--mint-green); color: white; }
.badge-unsure { background: var(--sunny-yellow); color: #856404; }
.badge-no { background: var(--soft-gray); color: #666; border: 1px solid #CCC; }

/* Modal 視窗 */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 100; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(3px); }
.modal-content { width: 90%; max-width: 380px; margin-bottom: 0; animation: popIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.modal-buttons { display: flex; gap: 10px; width: 100%; }

/* Emoji 網格 */
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-height: 280px; overflow-y: auto; padding-right: 5px; margin-top: 15px;}
.emoji-grid::-webkit-scrollbar { width: 6px; }
.emoji-grid::-webkit-scrollbar-thumb { background: #DDD; border-radius: 10px; }
.emoji-option { font-size: 28px; text-align: center; cursor: pointer; padding: 8px 0; border-radius: 12px; transition: 0.2s; user-select: none; background: #FAFAFA; border: 2px solid transparent;}
.emoji-option:hover { background: #FFF; border-color: var(--mint-green); transform: scale(1.1); box-shadow: 0 4px 10px rgba(0,0,0,0.05);}

/* 頭像網格 */
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 15px; }
.avatar-option { width: 100%; aspect-ratio: 1; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: 0.2s; background: #FAFAFA; }
.avatar-option.selected { border-color: var(--mint-green); background: #FFF; box-shadow: 0 4px 10px rgba(72,205,176,0.3); transform: scale(1.1); }

/* 表格與欄位鎖定 */
.table-scroll-container { overflow-x: auto; overflow-y: hidden; border-radius: 16px; background: #FAFAFA; border: 2px solid #EEE;}
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { padding: 12px 8px; text-align: center; white-space: nowrap; border-bottom: 2px solid #EEE; border-right: 2px solid #EEE; transition: background 0.3s;}
th { background: #FFF; font-weight: 700; z-index: 2;}
.sticky-corner { position: sticky; left: 0; top: 0; background: #FFF; z-index: 3; border-right: 2px solid #DDD; }
.sticky-col { position: sticky; left: 0; background: #FFF; z-index: 1; font-weight: 700; border-right: 2px solid #DDD; line-height: 1.2;}

.col-active { background: #E8F5F2 !important; border-left: 2px solid var(--mint-green); border-right: 2px solid var(--mint-green); }
.col-done { background: #F5F5F5 !important; }
.col-disabled { opacity: 0.5; pointer-events: none; }

.member-header { display: flex; flex-direction: column; align-items: center; font-size: 14px;}
.member-avatar { width: 45px; height: 45px; margin-bottom: 5px; }

.vote-btn { width: 42px; height: 42px; border-radius: 12px; border: none; font-size: 16px; cursor: pointer; font-weight: 900; transition: transform 0.1s; box-shadow: 0 4px 0 #DDD;}
.vote-btn:active { transform: translateY(4px); box-shadow: 0 0 0 transparent !important; }
.status-yes { background: var(--mint-green); color: white; box-shadow: 0 4px 0 var(--mint-dark); }
.status-unsure { background: var(--sunny-yellow); color: #856404; box-shadow: 0 4px 0 #D4A745; }
.status-no { background: var(--soft-gray); color: transparent; }

.top-date-item { background: #FFF; border: 2px solid var(--mint-green); border-radius: 16px; padding: 12px 16px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 0 var(--mint-dark); }
.top-date-avatars { display: flex; }
.top-date-avatars img { width: 32px; height: 32px; border-radius: 50%; margin-left: -12px; border: 2px solid #FFF; background: #FFF;}

/* 防呆鎖定卡片 */
.cards-locked { pointer-events: none; opacity: 0.8; }

footer { text-align: center; font-size: 12px; color: #999; padding: 20px 0; font-weight: 500; }
