/* 拾词 PWA · Meta 设计系统（权威规范见根目录 DESIGN.md）
   白底 canvas / 钴蓝 primary / 黑色胶囊主按钮 / 大圆角卡片 / 统一字阶。
   动效纯 CSS：表面过渡 150–250ms ease-out，展开类约 300ms ease-in-out。 */

:root {
  color-scheme: light;
  --canvas: #ffffff;
  --surface-soft: #f1f4f7;
  --ink-deep: #0a1317;
  --ink: #1c1e21;
  --charcoal: #444950;
  --steel: #5d6c7b;
  --stone: #8595a4;
  --hairline: #ced0d4;
  --hairline-soft: #dee3e9;
  --primary: #0064e0;
  --primary-deep: #0457cb;
  --fb-blue: #1876f2;
  --success: #31a24c;
  --critical: #e41e3f;
  --attention: #f2a918;
  --warning: #f7b928;
  --ink-button: #000000;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: "Montserrat", "Helvetica", "Arial", "Noto Sans SC",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.serif { font-family: inherit; letter-spacing: inherit; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
}

button { font-family: inherit; }

/* ---------- 页容器 ---------- */
.page {
  padding: 20px 20px calc(64px + env(safe-area-inset-bottom) + 24px);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- 返回导航（详情页） ---------- */
.nav { padding: 4px 0 14px; }

.nav-back {
  background: none;
  border: none;
  padding: 2px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.nav-back:active { opacity: 0.6; }

/* ---------- 页头 ---------- */
.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}

.head-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-deep);
}

.head-date, .head-sub {
  font-size: 13px;
  color: var(--steel);
}

/* ---------- 状态 ---------- */
.loading-text {
  padding: 72px 0;
  text-align: center;
  font-size: 15px;
  color: var(--steel);
}

.empty-box {
  margin-top: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 0 12px;
}

.empty-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink-deep);
}

.empty-sub {
  font-size: 14px;
  color: var(--steel);
  line-height: 1.6;
}

/* ---------- chip / pill-tab ---------- */
.chip {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  padding: 6px 14px;
  white-space: nowrap;
}

.chip-active {
  color: var(--canvas);
  background: var(--ink-deep);
  border-color: var(--ink-deep);
}

/* ---------- 按钮 ---------- */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border: none;
  border-radius: 100px;
  background: var(--primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  padding: 0 26px;
  transition: background 0.2s ease-out, transform 0.15s ease-out;
}

.btn-primary:active { background: var(--primary-deep); transform: scale(0.98); }

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-radius: 100px;
  border: 2px solid rgba(10, 19, 23, 0.12);
  color: var(--ink-deep);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: transparent;
  cursor: pointer;
  padding: 0 24px;
  text-decoration: none;
  transition: border-color 0.2s ease-out, color 0.2s ease-out, transform 0.15s ease-out;
}

.btn-ghost:active { border-color: var(--ink-deep); transform: scale(0.98); }

.btn-ghost.danger {
  border-color: var(--critical);
  color: var(--critical);
}

.btn-ghost.danger:active { border-color: var(--critical); }

.btn-block { width: 100%; }

.btn-action { width: 100%; }

/* ---------- 底部标签栏 ---------- */
.tab-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--hairline-soft);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  gap: 6px;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tab-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: 100px;
  padding: 15px 0;
  transition: background 0.2s ease-out;
}

.tab-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--steel);
  line-height: 1;
}

.tab-indicator { display: none; }

.tab-item.active {
  background: var(--ink-deep);
}

.tab-item.active .tab-label { color: #ffffff; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 28px calc(40px + env(safe-area-inset-bottom));
}

.login-seal {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--primary);
  position: relative;
  margin-bottom: 20px;
}

.login-seal::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 12px;
}

.login-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-deep);
}

.login-sub {
  margin-top: 8px;
  font-size: 15px;
  color: var(--steel);
}

.login-form { margin-top: 36px; }

.login-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 8px;
}

.input {
  width: 100%;
  height: 48px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 0 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease-out;
}

.input:focus { border: 2px solid var(--fb-blue); padding: 0 15px; }

.input::placeholder { color: var(--stone); }

/* 隐藏的 username 字段：供手机密码管理器识别并记住口令（无障碍建议） */
.sr-user { display: none; }

.login-field + .login-field { margin-top: 16px; }

.login-btn { margin-top: 24px; width: 100%; }

.login-tip {
  margin-top: 14px;
  min-height: 18px;
  font-size: 13px;
  color: var(--critical);
}

/* ---------- 今日 / 短文 ---------- */
.story-card {
  position: relative;
  isolation: isolate; /* 使 .story-fx-canvas（z-index:-1）衬于卡片背景之上、内容之下 */
  background: var(--canvas);
  border-radius: 24px;
  border: 1px solid var(--hairline-soft);
  padding: 24px;
}

/* 今日短文 WebGPU 转场画布（story-webgpu-transition）：衬于卡片内容之下的装饰底纹，
   不拦截触摸；播放结束后暂停渲染循环、保留末帧（app.js playStoryTransition）。 */
.story-fx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
}

/* 无 WebGPU / 终端错误 / 加载失败的 CSS 兜底动效（与 WebGPU 路径二选一，不叠加） */
.story-card.fx-fallback {
  animation: story-fx-in 300ms ease-out;
}
@keyframes story-fx-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .story-card.fx-fallback { animation: none; }
}

/* 标题行：标题占左侧、语言切换按钮固定右上角 */
.story-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.story-title {
  flex: 1;
  min-width: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0;
  color: var(--ink-deep);
}

.story-body {
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink);
  word-break: break-word;
}

.seg-word {
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.seg-word:active { color: var(--primary-deep); }

.seg-word.recurrence {
  color: #0E7090;
  background: rgba(14, 112, 144, 0.08);
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 600;
}

.seg-word.recurrence:active {
  color: #155E75;
  background: rgba(14, 112, 144, 0.16);
}

.story-meta {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline-soft);
  font-size: 12px;
  color: var(--steel);
  text-align: right;
}

/* ---------- 全英文笔记：语法点 + 值得学的短语（story-en-notes） ---------- */

.story-notes {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline-soft);
}

.story-notes:empty { display: none; }

.story-note-section { margin-bottom: 22px; }
.story-note-section:last-of-type { margin-bottom: 0; }
.story-note-section .g-memo { margin-bottom: 14px; }

.story-phrases { display: flex; flex-direction: column; gap: 8px; }

.story-phrase {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 52px 10px 12px;
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: 14px;
  cursor: pointer;
}

.story-phrase:active { background: var(--surface-soft); }
.story-phrase-en { font-size: 15px; font-weight: 700; color: var(--ink-deep); word-break: break-word; }
.story-phrase-cn { font-size: 13px; color: var(--charcoal); line-height: 1.5; }
.story-phrase-note { font-size: 12px; color: var(--steel); line-height: 1.5; }

.story-phrase-copy {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

.note-skel {
  height: 58px;
  border-radius: 14px;
  background: var(--surface-soft);
  margin-bottom: 10px;
  animation: notePulse 1.4s ease-in-out infinite;
}

.story-note-section .note-skel:last-child { margin-bottom: 0; }

@keyframes notePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.note-loading { padding: 4px 0 2px; text-align: center; font-size: 12px; color: var(--steel); }
.note-fail { padding: 4px 0; font-size: 12px; color: var(--steel); }

@media (prefers-reduced-motion: reduce) {
  .note-skel { animation: none; }
}

.actions { margin-top: 24px; }

.action-btn { margin: 0 auto; width: 200px; }

.actions-secondary { margin-top: 12px; }

.actions-secondary .btn-ghost { max-width: 200px; margin: 0 auto; }

.retry-btn { margin-top: 12px; width: 200px; }

.hint {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--steel);
}

/* ---------- 词本 ---------- */
.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.search-input {
  flex: 1;
  height: 44px;
  min-width: 0;
  background: var(--surface-soft);
  border: none;
  border-radius: 100px;
  padding: 0 18px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
}

.search-input::placeholder { color: var(--stone); }

.order-toggle {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  padding: 10px 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.order-toggle:active { opacity: 0.6; }

.chips {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chips .chip { cursor: pointer; flex-shrink: 0; }

.seg {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.seg-item {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  cursor: pointer;
}

.seg-active {
  color: var(--canvas);
  background: var(--ink-deep);
  border-color: var(--ink-deep);
}

/* 词本两排筛选：行首小标签区分「分类 / 掌握」 */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--stone);
}

.filter-row .chips,
.filter-row .seg { flex: 1; min-width: 0; margin-bottom: 0; }

.item {
  display: flex;
  align-items: center;
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease-out, transform 0.15s ease-out;
}

.item:active { border-color: var(--hairline); transform: scale(0.99); }

.item-bar { display: none; }

.item-main { flex: 1; min-width: 0; }

.item-word {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-deep);
}

.item-meaning {
  margin-top: 3px;
  font-size: 14px;
  color: var(--steel);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 10px;
}

.chip.mini {
  font-size: 11px;
  padding: 3px 10px;
}

.item-count { font-size: 12px; color: var(--stone); }

.item-weak {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-deep);
  background: var(--warning);
  border-radius: 100px;
  padding: 2px 8px;
}

.group-head {
  padding: 12px 4px 6px;
  font-size: 15px;
  color: var(--primary);
  font-weight: 700;
}

.list-footer {
  padding: 18px 0 6px;
  text-align: center;
  font-size: 12px;
  color: var(--stone);
}

/* ---------- 词详情 ---------- */
.hero {
  padding: 8px 0 22px;
  border-bottom: 1px solid var(--hairline-soft);
  margin-bottom: 22px;
}

.hero-word {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink-deep);
  cursor: pointer;
  display: inline-block;
}

.hero-phonetics {
  margin-top: 8px;
  display: flex;
  gap: 16px;
  font-size: 15px;
  color: var(--steel);
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sound-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.sound-btn:active { opacity: 0.6; }

.sound-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease-out, transform 0.15s ease-out;
}

.sound-btn:active .sound-icon { background: var(--primary-deep); transform: scale(0.94); }

.sound-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.status-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--steel);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  padding: 5px 14px;
}

.section { margin-bottom: 24px; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.meaning {
  display: flex;
  gap: 10px;
  padding: 4px 0;
  font-size: 16px;
  line-height: 1.6;
}

.pos { color: var(--steel); flex-shrink: 0; }

.cn { color: var(--ink); }

.context {
  padding: 14px 16px;
  background: var(--surface-soft);
  border-radius: 16px;
  margin-bottom: 10px;
}

.context-en { font-size: 15px; line-height: 1.7; color: var(--ink); }

.context-cn {
  margin-top: 6px;
  font-size: 13px;
  color: var(--steel);
  line-height: 1.6;
}

.empty-hint { font-size: 14px; color: var(--stone); }

.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.meta-text {
  font-size: 12px;
  color: var(--stone);
}

.mark-row { display: flex; gap: 12px; }

.mark-btn { flex: 1; }

/* 词条删除（word-delete）：入口只在详情页，与标记行之间留白分隔。
   危险色复用既有 .btn-ghost.danger，不新造样式语言。 */
.danger-row {
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline-soft);
}

.danger-row .btn-ghost { width: 100%; }

.danger-row .btn-ghost:disabled { opacity: 0.5; }

.btn-ghost.mark-on {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-primary.mark-on {
  box-shadow: 0 0 0 3px rgba(0, 100, 224, 0.18);
}

/* ---------- 复习（SRS 主动提取与原句挖空） ---------- */
.srs-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: rise-in 0.25s ease-out both;
}

.srs-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.srs-progress-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--steel);
}

.srs-progress-num b {
  color: var(--primary);
  font-size: 14px;
}

.srs-bar {
  width: 100%;
  height: 6px;
  border-radius: 100px;
  background: var(--surface-soft);
  overflow: hidden;
}

.srs-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 100px;
  background: var(--primary);
  transition: width 0.25s ease-out;
}

.srs-card {
  position: relative;
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: 24px;
  padding: 24px 20px 22px;
  box-shadow: 0 4px 16px rgba(10, 19, 23, 0.04);
}

.srs-tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--steel);
}

.srs-tag-badge.real {
  background: rgba(0, 100, 224, 0.08);
  color: var(--primary);
  border: 1px solid rgba(0, 100, 224, 0.16);
}

.srs-sentence {
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-deep);
  margin: 16px 0 14px;
  word-break: break-word;
}

.srs-blank {
  display: inline-block;
  padding: 0 6px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(0, 100, 224, 0.08);
  border-bottom: 2px solid var(--primary);
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.srs-highlight {
  font-weight: 700;
  color: var(--primary);
  background: rgba(0, 100, 224, 0.12);
  border-radius: 4px;
  padding: 0 4px;
}

.srs-direct-prompt {
  margin: 6px 0 10px;
}

.srs-direct-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--stone);
  margin-bottom: 6px;
}

.srs-direct-meaning {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-deep);
  line-height: 1.5;
  margin-bottom: 12px;
}

.srs-direct-blank {
  font-size: 20px;
}

.srs-cloze-target {
  margin-top: 8px;
  font-size: 15px;
  color: var(--stone);
}

.srs-hint-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px dashed var(--hairline);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: inherit;
  color: var(--steel);
  cursor: pointer;
  transition: background 0.15s ease-out, border-color 0.15s ease-out;
}

.srs-hint-toggle:active {
  background: var(--surface-soft);
}

.srs-hint-content {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface-soft);
  border-radius: 14px;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
  animation: rise-in 0.2s ease-out both;
}

.srs-reveal-box {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}

.srs-reveal-btn {
  width: 100%;
  max-width: 320px;
}

.srs-revealed-detail {
  margin-top: 18px;
  border-top: 1px solid var(--hairline-soft);
  padding-top: 18px;
  animation: rise-in 0.25s ease-out both;
}

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

.srs-word-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.srs-word-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-deep);
  line-height: 1.15;
}

.srs-word-phon {
  font-size: 15px;
  color: var(--steel);
}

.srs-audio-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease-out, transform 0.12s ease-out;
}

.srs-audio-btn:active {
  background: var(--hairline-soft);
  transform: scale(0.92);
}

.srs-trans-box {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--surface-soft);
  border-radius: 12px;
  font-size: 14px;
  color: var(--steel);
  line-height: 1.5;
}

.srs-meanings-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.srs-mean-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  color: var(--ink);
}

.srs-mean-pos {
  font-size: 12px;
  font-weight: 700;
  color: var(--steel);
}

.srs-chunk-card {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(0, 100, 224, 0.05);
  border: 1px solid rgba(0, 100, 224, 0.15);
  border-radius: 12px;
}

.srs-chunk-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
}

.srs-chunk-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-deep);
  margin-top: 2px;
}

.srs-chunk-sub {
  font-size: 12px;
  color: var(--steel);
  margin-top: 2px;
}

.srs-rates-row {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.srs-rate-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 8px 6px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease-out, background 0.15s ease-out;
}

.srs-rate-btn:active {
  transform: scale(0.95);
}

.srs-rate-btn .srb-tag {
  font-size: 14px;
  font-weight: 700;
}

.srs-rate-btn .srb-days {
  font-size: 11px;
  font-weight: 500;
  margin-top: 2px;
  opacity: 0.85;
}

.srs-rate-btn.again {
  background: rgba(228, 30, 63, 0.08);
  border-color: rgba(228, 30, 63, 0.2);
  color: var(--critical);
}

.srs-rate-btn.good {
  background: rgba(242, 169, 24, 0.1);
  border-color: rgba(242, 169, 24, 0.3);
  color: #B37400;
}

.srs-rate-btn.easy {
  background: rgba(49, 162, 76, 0.1);
  border-color: rgba(49, 162, 76, 0.25);
  color: var(--success);
}

.srs-complete-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 12px 24px;
  animation: rise-in 0.3s ease-out both;
}

.srs-complete-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(49, 162, 76, 0.1);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.srs-complete-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-deep);
  letter-spacing: -0.02em;
}

.srs-complete-sub {
  margin-top: 8px;
  font-size: 15px;
  color: var(--steel);
  line-height: 1.6;
}

.srs-stats-pills {
  display: flex;
  gap: 12px;
  margin: 24px 0 32px;
}

.srs-stat-pill {
  padding: 10px 16px;
  background: var(--surface-soft);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.srs-stat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-deep);
}

.srs-stat-label {
  font-size: 12px;
  color: var(--steel);
  margin-top: 2px;
}

.srs-complete-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 300px;
}

.srs-complete-btns.spaced {
  margin-top: 28px;
}

.srs-hint-wrapper {
  margin-top: 12px;
}

.srs-word-header.spaced {
  margin-top: 12px;
}

.srs-stat-num.easy {
  color: var(--success);
}

.srs-stat-num.good {
  color: #B37400;
}

.srs-stat-num.again {
  color: var(--critical);
}

/* 兼容性动效与旧样式兜底 */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 语法练习 (viewGrammarQuiz) ---------- */
.quiz-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.quiz-count { font-size: 13px; font-weight: 700; }
.quiz-count.ok { color: var(--success); }
.quiz-count.bad { color: var(--critical); }

.quiz-bar {
  flex: 1;
  height: 6px;
  border-radius: 100px;
  background: var(--surface-soft);
  overflow: hidden;
}

.quiz-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 100px;
  background: var(--primary);
  transition: width 0.25s ease-out;
}

.quiz-card {
  position: relative;
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: 24px;
  padding: 40px 24px 32px;
  text-align: center;
  animation: rise-in 0.25s ease-out both;
}

.quiz-audio {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease-out, transform 0.15s ease-out;
}

.quiz-audio:active { background: var(--hairline-soft); transform: scale(0.94); }

.quiz-word {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink-deep);
  word-break: break-word;
}

.quiz-phon {
  margin-top: 8px;
  font-size: 15px;
  color: var(--steel);
}

.quiz-options {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  background: var(--canvas);
  border: 1px solid rgba(10, 19, 23, 0.12);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.5;
  font-family: inherit;
  color: var(--ink-deep);
  cursor: pointer;
  transition: border-color 0.2s ease-out, background 0.2s ease-out,
    color 0.2s ease-out, transform 0.15s ease-out, opacity 0.2s ease-out;
}

.quiz-opt:active { transform: scale(0.985); }
.quiz-opt .qo-ic { flex-shrink: 0; }

.quiz-opt.ok {
  background: rgba(49, 162, 76, 0.12);
  border: 2px solid var(--success);
  padding: 15px 17px;
  color: var(--ink-deep);
  animation: ok-pop 0.25s ease-out;
}

.quiz-opt.ok .qo-ic { color: var(--success); }

.quiz-opt.bad {
  background: rgba(228, 30, 63, 0.08);
  border-color: var(--critical);
  color: var(--critical);
  font-weight: 600;
}

.quiz-opt.bad.shake { animation: shake-x 0.3s ease-in-out; }
.quiz-opt.dim { opacity: 0.45; }

@keyframes ok-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes shake-x {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

@keyframes micro-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.quiz-micro {
  margin-top: 16px;
  animation: micro-in 0.3s ease-out both;
}

.qm-mean {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(49, 162, 76, 0.08);
  border-radius: 16px;
}

.qm-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-deep);
  flex-shrink: 0;
}

.qm-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-deep);
}

.qm-quote {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}

.qm-cn {
  margin-top: 6px;
  font-size: 13px;
  color: var(--steel);
}

.quiz-micro .btn-action { margin-top: 16px; }

.quiz-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 8px 24px;
  animation: rise-in 0.3s ease-out both;
}

.qr-rate {
  font-size: 64px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--primary);
}

.qr-pct { font-size: 28px; font-weight: 600; margin-left: 2px; }

.qr-label {
  margin-top: 10px;
  font-size: 14px;
  color: var(--steel);
}

.qr-bar {
  width: 100%;
  max-width: 320px;
  height: 8px;
  border-radius: 100px;
  background: var(--surface-soft);
  overflow: hidden;
  margin-top: 22px;
}

.qr-bar > div {
  height: 100%;
  width: 0;
  border-radius: 100px;
  background: var(--primary);
  transition: width 0.6s ease-out;
}

.qr-perfect {
  margin-top: 24px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-deep);
}

.quiz-result .btn-action { margin-top: 24px; max-width: 320px; }
.quiz-result .btn-ghost { margin-top: 12px; max-width: 320px; }

/* ---------- 往期短文 ---------- */
.story-row {
  display: flex;
  align-items: center;
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease-out, transform 0.15s ease-out;
}

.story-row:active { border-color: var(--hairline); transform: scale(0.99); }

.row-date {
  width: 84px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.row-main { flex: 1; min-width: 0; }

.row-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-deep);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--steel);
}

.row-arrow {
  font-size: 20px;
  color: var(--stone);
  margin-left: 8px;
}

/* ---------- 我的 ---------- */
.stats-row {
  display: flex;
  align-items: center;
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: 24px;
  padding: 24px 0;
  margin-bottom: 24px;
}

.stat { flex: 1; text-align: center; }

.stat-num {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary);
  line-height: 1.1;
}

.stat-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--steel);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--hairline-soft);
}

.device-row {
  display: flex;
  align-items: center;
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.device-main { flex: 1; min-width: 0; }

.device-name { font-size: 15px; font-weight: 600; color: var(--ink-deep); }

.device-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--steel);
}

.device-revoke {
  font-size: 14px;
  font-weight: 600;
  color: var(--critical);
  padding: 0 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.device-revoke:active { opacity: 0.6; }

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease-out, transform 0.15s ease-out;
}

.link-row:active { border-color: var(--hairline); transform: scale(0.99); }

.link-label { font-size: 16px; font-weight: 600; color: var(--ink-deep); }

.link-arrow { font-size: 20px; color: var(--stone); }

.logout-row { margin-top: 28px; }

.about {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--stone);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink-deep);
  color: #ffffff;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 100px;
  z-index: 300;
  max-width: 82vw;
  text-align: center;
  transition: opacity 0.2s ease-out;
}

/* ---------- 确认对话框 ---------- */
.modal { position: fixed; inset: 0; z-index: 200; }

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(10, 19, 23, 0.45);
}

.modal-card {
  position: relative;
  top: 50%;
  transform: translateY(-50%);
  width: calc(100% - 64px);
  max-width: 320px;
  margin: 0 auto;
  background: var(--canvas);
  border-radius: 24px;
  padding: 24px 20px;
  text-align: center;
  animation: rise-in 0.25s ease-out both;
}

.modal-title { font-size: 18px; font-weight: 700; color: var(--ink-deep); }

.modal-content {
  margin-top: 10px;
  font-size: 14px;
  color: var(--steel);
  line-height: 1.6;
}

.modal-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.modal-actions .btn-ghost,
.modal-actions .btn-primary { flex: 1; height: 44px; font-size: 14px; }

/* ---------------- 名词思维块 ---------------- */

.chunk-card {
  background: rgba(0, 100, 224, 0.07);
  border-radius: 12px;
  padding: 12px 16px;
}

.chunk-form {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink-deep);
}

.chunk-intent {
  margin-top: 2px;
  font-size: 12px;
  color: var(--primary);
}

.chunk-note {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--steel);
}

.quiz-intent {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--ink-deep);
}

.quiz-word-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--stone);
}

/* ---------------- 短文语言切换 ---------------- */

.story-lang-btn {
  flex: none;
  margin-left: auto;   /* 无标题时仍靠右 */
  margin-top: -5px;    /* 与首行标题视觉居中对齐 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;    /* 放大触达区，便于点按 */
  border: 2px solid rgba(10, 19, 23, 0.12);
  background: transparent;
  color: var(--ink-deep);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: border-color 0.2s ease-out;
}

.story-lang-btn:hover { border-color: var(--ink-deep); }

.story-lang-btn:active { background: rgba(10, 19, 23, 0.04); }

.story-lang-btn:disabled { opacity: 0.5; cursor: default; }

/* ---------------- 语法课 ---------------- */

.g-card {
  display: block;
  background: linear-gradient(135deg, rgba(0, 100, 224, 0.10), rgba(0, 100, 224, 0.04));
  border: 1px solid rgba(0, 100, 224, 0.18);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
}

.g-card-kicker {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.g-card-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink-deep);
  letter-spacing: -0.01em;
}

.g-card-cta {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.g-card-mini { padding: 12px 16px; margin-top: 12px; }
.g-card-mini .g-card-title { font-size: 16px; }
.g-card-mini .g-card-cta { margin-top: 4px; }

.g-progress {
  height: 6px;
  border-radius: 100px;
  background: var(--hairline-soft, #e9edf1);
  overflow: hidden;
  margin: 4px 0 14px;
}

.g-progress-bar {
  height: 100%;
  border-radius: 100px;
  background: var(--primary);
  transition: width 0.4s ease-out;
}

.g-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--hairline-soft, #e9edf1);
  text-decoration: none;
  color: inherit;
}

.g-seq {
  flex-shrink: 0;
  width: 26px;
  font-size: 12px;
  color: var(--stone);
  text-align: right;
}

.g-title {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-deep);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.g-done .g-title { color: var(--steel); }

.g-row-review .g-title { color: var(--primary); }

.g-score {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--success-ink, #1e7a38);
}

.g-now {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--canvas);
  background: var(--ink-deep);
  border-radius: 100px;
  padding: 2px 10px;
}

.g-rule-list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
}

.g-rule-list li { margin-bottom: 6px; }

.g-ex {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.7;
}

.g-ex-mark { display: inline-block; width: 18px; font-weight: 700; }
.g-ex-ok { color: #1e7a38; }
.g-ex-bad { color: var(--critical, #e41e3f); }
.g-ex-note { margin-top: 4px; font-size: 12px; color: var(--steel); }

.gw {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

a.gw { border-bottom: 1px dashed rgba(0, 100, 224, 0.4); }

.g-q { margin: 6px 0 14px; }

.g-q-text {
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink-deep);
  word-break: break-word;
}

.g-blank { color: var(--primary); font-weight: 700; }

.g-fill-row { display: flex; gap: 10px; margin-top: 12px; }

.g-fill-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 2px solid rgba(10, 19, 23, 0.12);
  border-radius: 100px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink-deep);
  outline: none;
  background: var(--canvas);
}

.g-fill-input:focus { border-color: var(--primary); }
.g-fill-input.ok { border-color: #31a24c; color: #1e7a38; font-weight: 700; }
.g-fill-input.bad { border-color: var(--critical, #e41e3f); color: var(--critical, #e41e3f); }

.g-fill-btn { height: 44px; padding: 0 22px; flex-shrink: 0; }

.g-wrong-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline-soft, #e9edf1);
}

.g-wrong-q { font-size: 14px; line-height: 1.7; color: var(--ink); }
.g-wrong-a { margin-top: 4px; font-size: 14px; font-weight: 700; color: #1e7a38; }

.g-review-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.g-review-link.as-btn {
  display: block;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

/* ---------- 讲解页图解化（grammar-explain-viz） ---------- */

.g-memo {
  background: #eaf2fe;
  border: 1px solid #cfe2fb;
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.g-memo-kicker { font-size: 11px; font-weight: 700; color: var(--primary); letter-spacing: 0.06em; }
.g-memo-text { margin-top: 4px; font-size: 16px; font-weight: 700; color: var(--ink-deep); line-height: 1.45; }

.g-rules { display: flex; flex-direction: column; gap: 10px; }

.g-rule-card {
  border: 1px solid var(--hairline-soft);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--canvas);
}

.g-rule-head { display: flex; align-items: center; gap: 8px; }

.g-rule-num {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.g-rule-title { font-size: 14px; font-weight: 700; color: var(--ink-deep); }
.g-rule-body { margin-top: 8px; font-size: 14px; line-height: 1.65; color: var(--charcoal); }

.g-chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.g-chip { background: #eaf2fe; color: var(--primary); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }

.g-form { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink-deep); }
.g-form-label { font-size: 11px; font-weight: 700; color: var(--steel); letter-spacing: 0.04em; }
.g-form-text { font-weight: 700; }

.g-rule-ex { margin-top: 8px; font-size: 14px; line-height: 1.6; color: var(--ink); }

.g-diagram { margin-top: 10px; padding: 10px 12px; background: var(--surface-soft); border-radius: 12px; }

.g-freq-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.g-freq-row:last-child { margin-bottom: 0; }
.g-freq-label { flex: 0 0 auto; min-width: 62px; font-size: 12px; color: var(--steel); }
.g-freq-dots { display: flex; gap: 4px; }

.g-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--hairline); background: var(--canvas); display: block; }
.g-dot.on { background: var(--primary); border-color: var(--primary); }

.g-tr-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.g-tr-row:last-child { margin-bottom: 0; }
.g-pill { border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.g-pill.src { background: #e7ebef; color: var(--charcoal); }
.g-pill.dst { background: #eaf2fe; color: var(--primary); font-weight: 700; }
.g-arrow { color: var(--stone); }
.g-tr-tag { font-size: 11px; color: var(--stone); }
.g-dg-fm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.g-plus { color: var(--stone); font-size: 12px; }

.g-ex-card { border: 1px solid var(--hairline-soft); border-radius: 16px; overflow: hidden; margin-bottom: 10px; }
.g-ex-row { display: flex; gap: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.6; }
.g-ex-row.ok { background: #f3f9f5; border-left: 3px solid var(--success); }
.g-ex-row.bad { background: #fdf2f2; border-left: 3px solid var(--critical); }
.g-ex-ico { flex: 0 0 auto; margin-top: 3px; }
.g-ex-row.ok .g-ex-ico { color: var(--success); }
.g-ex-row.bad .g-ex-ico { color: var(--critical); }
.g-ex-row.ok .g-ex-text { color: var(--ink-deep); }
.g-ex-row.bad .g-ex-text { color: var(--steel); }
.g-ex-note { padding: 8px 12px; font-size: 12px; color: var(--stone); border-top: 1px solid var(--hairline-soft); }

.g-pit-card { display: flex; gap: 9px; border: 1px solid #f3dfb0; background: #fef9ec; border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; }
.g-pit-ico { flex: 0 0 auto; margin-top: 2px; color: var(--attention); }
.g-pit-text { font-size: 13px; line-height: 1.6; color: var(--charcoal); }
.g-pit-extra { display: none; }
.g-pit-extra.open { display: block; }

.g-more {
  margin-top: 2px;
  border: none;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
}

/* ---------- 12 时态罗盘与时间轴 (grammar-tense-compass) ---------- */

.tc-card {
  background: var(--canvas, #ffffff);
  border: 1px solid var(--hairline-soft, #e9edf1);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tc-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tc-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-deep, #1c1e21);
}

.tc-sub {
  font-size: 12px;
  color: var(--steel, #65676b);
}

.tc-toggle-btn {
  border: none;
  background: transparent;
  color: var(--primary, #0064e0);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
}

.tc-vp-switch {
  display: flex;
  background: var(--surface-soft, #f0f2f5);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
  margin-bottom: 10px;
}

.tc-vp-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--steel, #65676b);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tc-vp-btn.active {
  background: #ffffff;
  color: var(--primary, #0064e0);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tc-eye-ico {
  flex-shrink: 0;
}

.tc-mindset-banner {
  background: #eaf2fe;
  border: 1px solid #cfe2fb;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-deep, #1c1e21);
}

.tc-mindset-banner strong {
  color: var(--primary, #0064e0);
}

.tc-mindset-banner code {
  font-family: inherit;
  font-weight: 700;
  color: var(--primary, #0064e0);
  background: rgba(0, 100, 224, 0.08);
  padding: 1px 4px;
  border-radius: 4px;
}

.tc-matrix-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}

.tc-matrix {
  width: 100%;
  min-width: 320px;
  border-collapse: separate;
  border-spacing: 4px;
  table-layout: fixed;
}

.tc-th {
  font-size: 11px;
  font-weight: 700;
  color: var(--steel, #65676b);
  text-align: center;
  padding: 4px 2px;
  white-space: nowrap;
}

.tc-th-corner {
  width: 60px;
  text-align: left;
  padding-left: 4px;
}

.tc-row-hdr {
  font-size: 11px;
  font-weight: 700;
  color: var(--charcoal, #4b4f56);
  padding: 4px 6px;
  vertical-align: middle;
  white-space: nowrap;
  text-align: left;
}

.tc-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  color: #ffffff;
  background: var(--primary, #0064e0);
  border-radius: 4px;
  padding: 1px 4px;
  margin-top: 2px;
}

.tc-cell {
  background: var(--surface-soft, #f7f8fa);
  border: 1px solid var(--hairline-soft, #e9edf1);
  border-radius: 8px;
  padding: 6px 3px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tc-cell:hover {
  border-color: #bcd0e8;
}

.tc-cell.active {
  background: #ebf5ff;
  border-color: var(--primary, #0064e0);
  box-shadow: 0 0 0 1px var(--primary, #0064e0);
}

.tc-cell-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-deep, #1c1e21);
  line-height: 1.25;
}

.tc-cell.active .tc-cell-name {
  color: var(--primary, #0064e0);
}

.tc-cell-form {
  font-size: 10px;
  color: var(--steel, #65676b);
  margin-top: 2px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tc-cell.active .tc-cell-form {
  color: #004fb0;
  font-weight: 600;
}

.tc-detail {
  background: #f8fafc;
  border: 1px solid #dce2e9;
  border-radius: 12px;
  padding: 12px 14px;
}

.tc-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tc-detail-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-deep, #1c1e21);
}

.tc-detail-en {
  font-size: 12px;
  font-weight: 600;
  color: var(--steel, #65676b);
}

.tc-detail-form {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin-bottom: 6px;
}

.tc-detail-lbl {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--steel, #65676b);
  letter-spacing: 0.04em;
  background: #e4e6eb;
  border-radius: 4px;
  padding: 1px 5px;
}

.tc-detail-val {
  font-weight: 700;
  color: var(--ink-deep, #1c1e21);
}

.tc-detail-essence {
  font-size: 13px;
  line-height: 1.55;
  color: var(--charcoal, #4b4f56);
  margin-bottom: 8px;
  padding: 6px 10px;
  background: #ffffff;
  border-radius: 8px;
  border-left: 3px solid var(--primary, #0064e0);
}

.tc-detail-ex {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink, #1c1e21);
  margin-bottom: 10px;
}

.tc-detail-trans {
  color: var(--steel, #65676b);
  margin-top: 2px;
}

.tc-timeline-wrap {
  margin-top: 8px;
  background: #ffffff;
  border: 1px solid var(--hairline-soft, #e9edf1);
  border-radius: 10px;
  padding: 8px 10px;
}

.tc-timeline-svg {
  display: block;
  max-width: 100%;
}

.tc-timeline-caption {
  margin-top: 5px;
  font-size: 11px;
  color: var(--charcoal, #4b4f56);
  text-align: center;
  line-height: 1.4;
}

.g-dg-timeline {
  padding: 8px;
}

/* ---------------- 收录（手机端） ---------------- */

.head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cap-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid rgba(10, 19, 23, 0.12);
  border-radius: 100px;
  background: transparent;
  color: var(--ink-deep);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.cap-entry:active { background: rgba(10, 19, 23, 0.04); }

.cap-entry.square {
  width: 44px;
  height: 44px;
  padding: 0;
  flex: none;
  font-size: 18px;
}

.cap-text {
  width: 100%;
  min-height: 132px;
  background: var(--surface-soft);
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 1.6;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  resize: vertical;
}

.cap-tools {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 14px;
}

.cap-tool {
  flex: 1;
  min-height: 44px;
  border: 2px solid rgba(10, 19, 23, 0.12);
  border-radius: 100px;
  background: transparent;
  color: var(--ink-deep);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.cap-tool:active { background: rgba(10, 19, 23, 0.04); }

.cap-file { display: none; }

.cap-note {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  color: var(--steel);
}

.cap-note-bad { color: var(--critical); }

.cap-trans {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
}

.cap-list { margin-top: 6px; }

.cap-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline-soft);
}

.cap-pick {
  width: 44px;
  height: 44px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(10, 19, 23, 0.16);
  border-radius: 12px;
  background: transparent;
  color: var(--canvas);
  cursor: pointer;
}

.cap-pick.on {
  background: var(--primary);
  border-color: var(--primary);
}

.cap-main {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.cap-word {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-deep);
  flex: none;
}

.cap-phon {
  font-size: 12px;
  color: var(--steel);
  flex: none;
}

.cap-cn {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--charcoal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cap-tag {
  flex: none;
  font-size: 11px;
  color: var(--steel);
  white-space: nowrap;
}

.cap-detail {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border-radius: 12px;
}

.cap-sent {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-deep);
}

.cap-sent-cn {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--steel);
}

.cap-save { margin-top: 16px; }

.cap-single { margin-top: 16px; }

.cap-single-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.cap-single-word {
  font-size: 30px;
  font-weight: 700;
  color: var(--ink-deep);
  word-break: break-word;
}

.cap-single-phon {
  font-size: 14px;
  color: var(--steel);
}

.cap-mean {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.cap-mean .pos {
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.cap-mean .cn {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}

.cap-edit {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.cap-edit-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  background: var(--surface-soft);
  border: none;
  border-radius: 100px;
  padding: 0 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
}

.cap-relookup { flex: none; width: 88px; }

.cap-single-tag {
  margin-top: 10px;
  font-size: 12px;
  color: var(--steel);
}

.cap-result {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--hairline-soft);
}

.cap-result-line {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-deep);
}

.cap-again { margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
