﻿:root {  --primary: #2d6a4f;  --primary-light: #40916c;  --primary-dark: #1b4332;  --accent: #d4a373;  --bg: #fefae0;  --bg-card: #ffffff;  --text: #2d3436;  --text-light: #636e72;  --text-inverse: #ffffff;  --border: #dfe6e9;  --danger: #e17055;  --success: #00b894;  --warning: #fdcb6e;  --shadow: 0 2px 12px rgba(0,0,0,0.08);  --radius: 10px;  --font-main: 'Nunito', 'Hiragino Sans', 'Noto Sans JP', sans-serif;  --font-mono: 'SF Mono', 'Consolas', monospace;  --nav-height: 60px;  --bottom-nav-height: 58px;  --max-width: 900px;}* { margin: 0; padding: 0; box-sizing: border-box; }body {  font-family: var(--font-main);  background: var(--bg);  color: var(--text);  min-height: 100vh;  -webkit-tap-highlight-color: transparent;}a { color: var(--primary); text-decoration: none; }button {  font-family: inherit;  cursor: pointer;  border: none;  font-size: inherit;  -webkit-appearance: none;}input, textarea, select {  font-family: inherit;  font-size: inherit;}#app {  display: flex;  flex-direction: column;  min-height: 100vh;  padding-bottom: var(--bottom-nav-height);}/* ── 桌面端导航栏 ── */.desktop-nav {  display: flex;}.main-nav {  height: var(--nav-height);  background: var(--bg-card);  border-bottom: 1px solid var(--border);  position: sticky;  top: 0;  z-index: 100;  box-shadow: var(--shadow);}.nav-inner {  max-width: var(--max-width);  margin: 0 auto;  height: 100%;  display: flex;  align-items: center;  gap: 24px;  padding: 0 16px;}.nav-brand {  display: flex;  align-items: center;  gap: 8px;  text-decoration: none;  color: var(--text);  flex-shrink: 0;}.nav-brand-icon {  font-size: 0.9rem;  font-weight: 700;  color: var(--text-inverse);  width: 32px;  height: 32px;  display: flex;  align-items: center;  justify-content: center;  background: var(--primary);  border-radius: 8px;}.nav-brand-text {  font-weight: 700;  font-size: 1.1rem;  letter-spacing: -0.02em;}.nav-links {  display: flex;  gap: 4px;  flex: 1;  overflow-x: auto;  scrollbar-width: none;}.nav-links::-webkit-scrollbar { display: none; }.nav-link {  display: flex;  align-items: center;  gap: 6px;  padding: 8px 12px;  border-radius: 8px;  color: var(--text-light);  font-size: 0.85rem;  font-weight: 500;  white-space: nowrap;  transition: all 0.15s;  text-decoration: none;  min-height: 40px;}.nav-link:hover { background: var(--bg); color: var(--text); }.nav-link.active {  background: var(--primary);  color: var(--text-inverse);}.nav-link i { width: 16px; height: 16px; }.nav-user {  display: flex;  align-items: center;  gap: 8px;  flex-shrink: 0;}.nav-user-name {  font-size: 0.85rem;  font-weight: 500;  color: var(--text);}.btn-icon {  width: 32px;  height: 32px;  border-radius: 6px;  display: flex;  align-items: center;  justify-content: center;  background: none;  color: var(--text-light);}.btn-icon:hover { background: var(--bg); color: var(--text); }.btn-icon i { width: 18px; height: 18px; }/* ── Main Content ── */.main-content {  flex: 1;  max-width: var(--max-width);  width: 100%;  margin: 0 auto;  padding: 24px 16px 80px;}/** Bottom Navigation (Mobile) */


.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  background: #ffffff;
  border-top: 1px solid #dfe6e9;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.bottom-nav-inner {
  display: flex;
  align-items: stretch;
  height: 100%;
}
.bottom-nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #636e72;
  font-size: 0.55rem;
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
 padding: 4px 6px;}
.bottom-nav-link.active {
  color: #2d6a4f;
}
.bottom-nav-link i {
  width: 24px;
  height: 24px;
}
.bottom-nav-link span {
  font-size: 0.55rem;
  white-space: nowrap;
}/* ── Modal ── */.modal-overlay {  position: fixed;  inset: 0;  background: rgba(0, 0, 0, 0.5);  z-index: 200;  align-items: center;  justify-content: center;  padding: 16px;}.modal-container {  background: var(--bg-card);  border-radius: var(--radius);  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);  max-width: 480px;  width: 100%;  max-height: 80vh;  overflow: hidden;  display: flex;  flex-direction: column;}.modal-header {  display: flex;  align-items: center;  justify-content: space-between;  padding: 16px 20px;  border-bottom: 1px solid var(--border);}.modal-header h3 { font-size: 1rem; font-weight: 600; }.modal-close {  width: 28px;  height: 28px;  border-radius: 6px;  display: flex;  align-items: center;  justify-content: center;  color: var(--text-light);  background: none;}.modal-close:hover { background: var(--bg); color: var(--text); }.modal-close i { width: 18px; height: 18px; }.modal-body {  padding: 20px;  overflow-y: auto;  flex: 1;}.modal-actions {  display: flex;  gap: 8px;  padding: 12px 20px;  border-top: 1px solid var(--border);  justify-content: flex-end;}/* ── Buttons ── */.btn {  padding: 8px 16px;  border-radius: 8px;  font-weight: 500;  font-size: 0.85rem;  transition: all 0.15s;  min-height: 40px;}.btn-primary { background: var(--primary); color: var(--text-inverse); }.btn-primary:hover { background: var(--primary-dark); }.btn-secondary { background: var(--bg); color: var(--text); }.btn-secondary:hover { background: var(--border); }.btn-danger { background: var(--danger); color: var(--text-inverse); }.btn-danger:hover { background: #c0392b; }.btn-sm { padding: 4px 10px; font-size: 0.8rem; min-height: 32px; }/* ── Cards ── */.card {  background: var(--bg-card);  border: 1px solid var(--border);  border-radius: var(--radius);  padding: 16px;  margin-bottom: 12px;}.card-header {  display: flex;  align-items: center;  justify-content: space-between;  margin-bottom: 12px;}.card-title { font-size: 0.9rem; font-weight: 600; }.card-subtitle { font-size: 0.75rem; color: var(--text-light); }.card-actions { display: flex; gap: 4px; justify-content: flex-end; margin-top: 8px; }/* ── Form Elements ── */.form-group { margin-bottom: 16px; }.form-label {  display: block;  font-size: 0.8rem;  font-weight: 500;  color: var(--text-light);  margin-bottom: 6px;}.form-input {  width: 100%;  padding: 10px 12px;  border: 1px solid var(--border);  border-radius: 8px;  background: var(--bg);  color: var(--text);  font-size: 0.9rem;  transition: border-color 0.15s;  min-height: 44px;}.form-input:focus {  outline: none;  border-color: var(--primary);  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);}textarea.form-input { resize: vertical; min-height: 80px; }select.form-input {  appearance: none;  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23636e72' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");  background-repeat: no-repeat;  background-position: right 12px center;  padding-right: 32px;}/* ── Badges ── */.badge {  display: inline-block;  padding: 2px 8px;  border-radius: 12px;  font-size: 0.7rem;  font-weight: 500;}.badge-primary { background: rgba(45, 106, 79, 0.1); color: var(--primary); }/* ── Mastery Dots ── */.mastery-dots { display: flex; gap: 3px; }.mastery-dot {  width: 8px;  height: 8px;  border-radius: 50%;  background: var(--border);}.mastery-dot.filled { background: var(--primary); }/* ── View Headers ── */.view-header { margin-bottom: 20px; }.view-header h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }.view-subtitle { font-size: 0.85rem; color: var(--text-light); }.view-actions { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }/* ── Empty State ── */.empty-hint { text-align: center; padding: 32px 16px; color: var(--text-light); font-size: 0.9rem; }/* ── Article ── */.article-preview { cursor: pointer; transition: box-shadow 0.15s; }.article-preview:hover { box-shadow: 0 2px 16px rgba(0,0,0,0.06); }.analyzing-spinner { text-align: center; padding: 24px; color: var(--text-light); font-size: 0.95rem; }.article-detail { line-height: 1.8; }.article-detail .article-text p { margin-bottom: 12px; }.article-translation { font-size: 0.95rem; line-height: 1.7; color: var(--text); white-space: pre-wrap; }.vocab-note { padding: 8px 0; border-bottom: 1px solid var(--border); }.vocab-note:last-child { border-bottom: none; }.vocab-note strong { font-size: 0.95rem; }.article-text { line-height: 1.8; }/* ── Dashboard ── */.dash-header { margin-bottom: 24px; }.dash-date { font-size: 0.85rem; color: var(--text-light); margin-top: 4px; }.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 24px; }.stat-card {  background: var(--bg-card);  border: 1px solid var(--border);  border-radius: var(--radius);  padding: 16px;  display: flex;  align-items: center;  gap: 12px;}.stat-icon {  font-size: 1.6rem;  width: 40px;  height: 40px;  display: flex;  align-items: center;  justify-content: center;  border-radius: 10px;  flex-shrink: 0;}.stat-info { display: flex; flex-direction: column; }.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--text); line-height: 1.2; }.stat-label { font-size: 0.75rem; color: var(--text-light); }.dash-section { margin-bottom: 24px; }.dash-section h2 { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }/* ── Phrase Cards ── */.phrase-card { position: relative; }.phrase-jp { font-size: 1.05rem; }.phrase-reading { font-size: 0.85rem; color: var(--text-light); margin-bottom: 4px; }.phrase-zh { font-size: 0.9rem; }/* ── Word Form ── */.word-form { max-width: 480px; }/* ── Review Mode ── */.review-card {  background: var(--bg-card);  border: 1px solid var(--border);  border-radius: var(--radius);  padding: 32px 24px;  margin-bottom: 16px;  text-align: center;}.review-word { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }.review-reading { font-size: 1rem; color: var(--text-light); margin-bottom: 16px; }.review-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }/* ── Settings Tabs ── */.settings-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 0; }.settings-tab {  padding: 10px 16px;  border-radius: 0;  border-bottom: 2px solid transparent;  font-size: 0.85rem;  font-weight: 500;  color: var(--text-light);  background: none;  transition: all 0.15s;}.settings-tab:hover { color: var(--text); }.settings-tab.active { color: var(--primary); border-bottom-color: var(--primary); }/* ── Stat Mini ── */.stat-mini { text-align: center; padding: 12px; background: var(--bg); border-radius: 8px; }.stat-mini-value { display: block; font-size: 1.2rem; font-weight: 700; color: var(--text); }.stat-mini-label { font-size: 0.75rem; color: var(--text-light); }/* ── Speaking ── */.speaking-settings { margin-bottom: 20px; }.speaking-card { margin-bottom: 16px; }.speaking-main { font-size: 1.1rem; margin-bottom: 4px; }.speaking-reading { font-size: 0.85rem; color: var(--text-light); margin-bottom: 4px; }.speaking-translation { font-size: 0.9rem; margin-bottom: 8px; }.speaking-actions { display: flex; gap: 8px; }.speaking-result { font-size: 0.9rem; }.recording-indicator { text-align: center; padding: 12px; color: var(--danger); font-weight: 500; animation: pulse 1s infinite; }@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }.score-result { padding: 12px; background: var(--bg); border-radius: 8px; }.score-result p { margin-bottom: 4px; }/* ── Word Card ── */.word-card { position: relative; }.word-main { font-size: 1.05rem; }.user-card-current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }/* ── 移动端适配 ── */@media (max-width: 640px) {  /* 隐藏桌面导航，显示底部导航 */  .desktop-nav { display: none !important; }  .bottom-nav { display: flex !important; }  body { padding-bottom: 58px; }  /* Main content */  .main-content {    padding: 16px 12px 72px;  }  /* View headers */  .view-header h1 { font-size: 1.25rem; }  .view-actions { gap: 6px; }  .view-actions .btn { flex: 1; text-align: center; }  /* Dashboard stats - single column or 2-col */  .dash-stats {    grid-template-columns: 1fr 1fr;    gap: 8px;  }  .stat-card { padding: 12px; }  .stat-icon { font-size: 1.3rem; width: 36px; height: 36px; }  .stat-value { font-size: 1.2rem; }  .dash-section h2 { font-size: 0.95rem; }  /* Cards */  .card { padding: 14px; }  /* Form inputs */  .form-input { font-size: 16px; } /* 防止 iOS 缩放 */  /* Modal */  .modal-overlay {    padding: 8px;    align-items: flex-end;  }  .modal-container {    max-width: 100%;    max-height: 85vh;    border-radius: var(--radius) var(--radius) 0 0;    margin-bottom: 0;  }  .modal-header { padding: 14px 16px; }  .modal-body { padding: 16px; }  .modal-actions { padding: 12px 16px; }  /* Review */  .review-card { padding: 24px 16px; }  .review-word { font-size: 1.5rem; }  .review-actions { flex-wrap: wrap; }  .review-actions .btn { flex: 1; min-width: 0; }  /* Settings tabs */  .settings-tabs { overflow-x: auto; scrollbar-width: none; }  .settings-tabs::-webkit-scrollbar { display: none; }  .settings-tab { padding: 8px 14px; font-size: 0.8rem; white-space: nowrap; }  /* Speaking */  .speaking-actions .btn { flex: 1; }}@media (max-width: 380px) {  .dash-stats { grid-template-columns: 1fr; }}
/* ── Expert View ── */
.expert-status { text-align: center; padding: 20px; color: var(--text-light); font-size: 0.95rem; }
.expert-status--loading { color: var(--primary); }
.expert-status--error { color: var(--danger); }

.expert-section { border-top: 1px solid var(--border); padding-top: 16px; }

/* Result card */
.expert-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.expert-meta { margin-bottom: 12px; }
.expert-meta p { margin-bottom: 4px; font-size: 0.9rem; }

/* Meaning blocks */
.expert-meanings { margin-bottom: 12px; }
.expert-meaning { margin-bottom: 8px; font-size: 0.9rem; line-height: 1.5; }
.expert-label { font-weight: 600; margin-right: 4px; white-space: nowrap; }
.expert-label--zh { color: var(--primary); }
.expert-label--en { color: #2980b9; }

/* Section blocks */
.expert-section-block { margin-bottom: 12px; }
.expert-section-title { font-size: 0.9rem; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.expert-text { font-size: 0.9rem; line-height: 1.6; color: var(--text); }

/* Examples */
.expert-example { margin-bottom: 10px; padding: 10px 12px; background: var(--bg); border-radius: 8px; }
.expert-example-jp { font-size: 1rem; font-weight: 500; margin-bottom: 2px; }
.expert-example-reading { font-size: 0.8rem; color: var(--text-light); margin-bottom: 2px; }
.expert-example-zh { font-size: 0.85rem; margin-bottom: 0; }
.expert-example-en { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0; }

/* Actions */
.expert-actions { display: flex; gap: 8px; margin-top: 16px; }
.expert-actions--secondary { margin-top: 8px; }
.expert-vocab-badge { color: var(--success); padding: 8px 0; font-size: 0.9rem; }

/* History */
.expert-history-item { cursor: pointer; padding: 10px 14px; }
.expert-history-row { display: flex; justify-content: space-between; align-items: center; }
.expert-history-text { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; }
.expert-history-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expert-history-status { flex-shrink: 0; margin-left: 8px; font-size: 1rem; }

@media (max-width: 640px) {
  .expert-example { padding: 8px 10px; }
  .expert-example-jp { font-size: 0.95rem; }
  .expert-actions { flex-wrap: wrap; }
  .expert-actions .btn { flex: 1; min-width: 0; }
}

/* Expert translation workspace */
.expert-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.expert-page-header h1 {
  font-size: 1.35rem;
  line-height: 1.3;
}

.expert-page-header p {
  margin-top: 4px;
  color: var(--text-light);
  font-size: 0.78rem;
}

.expert-provider {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 290px;
  min-height: 36px;
  padding: 0 10px;
  overflow: hidden;
  color: var(--text-light);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.72rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.expert-provider i {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.expert-provider-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--danger);
  border-radius: 50%;
}

.expert-provider-dot.is-ready {
  background: var(--success);
}

.expert-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 18px;
  align-items: start;
}

.expert-workspace {
  min-width: 0;
}

.translator-shell {
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(45, 52, 54, 0.05);
}

.translator-language-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
}

.translator-language-bar > i {
  width: 15px;
  height: 15px;
  color: var(--text-light);
}

.translator-swap {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: var(--primary);
}

.translator-swap i {
  width: 16px;
  height: 16px;
}

.translator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 250px;
}

.translator-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.translator-input-pane {
  border-right: 1px solid var(--border);
}

.translator-pane textarea {
  width: 100%;
  min-height: 205px;
  padding: 18px;
  resize: none;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-family: 'Noto Sans JP', var(--font-main);
  font-size: 1.08rem;
  line-height: 1.75;
}

.translator-pane textarea::placeholder {
  color: #a3aaaa;
}

.translator-output-pane {
  justify-content: space-between;
  background: rgba(45, 106, 79, 0.025);
}

.translator-placeholder {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--text-light);
  text-align: center;
  font-size: 0.8rem;
}

.translator-placeholder i {
  width: 26px;
  height: 26px;
  opacity: 0.5;
}

.translator-result {
  padding: 18px;
}

.translator-reading {
  margin-bottom: 8px;
  color: var(--text-light);
  font-size: 0.78rem;
}

.translator-translation {
  font-size: 1.08rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.translator-alternatives {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.translator-alternatives span {
  padding: 4px 8px;
  color: var(--text-light);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.7rem;
}

.translator-pane-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
}

.translator-tools {
  display: flex;
  gap: 2px;
}

.translator-tools .btn-icon {
  width: 30px;
  height: 30px;
}

.translator-tools .btn-icon i {
  width: 16px;
  height: 16px;
}

.translator-actionbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-height: 58px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.translator-actionbar > span {
  color: var(--text-light);
  font-size: 0.68rem;
}

.translator-actionbar .btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.translator-actionbar .btn i,
.expert-result-actions .btn i {
  width: 16px;
  height: 16px;
}

.expert-status {
  margin: 12px 0;
  padding: 11px 13px;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
}

.expert-status--loading {
  color: var(--primary);
  border-color: rgba(45, 106, 79, 0.25);
}

.expert-status--error {
  color: var(--danger);
  border-color: rgba(225, 112, 85, 0.4);
}

.expert-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: expert-spin 0.8s linear infinite;
}

@keyframes expert-spin {
  to { transform: rotate(360deg); }
}

.expert-learning-shell {
  margin-top: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.expert-learning-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.expert-learning-title > div:first-child > span {
  color: var(--primary);
  font-size: 0.62rem;
  font-weight: 800;
}

.expert-learning-title h2 {
  margin-top: 3px;
  font-family: 'Noto Sans JP', var(--font-main);
  font-size: 1.3rem;
}

.expert-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.expert-result-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.expert-pos {
  padding: 3px 7px;
  color: var(--primary);
  background: rgba(45, 106, 79, 0.08);
  border-radius: 4px;
  font-size: 0.68rem;
}

.expert-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px 0;
}

.expert-insight {
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}

.expert-insight span {
  color: var(--text-light);
  font-size: 0.68rem;
  font-weight: 700;
}

.expert-insight p {
  margin-top: 5px;
  font-size: 0.84rem;
  line-height: 1.65;
}

.expert-learning-section {
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

.expert-learning-section:last-child {
  padding-bottom: 0;
}

.expert-learning-section h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  font-size: 0.84rem;
}

.expert-learning-section h3 i {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.expert-learning-copy {
  font-size: 0.84rem;
  line-height: 1.75;
}

.expert-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.expert-breakdown > div {
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
}

.expert-breakdown-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.expert-breakdown-item > div {
  min-width: 0;
}

.expert-breakdown-add {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: var(--primary);
}

.expert-breakdown-add:disabled {
  cursor: default;
  opacity: 0.55;
}

.expert-breakdown-add i {
  width: 15px;
  height: 15px;
}

.expert-breakdown strong,
.expert-breakdown span,
.expert-breakdown p {
  display: block;
}

.expert-breakdown strong {
  font-family: 'Noto Sans JP', var(--font-main);
  font-size: 0.82rem;
}

.expert-breakdown span {
  color: var(--text-light);
  font-size: 0.64rem;
}

.expert-breakdown p {
  margin-top: 3px;
  font-size: 0.7rem;
}

.expert-examples article {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.expert-examples article:last-child {
  border-bottom: 0;
}

.expert-examples article > span {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
}

.expert-example-jp {
  font-family: 'Noto Sans JP', var(--font-main);
  font-size: 0.9rem;
  line-height: 1.6;
}

.expert-example-reading,
.expert-example-zh {
  margin-top: 3px;
  color: var(--text-light);
  font-size: 0.72rem;
  line-height: 1.5;
}

.expert-example-speak {
  width: 30px;
  height: 30px;
}

.expert-history-panel {
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.expert-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 10px 0 13px;
  border-bottom: 1px solid var(--border);
}

.expert-history-header h2 {
  font-size: 0.82rem;
}

.expert-history-header .btn-icon {
  width: 30px;
  height: 30px;
}

#expert-history {
  max-height: 620px;
  overflow-y: auto;
}

.expert-history-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 11px 30px 11px 12px;
  text-align: left;
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.expert-history-item:hover,
.expert-history-item.is-active {
  background: rgba(45, 106, 79, 0.06);
}

.expert-history-item.is-active {
  box-shadow: inset 2px 0 var(--primary);
}

.expert-history-query,
.expert-history-meaning,
.expert-history-item time {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expert-history-query {
  font-family: 'Noto Sans JP', var(--font-main);
  font-size: 0.8rem;
  font-weight: 700;
}

.expert-history-meaning {
  margin-top: 3px;
  color: var(--text-light);
  font-size: 0.68rem;
}

.expert-history-item time {
  margin-top: 5px;
  color: #9aa1a3;
  font-size: 0.6rem;
}

.expert-history-item > i {
  position: absolute;
  top: 13px;
  right: 10px;
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.expert-history-empty {
  padding: 28px 12px;
  color: var(--text-light);
  text-align: center;
  font-size: 0.75rem;
}

@media (max-width: 800px) {
  .expert-layout {
    grid-template-columns: 1fr;
  }

  .expert-history-panel {
    position: static;
  }

  #expert-history {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }
}

@media (max-width: 640px) {
  .expert-page-header {
    align-items: flex-start;
  }

  .expert-provider {
    max-width: 160px;
  }

  .translator-language-bar {
    flex-wrap: wrap;
    padding-top: 10px;
  }

  .translator-grid {
    grid-template-columns: 1fr;
  }

  .translator-input-pane {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .translator-pane textarea {
    min-height: 150px;
    font-size: 1rem;
  }

  .translator-output-pane {
    min-height: 170px;
  }

  .translator-actionbar > span {
    display: none;
  }

  .translator-actionbar .btn {
    width: 100%;
    justify-content: center;
  }

  .expert-learning-shell {
    padding: 16px;
  }

  .expert-learning-title {
    display: block;
  }

  .expert-result-actions {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .expert-insight-grid {
    grid-template-columns: 1fr;
  }

  #expert-history {
    grid-template-columns: 1fr;
  }
}
.ai-provider-switch {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.ai-provider-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 8px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg-card);
}

.ai-provider-option.active {
  border-color: var(--primary);
  background: rgba(45, 106, 79, 0.12);
}

.ai-provider-option span {
  min-width: 0;
  font-weight: 700;
}

.ai-provider-option small {
  grid-column: 2;
  color: var(--text-light);
}

.ai-provider-config {
  display: none;
  padding-top: 4px;
}

.ai-provider-config.active {
  display: block;
}

@media (max-width: 700px) {
  .ai-provider-switch {
    grid-template-columns: 1fr;
  }
}

/* Graded news */
.news-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.news-header .btn,
.candidate-actions .btn,
.reader-speech-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.news-header .btn i,
.candidate-actions .btn i {
  width: 17px;
  height: 17px;
}

/* Candidate planning */
.candidate-planner {
  margin-bottom: 28px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.candidate-plan-header,
.candidate-list-header,
.candidate-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.candidate-plan-header h2 {
  margin: 3px 0 5px;
  font-size: 1.05rem;
}

.candidate-plan-header p,
.candidate-list-header p {
  color: var(--text-light);
  font-size: 0.8rem;
}

.candidate-eyebrow {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.candidate-sources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 22px;
}

.candidate-sources a {
  min-width: 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.candidate-sources strong,
.candidate-sources span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-sources strong {
  color: var(--text);
  font-size: 0.8rem;
}

.candidate-sources span {
  margin-top: 2px;
  color: var(--text-light);
  font-size: 0.7rem;
}

.candidate-list-header {
  align-items: flex-end;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.candidate-list-header h3 {
  font-size: 0.92rem;
}

#candidate-count {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.candidate-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 2px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.candidate-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.candidate-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: transparent;
}

.candidate-check i {
  width: 14px;
  height: 14px;
}

.candidate-item input:checked + .candidate-check {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.candidate-copy {
  min-width: 0;
}

.candidate-copy strong,
.candidate-copy small {
  display: block;
}

.candidate-copy strong {
  font-size: 0.88rem;
  line-height: 1.5;
}

.candidate-copy small {
  margin-top: 3px;
  color: var(--text-light);
  font-size: 0.72rem;
}

.candidate-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.news-list {
  border-top: 1px solid var(--border);
}

.news-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  gap: 16px;
  align-items: center;
  padding: 20px 4px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.news-list-item:hover,
.news-list-item:focus-visible {
  background: rgba(255, 255, 255, 0.45);
  outline: none;
}

.news-list-item h2 {
  margin: 8px 0 6px;
  font-size: 1.08rem;
  line-height: 1.45;
}

.news-list-item p {
  color: var(--text-light);
  font-size: 0.88rem;
  line-height: 1.6;
}

.news-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  color: var(--text-light);
  font-size: 0.75rem;
}

.news-list-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.news-list-meta i {
  width: 14px;
  height: 14px;
}

.news-source-line {
  margin-top: 10px;
  color: var(--text-light);
  font-size: 0.74rem;
}

.news-list-arrow {
  width: 20px;
  height: 20px;
  color: var(--text-light);
}

.news-empty {
  padding: 72px 20px;
  text-align: center;
  color: var(--text-light);
}

.news-empty > i {
  width: 36px;
  height: 36px;
  margin-bottom: 14px;
}

.news-empty h2 {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1rem;
}

.news-progress,
.news-error {
  font-size: 0.88rem;
  line-height: 1.55;
}

.news-progress p {
  margin-top: 4px;
  color: var(--text-light);
}

.news-error {
  border-color: var(--danger);
  color: var(--danger);
}

.news-success {
  margin-bottom: 16px;
  color: var(--success);
  font-size: 0.85rem;
}

/* Reader */
.reader-toolbar {
  position: sticky;
  top: var(--nav-height);
  z-index: 20;
  display: flex;
  align-items: center;
  min-height: 52px;
  margin: -12px 0 24px;
  padding: 8px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.reader-toolbar-spacer {
  flex: 1;
}

.reader-speech-controls {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-right: 8px;
}

.reader-speech-controls .btn-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.reader-speech-controls i {
  width: 16px;
  height: 16px;
}

.reader-speed {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.72rem;
}

.reader-speed select {
  border: 0;
  color: var(--text);
  background: transparent;
  outline: none;
}

.reader-speech-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  color: var(--text-light);
  font-size: 0.76rem;
}

.reader-speech-hint i {
  width: 15px;
  height: 15px;
}

.reader-back {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.furigana-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
}

.reader-shell {
  max-width: 720px;
  margin: 0 auto;
}

.reader-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.reader-header h1 {
  margin: 14px 0 10px;
  font-size: 1.8rem;
  line-height: 1.45;
}

.reader-header > p {
  color: var(--text-light);
  line-height: 1.7;
}

.reader-body {
  padding: 30px 0;
  font-family: 'Noto Sans JP', var(--font-main);
  font-size: 1.08rem;
  line-height: 2.25;
}

.reader-body p {
  margin-bottom: 1.4em;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.reader-body p:hover {
  background: rgba(45, 106, 79, 0.06);
}

.reader-body p.is-speaking {
  background: rgba(253, 203, 110, 0.22);
  box-shadow: inset 3px 0 var(--accent);
}

.reader-body ruby {
  ruby-align: center;
}

.reader-body rt {
  color: var(--text-light);
  font-size: 0.55em;
  font-weight: 400;
}

.reader-shell.hide-furigana rt {
  display: none;
}

.reader-vocabulary {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.reader-vocabulary h2 {
  margin-bottom: 14px;
  font-size: 1rem;
}

.reader-vocab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.reader-vocab-item {
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.reader-vocab-item strong {
  margin-right: 8px;
}

.reader-vocab-item span,
.reader-vocab-item p {
  color: var(--text-light);
  font-size: 0.78rem;
}

.reader-source {
  margin-top: 24px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  color: var(--text-light);
  font-size: 0.8rem;
  line-height: 1.6;
}

.reader-source a {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
}

@media (max-width: 640px) {
  .news-header {
    display: block;
  }

  .news-header .btn {
    width: 100%;
    margin-top: 14px;
  }

  .news-list-item {
    padding: 18px 0;
  }

  .reader-toolbar {
    top: 0;
    flex-wrap: wrap;
  }

  .reader-toolbar-spacer {
    display: none;
  }

  .reader-speech-controls {
    order: 3;
    width: 100%;
    margin: 6px 0 0;
  }

  .furigana-toggle {
    margin-left: auto;
  }

  .candidate-planner {
    padding: 16px;
  }

  .candidate-sources {
    grid-template-columns: 1fr;
  }

  .reader-header h1 {
    font-size: 1.4rem;
  }

  .reader-body {
    font-size: 1rem;
    line-height: 2.15;
  }

  .reader-vocab-grid {
    grid-template-columns: 1fr;
  }
}

/* Daily learning dashboard */
.learning-hero,
.yesterday-card,
.today-report,
.learning-history {
  margin-bottom: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.learning-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  color: #fff;
  background: linear-gradient(135deg, #163f30 0%, #2d6a4f 72%, #4b8b68 100%);
  border: 0;
  box-shadow: 0 14px 32px rgba(27, 67, 50, 0.18);
}

.learning-hero h1 {
  margin: 5px 0 7px;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.35;
}

.learning-hero .dash-date {
  color: rgba(255, 255, 255, 0.72);
}

.learning-eyebrow,
.section-kicker {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.checkin-button {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 190px;
  padding: 13px 15px;
  color: #173d2f;
  background: #fff9e9;
  border-radius: 12px;
  text-align: left;
}

.checkin-button.is-checked {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.checkin-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: #fff;
  background: var(--accent);
  border-radius: 10px;
}

.checkin-icon i {
  width: 19px;
}

.checkin-button strong,
.checkin-button small {
  display: block;
}

.checkin-button strong {
  font-size: 0.86rem;
}

.checkin-button small {
  margin-top: 2px;
  opacity: 0.72;
  font-size: 0.66rem;
}

.yesterday-card {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(280px, 1.4fr) auto;
  gap: 22px;
  align-items: center;
  padding: 22px 24px;
  border-left: 4px solid var(--accent);
}

.yesterday-copy h2,
.section-heading h2 {
  margin-top: 4px;
  font-size: 1.05rem;
}

.yesterday-copy p,
.report-note {
  margin-top: 7px;
  color: var(--text-light);
  font-size: 0.78rem;
  line-height: 1.6;
}

.focus-list {
  display: grid;
  gap: 7px;
}

.focus-item {
  display: grid;
  grid-template-columns: 42px minmax(80px, 0.7fr) minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  font-size: 0.77rem;
}

.focus-type {
  padding: 3px 6px;
  color: var(--primary);
  background: rgba(45, 106, 79, 0.09);
  border-radius: 5px;
  text-align: center;
  font-size: 0.62rem;
}

.focus-item strong,
.focus-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focus-item small {
  color: var(--text-light);
}

.focus-empty {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-light);
  font-size: 0.76rem;
}

.focus-empty i {
  width: 18px;
}

.quick-review-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
}

.quick-review-button i {
  width: 16px;
}

.today-report,
.learning-history {
  padding: 22px 24px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.report-status,
.history-total {
  color: var(--text-light);
  font-size: 0.7rem;
}

.report-status {
  padding: 4px 8px;
  color: var(--primary);
  background: rgba(45, 106, 79, 0.08);
  border-radius: 20px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.report-metric {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  color: var(--text);
  background: #fbfaf3;
  border: 1px solid #eee9d8;
  border-radius: 10px;
  text-align: left;
  transition: transform 0.15s, border-color 0.15s;
}

.report-metric:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.report-metric-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--primary);
  background: rgba(45, 106, 79, 0.09);
  border-radius: 9px;
}

.report-metric-icon i {
  width: 17px;
}

.report-metric strong,
.report-metric small {
  display: block;
}

.report-metric strong {
  font-size: 1.15rem;
  line-height: 1;
}

.report-metric small {
  margin-top: 4px;
  color: var(--text-light);
  font-size: 0.65rem;
}

.history-list {
  display: grid;
}

.history-entry {
  border-top: 1px solid var(--border);
}

.history-day {
  display: grid;
  grid-template-columns: 82px minmax(120px, 1fr) 68px 22px 18px;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.history-day:hover {
  background: rgba(45, 106, 79, 0.035);
}

.history-day.is-today {
  color: var(--primary);
}

.history-date strong,
.history-date span,
.history-result strong,
.history-result span {
  display: block;
}

.history-date strong {
  font-size: 0.76rem;
}

.history-date span,
.history-result span {
  color: var(--text-light);
  font-size: 0.62rem;
}

.history-bar {
  height: 6px;
  overflow: hidden;
  background: #edf0ed;
  border-radius: 10px;
}

.history-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: inherit;
}

.history-result {
  text-align: right;
}

.history-result strong {
  font-size: 0.8rem;
}

.history-check {
  color: var(--border);
}

.history-check.is-checked {
  color: var(--success);
}

.history-check i {
  width: 17px;
}

.history-chevron {
  width: 16px;
  color: var(--text-light);
  transition: transform 0.15s;
}

.history-entry.is-expanded .history-chevron {
  transform: rotate(180deg);
}

.history-detail {
  padding: 4px 16px 16px 96px;
}

.history-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--text-light);
  font-size: 0.7rem;
}

.history-detail-header > span.is-checked {
  color: var(--success);
}

.history-detail-list {
  display: grid;
  gap: 7px;
}

.history-detail-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  background: #fbfaf3;
  border: 1px solid #eee9d8;
  border-radius: 8px;
}

.history-detail-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--primary);
  background: rgba(45, 106, 79, 0.08);
  border-radius: 7px;
}

.history-detail-icon i {
  width: 15px;
}

.history-detail-copy,
.history-detail-copy small,
.history-detail-copy strong,
.history-detail-copy > span {
  display: block;
  min-width: 0;
}

.history-detail-copy small {
  color: var(--text-light);
  font-size: 0.62rem;
}

.history-detail-copy strong {
  margin-top: 2px;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-detail-copy > span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--text-light);
  font-size: 0.68rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-detail-empty {
  padding: 14px;
  color: var(--text-light);
  background: #fbfaf3;
  border-radius: 8px;
  font-size: 0.72rem;
  text-align: center;
}

@media (max-width: 760px) {
  .yesterday-card {
    grid-template-columns: 1fr;
  }

  .quick-review-button {
    width: 100%;
  }

  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .learning-hero {
    display: block;
    padding: 22px 18px;
  }

  .checkin-button {
    width: 100%;
    margin-top: 18px;
  }

  .yesterday-card,
  .today-report,
  .learning-history {
    padding: 18px 16px;
  }

  .focus-item {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .focus-item small {
    grid-column: 2;
  }

  .history-day {
    grid-template-columns: 62px minmax(60px, 1fr) 52px 18px 15px;
    gap: 9px;
  }

  .history-detail {
    padding: 4px 0 14px;
  }

  .bottom-nav {
    height: 68px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .bottom-nav::-webkit-scrollbar {
    display: none;
  }

  .bottom-nav-inner {
    width: max-content;
    min-width: 100%;
    padding: 0 6px;
  }

  .bottom-nav-link {
    flex: 0 0 68px;
    min-width: 68px;
    min-height: 68px;
    gap: 5px;
    padding: 7px 8px 6px;
  }

  .bottom-nav-link i {
    width: 23px;
    height: 23px;
  }

  .bottom-nav-link span {
    font-size: 0.6rem;
  }

  body {
    padding-bottom: 68px;
  }

  .main-content {
    padding-bottom: 82px;
  }
}

.settings-guide-copy,
.settings-guide-list {
  margin-top: 10px;
  color: var(--text-light);
  font-size: 0.84rem;
  line-height: 1.75;
}

.settings-guide-list {
  padding-left: 22px;
}

.settings-guide-list li + li {
  margin-top: 5px;
}

.settings-guide-warning {
  border-color: rgba(225, 112, 85, 0.35);
  background: rgba(225, 112, 85, 0.035);
}

/* Authentication and privacy */
.auth-page {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  min-height: 100vh;
  background: #fff;
}

.auth-brand-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 44px;
  padding: clamp(32px, 7vw, 80px);
  color: #fff;
  background:
    radial-gradient(circle at 80% 15%, rgba(212, 163, 115, 0.28), transparent 28%),
    linear-gradient(145deg, #123d2d, #2d6a4f);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
}

.auth-brand > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 10px;
}

.auth-brand-panel h1 {
  max-width: 520px;
  margin: 8px 0 12px;
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.15;
}

.auth-brand-panel > div > p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.7;
}

.auth-feature-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.auth-feature-list span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
}

.auth-feature-list i {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.auth-local-note {
  display: flex;
  gap: 12px;
  max-width: 520px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
}

.auth-local-note > i {
  width: 22px;
  flex: 0 0 auto;
  color: var(--accent);
}

.auth-local-note p {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  line-height: 1.55;
}

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 80px 28px 40px;
  background: #fffdf6;
}

.auth-language {
  position: absolute;
  top: 24px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-light);
  font-size: 0.75rem;
}

.auth-language .form-input {
  width: 138px;
  min-height: 38px;
  padding-top: 7px;
  padding-bottom: 7px;
  background-color: #fff;
}

.auth-form {
  width: min(420px, 100%);
}

.auth-form h2 {
  margin-bottom: 22px;
  font-size: 1.55rem;
}

.form-help {
  display: block;
  margin-top: 5px;
  color: var(--text-light);
  font-size: 0.68rem;
}

.auth-consent {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.5;
  cursor: pointer;
}

.auth-consent input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.auth-policy-link {
  margin: 7px 0 16px 26px;
  color: var(--primary);
  background: none;
  font-size: 0.75rem;
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
}

.auth-switch {
  margin-top: 17px;
  color: var(--text-light);
  text-align: center;
  font-size: 0.78rem;
}

.auth-switch button {
  color: var(--primary);
  background: none;
  font-weight: 700;
}

.auth-security {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  margin-top: 22px;
  padding-top: 16px;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  line-height: 1.55;
}

.auth-security i {
  width: 15px;
  flex: 0 0 auto;
}

.auth-public-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px 14px;
  margin-top: 14px;
}

.auth-public-links button {
  color: var(--text-light);
  background: none;
  font-size: 0.7rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.settings-danger-card {
  border-color: rgba(225, 112, 85, 0.35);
  background: rgba(225, 112, 85, 0.035);
}

.settings-danger-card .btn,
.about-actions {
  margin-top: 14px;
}

.about-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.auth-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  color: #a94432;
  background: rgba(225, 112, 85, 0.09);
  border: 1px solid rgba(225, 112, 85, 0.25);
  border-radius: 8px;
  font-size: 0.78rem;
}

.policy-content > p {
  margin-bottom: 18px;
  color: var(--text-light);
  line-height: 1.6;
}

.policy-content section {
  padding: 13px 0;
  border-top: 1px solid var(--border);
}

.policy-content section h4 {
  margin-bottom: 5px;
  font-size: 0.86rem;
}

.policy-content section p {
  color: var(--text-light);
  font-size: 0.78rem;
  line-height: 1.65;
}

.policy-modal .modal-header {
  flex: 0 0 auto;
  gap: 16px;
}

.policy-modal .modal-header h3 {
  min-width: 0;
  line-height: 1.4;
}

.policy-modal .modal-close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  color: var(--text-light);
  background: var(--bg);
  border-radius: 50%;
}

.policy-modal .modal-close i {
  width: 18px;
  height: 18px;
}

.policy-modal .modal-actions {
  flex: 0 0 auto;
  background: var(--bg-card);
}

@media (max-width: 720px) {
  .auth-page {
    display: block;
    min-height: 100vh;
    background: #fffdf6;
  }

  .auth-brand-panel {
    min-height: 310px;
    padding: 28px 22px;
  }

  .auth-brand-panel h1 {
    font-size: 1.8rem;
  }

  .auth-local-note {
    display: none;
  }

  .auth-form-panel {
    align-items: flex-start;
    padding: 78px 20px 38px;
  }

  .auth-language {
    top: 20px;
    right: 20px;
  }
}

@media (max-width: 640px) {
  .policy-modal {
    max-height: min(88vh, 720px);
  }

  .policy-modal .modal-header {
    padding: 14px 16px;
  }

  .policy-modal .modal-header h3 {
    font-size: 0.95rem;
  }

  .policy-modal .modal-body {
    padding: 14px 16px;
  }

  .policy-modal .modal-actions {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .policy-modal .modal-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .modal-header .modal-close {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    margin: -8px -8px -8px 0;
  }

  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(68px + env(safe-area-inset-bottom));
  }

  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .main-content {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }
}
/* Spelling review */
.spelling-review-card {
  display: grid;
  gap: 14px;
  padding: 28px 24px;
}

.review-mode-label {
  color: var(--text-light);
  font-size: 0.85rem;
  margin: 0;
}

.review-hint {
  color: var(--text-light);
  line-height: 1.6;
  margin: 0;
}

.review-answer-form {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  text-align: left;
}

.review-answer-input {
  font-size: 1.15rem;
  text-align: center;
}

.review-feedback {
  border-radius: 8px;
  font-size: 0.9rem;
  min-height: 24px;
  padding: 8px 10px;
  text-align: center;
}

.review-feedback:empty {
  padding: 0;
}

.review-feedback.is-correct {
  background: rgba(0, 184, 148, 0.12);
  color: var(--success);
}

.review-feedback.is-wrong {
  background: rgba(225, 112, 85, 0.12);
  color: var(--danger);
}

/* Close button tuning */
.modal-header .modal-close {
  border: none;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 600;
}

@media (max-width: 640px) {
  .modal-header .modal-close {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }
}

/* Phrase scenario practice */
.phrase-form-body,
.phrase-practice-card {
  display: grid;
  gap: 14px;
}

.phrase-tag-list,
.phrase-prompt-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.phrase-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.08);
  color: var(--text);
  font-size: 0.75rem;
  line-height: 1.3;
}

.phrase-pill strong {
  color: var(--primary);
  font-weight: 600;
}

.phrase-prompt-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.phrase-prompt {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.7;
  color: var(--text);
}

.phrase-reference {
  color: var(--text-light);
  font-size: 0.85rem;
}

.phrase-card .card-header {
  gap: 12px;
}

@media (max-width: 640px) {
  .phrase-prompt-card {
    padding: 14px;
  }

  .phrase-pill {
    padding: 5px 9px;
    font-size: 0.72rem;
  }
}
