/* ============ 🍎 Apple / iOS 現代質感風 ============ */
:root {
  /* Colors */
  --primary: #0071e3;          /* Apple Blue */
  --primary-dark: #005bb7;
  --primary-light: #e8f2ff;
  --bg: #ffffff;
  --bg-soft: #f5f5f7;          /* Apple Secondary Gray */
  --card: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --text: #1d1d1f;             /* Apple Main Text */
  --text-secondary: #86868b;   /* Apple Secondary Text */
  --danger: #ff3b30;           /* iOS Red */
  --success: #34c759;          /* iOS Green */
  --warning: #ff9f0a;          /* iOS Orange */
  
  /* Layout & Shadows */
  --radius: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --glass: saturate(180%) blur(20px);
  --glass-bg: rgba(255, 255, 255, 0.72);
}

/* ============ Reset & Base ============ */
* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  -webkit-tap-highlight-color: transparent; 
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "PingFang TC", "Helvetica Neue", Arial, sans-serif;
  font-size: 17px; /* iOS standard is slightly larger */
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: -0.022em;
}

input, button, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

button { 
  cursor: pointer; 
  border: none; 
  background: none; 
  color: inherit; 
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}
button:active { transform: scale(0.96); opacity: 0.8; }

/* ============ 畫面切換 ============ */
.screen { display: none; min-height: 100vh; animation: fadeIn 0.4s ease-out; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============ 登入畫面 (人像選擇器) ============ */
#login-screen, #device-screen {
  background: var(--bg-soft);
  min-height: 100vh;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#login-screen.active, #device-screen.active { display: flex; }

/* 裝飾性漸層背景 */
#login-screen::before, #device-screen::before {
  content: '';
  position: fixed;
  top: -10%; left: -10%;
  width: 120%; height: 120%;
  background: radial-gradient(circle at 20% 30%, #e8f2ff 0%, transparent 40%),
              radial-gradient(circle at 80% 70%, #fff0f0 0%, transparent 40%);
  z-index: 0;
}

.picker-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  text-align: center;
}
.picker-logo { font-size: 64px; margin-bottom: 12px; }
.picker-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.picker-subtitle {
  font-size: 19px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.family-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.family-tile {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: var(--glass);
  border-radius: var(--radius-lg);
  padding: 24px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.family-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); background: #ffffff; }
.family-tile.loading { opacity: 0.6; pointer-events: none; }
.family-tile .face { font-size: 56px; line-height: 1; transition: transform 0.3s; }
.family-tile:hover .face { transform: scale(1.1); }
.family-tile .name { font-size: 17px; font-weight: 600; }

.error-msg { color: var(--danger); font-size: 15px; margin-top: 16px; height: 20px; }
.hint { font-size: 14px; color: var(--text-secondary); margin-top: 32px; line-height: 1.5; }

/* ============ 主畫面結構 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-bottom: 0.5px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-logo { font-size: 24px; }
.topbar-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--bg-soft);
  border-radius: 999px;
  border: 0.5px solid var(--border);
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.user-chip:active { transform: scale(0.95); background: #e8e8ed; }
.user-chip .avatar-circle {
  width: 32px; height: 32px;
  background: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}
.user-chip .user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.user-chip .switch-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: 2px;
}

#main-content {
  padding: 24px 20px 120px;
  max-width: 800px;
  margin: 0 auto;
}

/* ============ 卡片 (iOS 風格) ============ */
.card {
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  transition: transform 0.2s;
  border: none;
}
.card.pinned { background: #fffbe6; } /* 稍微明顯一點的置頂色 */

.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.card-title { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.card-meta { font-size: 14px; color: var(--text-secondary); }

.card-content {
  font-size: 17px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.card-actions { display: flex; gap: 12px; margin-top: 20px; }
.card-actions button {
  padding: 10px 16px;
  font-size: 15px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.05);
  font-weight: 600;
}
.card-actions button.primary { background: var(--primary); color: white; }
.card-actions button.danger { color: var(--danger); }

/* ============ 區塊標題 ============ */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 32px 0 16px;
  padding: 0 4px;
}
.section-title h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }

.fab-btn {
  background: var(--primary);
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

/* ============ Dashboard ============ */
.welcome {
  background: #ffffff;
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  text-align: center;
}
.welcome h2 { font-size: 32px; margin-bottom: 8px; font-weight: 800; }
.welcome p { color: var(--text-secondary); font-size: 19px; }

.summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 32px; }
.summary-card {
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}
.summary-card .icon { font-size: 36px; margin-bottom: 8px; }
.summary-card .num { font-size: 28px; font-weight: 700; color: var(--primary); }
.summary-card .label { font-size: 15px; color: var(--text-secondary); font-weight: 500; }

/* ============ 購物清單 ============ */
.shopping-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-soft);
  border-radius: 20px;
  margin-bottom: 12px;
}
.shopping-check {
  width: 28px; height: 28px;
  border: 2px solid #d2d2d7;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: white;
  color: white;
  font-size: 16px;
  transition: all 0.2s;
}
.shopping-item.done { opacity: 0.6; }
.shopping-item.done .shopping-check { background: var(--success); border-color: var(--success); }
.shopping-item.done .shopping-name { text-decoration: line-through; color: var(--text-secondary); }
.shopping-name { font-weight: 600; font-size: 17px; }
.cat-pill {
  padding: 2px 10px;
  font-size: 12px;
  background: white;
  border-radius: 999px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 0.5px solid var(--border);
}

/* ============ 留言板 ============ */
.message-bubble {
  background: var(--bg-soft);
  border-radius: 20px;
  padding: 16px 20px;
  margin-bottom: 12px;
  max-width: 90%;
}
.message-mine {
  background: var(--primary);
  color: white;
  margin-left: auto;
}
.message-head { font-size: 13px; margin-bottom: 4px; opacity: 0.8; font-weight: 600; }
.message-mine .message-head { color: rgba(255, 255, 255, 0.9); }
.message-body { font-size: 17px; line-height: 1.4; }

.message-input-bar {
  position: fixed;
  bottom: 84px;
  left: 0; right: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass);
  padding: 12px 20px;
  display: flex; gap: 12px;
  border-top: 0.5px solid var(--border);
  z-index: 90;
}
.message-input-bar input {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  font-size: 17px;
  outline: none;
}
.message-input-bar button {
  background: var(--primary);
  color: white;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
}

/* ============ 行事曆 ============ */
.event-card {
  display: flex; gap: 20px;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.event-date {
  width: 60px; height: 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.event-date .month { font-size: 12px; font-weight: 800; color: var(--danger); text-transform: uppercase; }
.event-date .day { font-size: 26px; font-weight: 700; line-height: 1; }
.event-title { font-size: 19px; font-weight: 700; }

/* ============ 用餐 ============ */
.tab-bar {
  display: flex;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 24px;
}
.tab-bar button {
  flex: 1; padding: 10px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--text-secondary);
}
.tab-bar button.active { background: white; color: var(--text); box-shadow: var(--shadow-sm); }

/* ============ 用餐投票特別處理 ============ */
.poll-card { background: var(--bg-soft); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; }
.status-tag { padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.status-tag.open { background: #e1f5fe; color: #0288d1; }
.status-tag.closed { background: #eee; color: #666; }

.poll-actions-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 0.5px solid var(--border); }
.poll-actions-top button {
  padding: 8px 14px; border-radius: 10px; background: var(--bg-soft);
  font-size: 14px; font-weight: 600;
}
.poll-actions-top button.primary { background: var(--primary); color: white; }

.option-bar { position: relative; padding: 16px 20px; }
.option-fill { position: absolute; top: 0; left: 0; bottom: 0; background: var(--primary-light); opacity: 0.5; }
.option-name { font-weight: 700; font-size: 17px; }

/* ============ 底部導航 ============ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border-top: 0.5px solid var(--border);
  display: flex;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  z-index: 100;
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
}
.nav-btn .nav-icon { 
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  transition: transform 0.2s; 
}
.nav-btn .nav-icon svg {
  width: 24px; height: 24px;
  stroke-width: 2.2px;
}
.nav-btn.active { color: var(--primary); }
.nav-btn.active .nav-icon { transform: scale(1.1); }
.nav-btn.active .nav-icon svg { stroke-width: 2.5px; }

/* ============ Modal (iOS Sheet) ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: white;
  width: 100%;
  max-width: 600px;
  border-radius: 32px 32px 0 0;
  padding: 12px 24px calc(32px + env(safe-area-inset-bottom));
  max-height: 90vh;
  overflow-y: auto;
  animation: sheetUp 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
  position: relative;
}
.modal-handle {
  width: 36px;
  height: 5px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 999px;
  margin: 0 auto 20px;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal input, .modal textarea, .modal select {
  width: 100%; padding: 14px 18px;
  background: var(--bg-soft);
  border: none; border-radius: 14px;
  font-size: 17px; margin: 8px 0 20px;
  outline: none;
}
.modal input:focus { box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2); }

.modal-actions { display: flex; gap: 16px; margin-top: 12px; }
.modal-actions button { flex: 1; padding: 16px; border-radius: 16px; font-weight: 700; font-size: 17px; }
.modal-actions .cancel { background: var(--bg-soft); color: var(--text); }
.modal-actions .save { background: var(--primary); color: white; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 40px; /* 改到頂部，像 iOS 通訊 */
  left: 50%; transform: translateX(-50%) translateY(-100px);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px; font-weight: 600;
  z-index: 300;
  transition: all 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  opacity: 0;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ============ 裝置密碼頁面特別處理 ============ */
.device-form { width: 100%; max-width: 320px; margin: 0 auto; }
.device-form input {
  width: 100%; padding: 18px; border-radius: 18px; border: none;
  background: white; box-shadow: var(--shadow-sm); font-size: 20px; text-align: center;
}
.device-form .btn-primary {
  width: 100%; margin-top: 16px; padding: 18px; border-radius: 18px;
  background: var(--primary); color: white; font-weight: 700; font-size: 18px;
}

/* ============ 桌面版優化 ============ */
@media (min-width: 800px) {
  .summary-grid { grid-template-columns: repeat(4, 1fr); }
  .modal { border-radius: 24px; margin-bottom: 40px; }
  .modal-overlay { align-items: center; }
  .message-input-bar { border-radius: 30px; max-width: 800px; margin: 0 auto 20px; left: 20px; right: 20px; bottom: 84px; }
}

/* ============ 其他細節 ============ */
.voter-list { background: rgba(0, 0, 0, 0.03); padding: 12px 16px; border-radius: 12px; margin: 16px 0; font-size: 15px; }
.voter-tag { display: inline-block; padding: 2px 8px; background: white; border-radius: 6px; margin: 2px; box-shadow: var(--shadow-sm); }

.wheel-result { text-align: center; margin-top: 20px; min-height: 80px; }
/* ============ 使用者與成員管理 ============ */
.member-list { margin: 12px 0; }
.member-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; background: var(--bg-soft);
  border-radius: 16px; margin-bottom: 8px;
  cursor: pointer; transition: all 0.2s;
}
.member-row:hover { background: #e8e8ed; }
.member-row.current { border: 2px solid var(--primary); background: white; }
.member-row .avatar { font-size: 32px; }
.member-row .name { flex: 1; font-weight: 600; font-size: 17px; }
.member-row .tag { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 6px; }

.avatar-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 12px; padding: 16px; background: var(--bg-soft);
  border-radius: 20px; max-height: 300px; overflow-y: auto;
}
.emoji-opt {
  font-size: 32px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; border-radius: 12px; transition: all 0.2s;
}
.emoji-opt:hover { background: rgba(0,0,0,0.05); transform: scale(1.1); }
.emoji-opt.selected { background: white; box-shadow: var(--shadow-sm); transform: scale(1.1); }

/* ============ 其他元件 ============ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.empty-state .emoji { font-size: 72px; margin-bottom: 16px; }

.link-btn { color: var(--primary); font-weight: 600; cursor: pointer; padding: 4px; }
.link-btn:hover { text-decoration: underline; }

.rating-input { display: flex; gap: 8px; margin-top: 12px; font-size: 32px; }
.rating-input span { cursor: pointer; color: #d2d2d7; transition: color 0.2s; }
.rating-input span.active { color: #ff9f0a; }

.poll-preset-actions { display: flex; gap: 12px; margin-bottom: 16px; }

.winner-text { font-size: 36px; font-weight: 800; color: var(--primary); text-align: center; margin: 12px 0; }
.wheel-result .link-btn { font-size: 15px; margin: 0 4px; }

/* ============ 用餐月曆 (一頁式網格) ============ */
.calendar-view {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  border: 0.5px solid var(--border);
}
.calendar-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  background: var(--bg-soft);
  border-bottom: 0.5px solid var(--border);
}
.calendar-nav h3 { font-size: 19px; font-weight: 700; color: var(--text); }
.calendar-nav button {
  padding: 8px 16px; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--primary);
}
.calendar-main-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--border);
  gap: 0.5px;
}
.calendar-weekday {
  padding: 10px 4px;
...
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--bg-soft);
}
.calendar-day {
  background: white;
  min-height: 100px;
  padding: 8px;
  position: relative;
  transition: background 0.2s;
}
.calendar-day:active { background: var(--bg-soft); }
.calendar-day.other-month { background: var(--bg-soft); opacity: 0.4; }
.calendar-day.today { background: #fffbe6; }

.day-num {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}
.calendar-day.today .day-num { color: var(--warning); font-weight: 800; }

.day-meals { display: flex; flex-direction: column; gap: 4px; }
.meal-item {
  font-size: 11px;
  padding: 4px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: none;
}
.meal-item:hover { background: #d0e4ff; }

@media (max-width: 600px) {
  .calendar-day { min-height: 80px; padding: 4px; }
  .day-num { font-size: 12px; }
  .meal-item { font-size: 10px; padding: 2px 4px; border-radius: 4px; }
}

/* ============ 單字卡系統 (Flashcards) ============ */
.flashcard-container {
  padding: 12px 20px;
  max-width: 600px;
  margin: 0 auto;
  height: calc(100vh - 80px); /* 扣除 topbar */
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 防止整個 container 捲動 */
}

/* --- 頂部狀態欄 --- */
.fc-dashboard {
  background: var(--bg-soft);
  padding: 12px;
  border-radius: 16px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.fc-progress-wrap {
  width: 100%; height: 6px;
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}
.fc-progress-bar {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}
.fc-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  align-items: center;
}
.fc-badges {
  display: flex; gap: 4px;
}
.fc-badge {
  padding: 1px 6px;
  border-radius: 4px;
  background: white;
  box-shadow: var(--shadow-sm);
  font-size: 11px;
}

/* --- 卡片本體 (SRS) --- */
.fc-card-scene {
  perspective: 1000px;
  width: 100%;
  flex: 1; /* 佔滿剩餘空間 */
  min-height: 0; /* 重要: 允許 flex 項目縮小 */
  cursor: pointer;
  margin-bottom: 16px;
}
.fc-card {
  position: relative;
  width: 100%; height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}
.fc-card.is-flipped {
  transform: rotateY(180deg);
}
.fc-card-face {
  position: absolute;
  width: 100%; height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  padding: 24px;
  align-items: center;
  justify-content: center;
  border: 0.5px solid var(--border);
}
.fc-card-back {
  transform: rotateY(180deg);
  justify-content: flex-start;
  overflow-y: auto; /* 僅卡片內容可捲動 */
  padding: 20px;
}

.fc-word {
  font-size: clamp(32px, 8vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}
.fc-info-item {
  width: 100%;
  margin-bottom: 12px;
  text-align: left;
}
.fc-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.fc-value {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.fc-sentence {
  font-style: italic;
  color: #444;
  background: var(--bg-soft);
  padding: 10px;
  border-radius: 10px;
  font-size: 15px;
}

/* --- SRS 按鈕 --- */
.fc-srs-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex-shrink: 0;
  padding-bottom: 12px;
}
.fc-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  border-radius: 12px;
  background: var(--bg-soft);
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 700;
}
.fc-btn .key { font-size: 9px; opacity: 0.5; margin-top: 2px; font-weight: 400; }
.fc-btn.again { color: var(--danger); }
.fc-btn.hard { color: var(--warning); }
.fc-btn.good { color: var(--primary); }
.fc-btn.easy { color: var(--success); }

/* --- 測驗模式 (Quiz) --- */
.fc-quiz-box {
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
  text-align: center;
  flex-shrink: 0;
}
.fc-cloze {
  font-size: 20px;
  line-height: 1.6;
  font-weight: 500;
  margin-bottom: 20px;
}
.fc-cloze input {
  display: inline-block;
  width: 120px;
  border: none;
  border-bottom: 2px solid var(--primary);
  border-radius: 0;
  background: transparent;
  padding: 0 4px;
  margin: 0 4px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--primary);
  outline: none;
}
.fc-cloze input.correct { color: var(--success); border-bottom-color: var(--success); }
.fc-cloze input.wrong { color: var(--danger); text-decoration: line-through; border-bottom-color: var(--danger); }
.fc-answer-reveal {
  font-size: 19px;
  font-weight: 700;
  color: var(--success);
  margin-top: 8px;
}

/* --- 洗牌/結算介面 --- */
.fc-menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.fc-set-card {
  background: white;
  padding: 20px;
  border-radius: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.fc-set-info h3 { font-size: 19px; font-weight: 700; }
.fc-set-info p { font-size: 13px; color: var(--text-secondary); }


