:root {
  color-scheme: light;
  /* UiKitTokens - Handbook (日系手账模式基准) */
  --bg: #f7f4ef;
  --surface: #ffffff;
  --surface-paper: #fdfbf7;
  --surface-variant: #f0ebe3;
  --text: #2d2824;
  --muted: #7d7166;
  --line: #d7d0c5;
  --accent: #d8662b;
  --accent-dark: #a74416;
  --accent-hover: #c0541e;
  --accent-soft: rgba(216, 102, 43, 0.12);
  --primary-blue: #4a6fa5;
  --matcha: #a4b29e;
  --sakura: #e8c3c4;
  --ok: #2e7d32;
  --ok-bg: #edf7ed;
  --ok-line: #b7ddc5;
  --error: #c62828;
  --error-bg: #fde8e8;
  --error-line: #f5c2c7;
  --radius-card: 16px;
  --radius-btn: 10px;
  --radius-pill: 999px;
  --card-shadow: 0 10px 28px -6px rgba(80, 56, 32, 0.08), 0 3px 10px -2px rgba(80, 56, 32, 0.04);
  --card-hover-shadow: 0 18px 36px -8px rgba(80, 56, 32, 0.13), 0 6px 14px -3px rgba(80, 56, 32, 0.06);
  --header-bg: rgba(247, 244, 239, 0.92);
}

[data-theme="night"] {
  color-scheme: dark;
  /* UiKitTokens - Night (沉浸夜读模式) */
  --bg: #111317;
  --surface: #1b1f24;
  --surface-paper: #21262d;
  --surface-variant: #262c33;
  --text: #e8ebef;
  --muted: #9aa5b1;
  --line: #39414b;
  --accent: #fb923c;
  --accent-dark: #ea580c;
  --accent-hover: #fdba74;
  --accent-soft: rgba(251, 146, 60, 0.15);
  --primary-blue: #8fb8ff;
  --matcha: #9fc0aa;
  --sakura: #e8c3c4;
  --ok: #4ade80;
  --ok-bg: rgba(74, 222, 128, 0.12);
  --ok-line: rgba(74, 222, 128, 0.3);
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.12);
  --error-line: rgba(248, 113, 113, 0.3);
  --card-shadow: 0 10px 28px -6px rgba(0, 0, 0, 0.5);
  --card-hover-shadow: 0 18px 36px -8px rgba(0, 0, 0, 0.7);
  --header-bg: rgba(17, 19, 23, 0.92);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-dark);
}

/* ================= 矢量 SVG 图标通用规范 ================= */
.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
  flex-shrink: 0;
}

.icon-sm {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
}

.icon-lg {
  width: 22px;
  height: 22px;
}

/* ================= 顶部导航栏 ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 4px 12px rgba(216, 102, 43, 0.3);
  font-weight: 800;
  font-size: 18px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}

nav a {
  padding: 7px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  transition: all 0.15s ease;
}

nav a:hover {
  color: var(--text);
  background: var(--surface-variant);
  text-decoration: none;
}

nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--surface-variant);
  border-color: var(--accent);
  transform: rotate(15deg);
}

/* ================= 布局主容器 ================= */
main {
  width: min(1140px, calc(100% - 40px));
  margin: 0 auto;
}

/* ================= TapeTag (胶带标签 - 日系手账规范) ================= */
.tape-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transform: rotate(-1.5deg);
  background: linear-gradient(135deg, rgba(232, 195, 196, 0.45) 0%, rgba(247, 244, 239, 0.9) 100%);
  border: 1px dashed rgba(215, 208, 197, 0.95);
  color: var(--text);
  box-shadow: 0 2px 5px rgba(80, 56, 32, 0.04);
  transition: transform 0.2s ease;
}

[data-theme="night"] .tape-tag {
  background: linear-gradient(135deg, rgba(232, 195, 196, 0.18) 0%, rgba(33, 38, 45, 0.9) 100%);
  border-color: rgba(57, 65, 75, 0.9);
}

.tape-tag:hover {
  transform: rotate(0deg) scale(1.02);
}

.tape-tag.matcha {
  background: linear-gradient(135deg, rgba(164, 178, 158, 0.45) 0%, rgba(247, 244, 239, 0.9) 100%);
  transform: rotate(1.2deg);
}

[data-theme="night"] .tape-tag.matcha {
  background: linear-gradient(135deg, rgba(159, 192, 170, 0.18) 0%, rgba(33, 38, 45, 0.9) 100%);
}

.tape-tag.accent {
  background: linear-gradient(135deg, rgba(216, 102, 43, 0.2) 0%, rgba(247, 244, 239, 0.9) 100%);
  transform: rotate(-1deg);
  border-color: var(--accent);
}

/* ================= MetricChip (数据指标胶囊) ================= */
.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
  font-feature-settings: "tnum";
  white-space: nowrap;
}

.metric-chip strong {
  color: var(--text);
  font-weight: 700;
}

/* ================= Material 3 卡片体系 ================= */
.material-card,
.web-card,
.summary-panel,
.content-grid article,
.notice,
.legal section,
.contact-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.material-card:hover,
.web-card:hover,
.content-grid article:hover {
  box-shadow: var(--card-hover-shadow);
}

/* ================= 按钮与交互规范 ================= */
button,
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-btn);
  padding: 9px 18px;
  color: #ffffff;
  background: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(216, 102, 43, 0.2);
}

button:hover,
.primary-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(216, 102, 43, 0.3);
  text-decoration: none;
}

button:active,
.primary-btn:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none !important;
  box-shadow: none !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.flashcard-box:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 72%, white);
  outline-offset: 3px;
}

.secondary-btn,
.secondary-button {
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.secondary-btn:hover,
.secondary-button:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--surface-variant);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

.danger-btn,
.danger-button {
  color: var(--error);
  border: 1px solid var(--error-line);
  background: var(--error-bg);
  box-shadow: none;
}

.danger-btn:hover,
.danger-button:hover {
  background: var(--error);
  color: #ffffff;
  border-color: var(--error);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.05);
}

/* ================= 表单输入规范 ================= */
input,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  padding: 9px 14px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

label {
  display: block;
  margin: 14px 0 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

/* ================= 门户首页 Hero & Grid ================= */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 36px;
  align-items: center;
  padding: 60px 0 44px;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(36px, 5.5vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
}

h2 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.summary-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: var(--surface-paper);
}

.summary-panel div {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.summary-panel div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.summary-panel .label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.summary-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 16px 0 28px;
}

.content-grid article,
.notice,
.legal section {
  padding: 24px;
}

.feature-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.feature-icon-wrapper {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}

.content-grid p,
.notice p,
.legal p {
  color: var(--muted);
  font-size: 15px;
}

.notice {
  margin: 16px 0 56px;
  background: var(--surface-variant);
}

.legal {
  max-width: 860px;
  padding: 48px 0 56px;
}

.legal section {
  margin-top: 20px;
}

/* ================= 呼吸指示灯与服务状态 ================= */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  margin-right: 6px;
  animation: pulse-glow 2s infinite ease-in-out;
}

.status-dot.error {
  background: var(--error);
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(74, 222, 128, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
  }
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
}

.sync-status.ok {
  color: var(--ok);
  border-color: var(--ok-line);
  background: var(--ok-bg);
}

.sync-status.error {
  color: var(--error);
  border-color: var(--error-line);
  background: var(--error-bg);
}

/* ================= App Shell 学习入口 ================= */
.app-shell {
  padding: 36px 0 56px;
}

.app-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.web-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 20px;
  margin-bottom: 20px;
}

.web-card {
  padding: 24px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.code-panel {
  margin-top: 10px;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-title-left h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-left .muted {
  margin: 0;
  font-size: 14px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= 查词与发音模块 ================= */
.lookup-form {
  position: relative;
  margin-top: 16px;
}

.lookup-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.lookup-input-wrapper input {
  padding-right: 40px;
  font-size: 16px;
}

.clear-input-btn {
  position: absolute;
  right: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-variant);
  color: var(--muted);
  padding: 0;
  cursor: pointer;
}

.clear-input-btn:hover {
  color: var(--text);
}

.lookup-result {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-paper);
  animation: fadeIn 0.25s ease;
}

.lookup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lookup-word-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.lookup-word-group strong {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}

.lookup-word-group .phonetic {
  color: var(--muted);
  font-family: Arial, "Lucida Sans Unicode", sans-serif;
  font-size: 15px;
}

.speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  padding: 0;
  box-shadow: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.speak-btn:hover {
  background: var(--accent);
  color: #ffffff;
  transform: scale(1.1);
}

.lookup-meaning {
  margin: 0;
  font-size: 16px;
  color: var(--text);
  line-height: 1.6;
}

.lookup-examples {
  margin: 4px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
}

.lookup-examples li {
  margin-bottom: 6px;
}

/* ================= 词库与搜索过滤 ================= */
.word-search-bar {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.word-search-bar input {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 14px;
}

.word-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.word-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-paper);
  transition: all 0.18s ease;
}

.word-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
  background: var(--surface);
}

.word-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.word-item-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.word-item-left strong {
  font-size: 17px;
  font-weight: 700;
}

.word-item-left .phonetic {
  color: var(--muted);
  font-size: 13px;
}

.word-item p {
  margin: 0;
  font-size: 14px;
  color: var(--text);
}

.word-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/* ================= 事件记录列表 ================= */
.event-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.event-item {
  display: grid;
  gap: 6px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-paper);
}

.event-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.event-item strong {
  color: var(--text);
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.event-item span {
  color: var(--muted);
  font-size: 12px;
}

.event-item code {
  overflow-wrap: anywhere;
  white-space: normal;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--surface-variant);
  padding: 6px 10px;
  border-radius: 6px;
}

/* ================= StudyActionCard (三项功能大卡) ================= */
.study-action-card {
  cursor: pointer;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.study-action-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  margin-top: 8px;
}

/* ================= 个人主页 Card ================= */
.profile-list {
  margin: 0;
}

.profile-list div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.profile-list div:last-child {
  border-bottom: 0;
}

.profile-list dt {
  color: var(--muted);
}

.profile-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
  color: var(--text);
}

/* ================= 翻卡背词模态框 (Flashcard Modal) ================= */
[hidden],
.modal-backdrop[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  padding: 28px;
  position: relative;
  animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
}

.flashcard-box {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-paper);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.flashcard-box[role="button"] { outline: none; }

.flashcard-box:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.flashcard-box h3 {
  font-size: 36px;
  margin: 0 0 10px;
  color: var(--text);
}

.flashcard-box .phonetic {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 16px;
}

.flashcard-flip-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.flashcard-back {
  width: 100%;
  animation: fadeIn 0.25s ease;
}

.flashcard-meaning {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.flashcard-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.flashcard-progress {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ================= 划词阅读小工具 (Reader Tool Modal) ================= */
.reader-workspace {
  margin-top: 14px;
}

.reader-input-area {
  min-height: 110px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.6;
}

.reader-tokens-box {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-paper);
  min-height: 120px;
  line-height: 2.2;
  font-size: 16px;
}

.reader-word-chip {
  display: inline-block;
  padding: 2px 6px;
  margin: 2px 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.reader-word-chip:hover {
  background: var(--accent);
  color: #ffffff;
  transform: scale(1.06);
}

/* ================= 多端协同架构模态框 (Sync Architecture Modal) ================= */
.sync-arch-box {
  margin: 16px 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: var(--surface-paper);
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}

.sync-node {
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.sync-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.sync-feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.sync-feature-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
}

.sync-feature-item strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 14px;
}

/* ================= 全局 Toast 提示组件 ================= */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 420px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
  font-size: 14px;
  font-weight: 600;
  animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

.toast.ok {
  border-color: var(--ok-line);
  background: var(--ok-bg);
  color: var(--ok);
}

.toast.error {
  border-color: var(--error-line);
  background: var(--error-bg);
  color: var(--error);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(30px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
}

/* ================= 落地页现代组件 (Landing Page Modern Components) ================= */
.hero-modern {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  padding: clamp(32px, 6vw, 64px) clamp(20px, 5vw, 72px) 32px;
}

.hero-preview-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-preview-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-hover-shadow);
}

.preview-card-inner {
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--surface-paper);
  padding: 24px;
  text-align: center;
  position: relative;
}

.preview-card-inner h3 {
  font-size: 28px;
  margin: 0 0 6px;
  color: var(--text);
}

.preview-chip-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.metrics-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 0 clamp(20px, 5vw, 72px);
  margin: 24px 0 48px;
}

.metric-stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.metric-stat-number {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.metric-stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
}

/* ================= FSRS 科学对比板块 ================= */
.science-section {
  padding: 0 clamp(20px, 5vw, 72px);
  margin: 48px 0;
}

.science-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}

.science-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--card-shadow);
}

.science-card.highlight {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-variant) 100%);
}

.curve-chart-box {
  height: 140px;
  width: 100%;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================= 学习端仪表盘 (Study Stats Dashboard) ================= */
.study-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.dashboard-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.dashboard-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.dashboard-icon.matcha {
  background: rgba(164, 178, 158, 0.2);
  color: #3b5a3d;
}

.dashboard-icon.blue {
  background: rgba(74, 111, 165, 0.15);
  color: var(--primary-blue);
}

.dashboard-icon.sakura {
  background: rgba(232, 195, 196, 0.35);
  color: #a84b50;
}

.dashboard-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.dashboard-title {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* ================= FSRS 4 档评分背词按钮组 ================= */
.fsrs-rating-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.fsrs-rate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.fsrs-rate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.fsrs-rate-btn .interval-chip {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.8;
}

.fsrs-rate-btn.rate-again {
  color: var(--error);
  border-color: var(--error-line);
  background: var(--error-bg);
}
.fsrs-rate-btn.rate-again:hover {
  background: var(--error);
  color: #ffffff;
}

.fsrs-rate-btn.rate-hard {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}
.fsrs-rate-btn.rate-hard:hover {
  background: #d97706;
  color: #ffffff;
}

.fsrs-rate-btn.rate-good {
  color: var(--ok);
  border-color: var(--ok-line);
  background: var(--ok-bg);
}
.fsrs-rate-btn.rate-good:hover {
  background: var(--ok);
  color: #ffffff;
}

.fsrs-rate-btn.rate-easy {
  color: var(--primary-blue);
  border-color: rgba(74, 111, 165, 0.3);
  background: rgba(74, 111, 165, 0.08);
}
.fsrs-rate-btn.rate-easy:hover {
  background: var(--primary-blue);
  color: #ffffff;
}

.kbd-shortcut {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-family: monospace;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-variant);
  color: var(--muted);
  margin-top: 2px;
}

/* ================= 词库分类标签与搜索栏 ================= */
.filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-tab-btn {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ================= 阅读器预设示例文章 ================= */
.reader-presets-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 12px 0 6px;
}

.reader-preset-chip {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-variant);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.reader-preset-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ================= 统一页脚 ================= */
footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px clamp(20px, 5vw, 72px);
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
  margin-top: 40px;
}

/* ================= 移动端响应式规范 ================= */
@media (max-width: 780px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-right {
    justify-content: space-between;
  }

  nav {
    overflow-x: auto;
    padding-bottom: 4px;
    flex-wrap: nowrap;
  }

  .hero-modern,
  .hero,
  .content-grid,
  .web-grid,
  .metrics-banner,
  .science-grid,
  .study-dashboard {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 36px;
  }

  .app-hero,
  .section-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .fsrs-rating-grid {
    grid-template-columns: 1fr 1fr;
  }

  .toast-container {
    left: 20px;
    right: 20px;
    top: 16px;
  }
}

@media (max-width: 600px) {
  .site-header { padding: 10px 16px; gap: 10px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand-mark { width: 32px; height: 32px; font-size: 16px; }
  .site-header nav { display: none; }
  main { width: min(100% - 24px, 1140px); }
  .app-hero { padding: 26px 0 18px; }
  .app-hero h1 { font-size: clamp(28px, 9vw, 40px); line-height: 1.15; }
  .study-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dashboard-card { padding: 14px 12px; gap: 10px; }
  .dashboard-num { font-size: 20px; }
  .dashboard-title { font-size: 11px; line-height: 1.35; }
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal-content { max-height: 92vh; padding: 20px 16px; border-radius: 16px 16px 10px 10px; }
  .flashcard-box { min-height: 210px; padding: 24px 12px; }
  .flashcard-box h3 { font-size: clamp(28px, 10vw, 36px); }
  .flashcard-actions { gap: 8px; }
  .flashcard-actions button { padding: 10px 6px; font-size: 12px; }
  .sync-feature-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ================= 客户端原生生态与跨端特性专区 ================= */
.download-portal-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 36px 32px;
  margin-bottom: 40px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.download-portal-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--primary-blue), var(--matcha));
}

.download-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 28px;
}

.download-header h2 {
  font-size: clamp(24px, 3.5vw, 32px);
  margin: 10px 0 8px;
  letter-spacing: -0.5px;
}

.client-ecosystem-banner {
  background: var(--surface-paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 28px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 28px;
}

@media (max-width: 768px) {
  .client-ecosystem-banner {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 20px;
  }
}

.client-profile-box {
  display: flex;
  gap: 18px;
  align-items: center;
}

.download-app-icon {
  width: 68px;
  height: 68px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  background: #ffffff;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.download-app-info h3 {
  margin: 0 0 4px;
  font-size: 19px;
  color: var(--text);
}

.download-app-info p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.download-security-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.client-changelog-box {
  border-left: 1px dashed var(--line);
  padding-left: 24px;
}

@media (max-width: 768px) {
  .client-changelog-box {
    border-left: none;
    border-top: 1px dashed var(--line);
    padding-left: 0;
    padding-top: 16px;
  }
}

.download-exclusive-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 8px;
  padding-top: 8px;
}

@media (max-width: 960px) {
  .download-exclusive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .download-exclusive-grid {
    grid-template-columns: 1fr;
  }
}

.download-exclusive-card {
  background: var(--surface-paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.download-exclusive-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.download-exclusive-card strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text);
}

.download-exclusive-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* ================= 大屏端 KG-lite 数据雷达图与记忆报表 ================= */
.kg-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
}

.kg-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  align-items: center;
  margin-top: 16px;
}

.kg-radar-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.kg-radar-canvas {
  max-width: 100%;
  height: auto;
}

.kg-stats-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fsrs-distribution-card {
  background: var(--surface-paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
}

.fsrs-stage-row {
  margin-bottom: 12px;
}

.fsrs-stage-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

.fsrs-stage-bar {
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.fsrs-stage-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.fsrs-stage-fill.stage-new { background: var(--muted); }
.fsrs-stage-fill.stage-learn { background: #d97706; }
.fsrs-stage-fill.stage-review { background: var(--primary-blue); }
.fsrs-stage-fill.stage-master { background: var(--ok); }

/* ================= 查词联想与助记深度卡片 ================= */
.lookup-input-wrapper {
  position: relative;
  flex: 1;
}

.lookup-suggestions-box {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
}

.lookup-suggestion-item {
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease;
}

.lookup-suggestion-item:hover {
  background: var(--surface-variant);
  color: var(--accent);
}

.memory-aid-box {
  background: rgba(164, 178, 158, 0.15);
  border-left: 4px solid var(--matcha);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 13px;
  color: var(--text);
}

.memory-aid-tag {
  font-weight: 700;
  color: var(--accent);
  margin-right: 6px;
}

.bilingual-example-item {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.bilingual-example-cn {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/* ================= 划词精读工作台 ================= */
.reader-tokens-container {
  line-height: 2.2;
  font-size: 16px;
}

.reader-word-chip {
  display: inline-block;
  padding: 1px 4px;
  margin: 0 1px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.reader-word-chip:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.reader-word-chip.in-wordbook {
  border-bottom: 2px solid var(--matcha);
  font-weight: 600;
}

@media (max-width: 768px) {
  .download-grid,
  .download-exclusive-grid,
  .kg-grid {
    grid-template-columns: 1fr;
  }
}
