﻿:root {
  color-scheme: light;
  --system-bg: #f2f2f7;
  --secondary-bg: #e9e9ef;
  --card: rgba(255,255,255,.92);
  --card-solid: #fff;
  --label: #111114;
  --secondary-label: #6e6e73;
  --tertiary-label: #96969b;
  --separator: rgba(60,60,67,.14);
  --accent: #8a1f2d;
  --accent-soft: #f7e8eb;
  --blue: #007aff;
  --green: #248a3d;
  --green-soft: #e7f6ea;
  --orange: #c95f00;
  --orange-soft: #fff0df;
  --red: #ff3b30;
  --shadow: 0 14px 38px rgba(31,31,36,.08);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --content: 900px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* 主题令牌：浅色为基准值，深色在文件末尾的 [data-theme="dark"] 里整体替换。
   分组：表面 / 文字 / 线条 / 高光阴影 / 毛玻璃导航 / 品牌半透明 / 语义底色 */
:root {
  /* 表面 */
  --fill: rgba(118,118,128,.12);          /* 搜索框、输入类底 */
  --fill-mute: rgba(118,118,128,.1);       /* 次级按钮底 */
  --fill-weak: rgba(118,118,128,.08);      /* 按下反馈 */
  --fill-faint: rgba(118,118,128,.06);     /* 更弱的行底 */
  --fill-ghost: rgba(118,118,128,.05);     /* 虚线框底 */
  --track: #e3e3e8;                        /* 分段控件轨道 */
  --track-active: #fff;                    /* 分段控件选中块 */
  --sunken: #f6f6f8;                       /* 答案正文块 */
  --sunken-2: #f8f8fa;                     /* 输入框、备注块 */
  --sunken-3: #f7f7f9;                     /* 答案对照 */
  --sunken-4: #fafafa;                     /* 多选列表 */
  --tab-idle: #77777d;                     /* 底栏未选中 */

  /* 线条 */
  --hairline: rgba(60,60,67,.07);           /* 卡片描边 */
  --hairline-2: rgba(60,60,67,.08);         /* 条目描边 */

  /* 高光与阴影 */
  --card-sheen: rgba(255,255,255,.8);      /* 卡片内高光 */
  --row-shadow: rgba(30,30,35,.035);
  --track-shadow: rgba(30,30,35,.08);
  --sheet-shadow: rgba(0,0,0,.22);
  --scrim: rgba(18,18,20,.32);             /* 弹层遮罩 */
  --focus-ring: rgba(0,122,255,.28);
  --toast-bg: rgba(23,23,26,.92);
  --toast-label: white;

  /* 毛玻璃导航 */
  --chrome-bar: rgba(242,242,247,.78);
  --chrome-chip: rgba(255,255,255,.82);
  --chrome-border: rgba(255,255,255,.72);
  --chrome-tabbar: rgba(249,249,251,.84);
  --chrome-shadow: rgba(30,30,35,.15);
  --sidebar: rgba(255,255,255,.7);

  /* 品牌半透明 */
  --accent-wash: rgba(138,31,45,.07);      /* 底栏指示块 */
  --accent-wash-2: rgba(138,31,45,.06);
  --accent-wash-3: rgba(138,31,45,.08);
  --accent-line: rgba(138,31,45,.18);
  --accent-dash: rgba(138,31,45,.38);
  --accent-ring: rgba(138,31,45,.1);
  --accent-lift: rgba(138,31,45,.22);

  /* 语义底色 */
  --blue-soft: #edf5ff;
  --blue-badge: #eaf3ff;
  --purple: #7350a3;
  --purple-soft: #f1eafd;
  --danger-soft: #fff0ef;
  --green-line: rgba(36,138,61,.22);       /* 已背条目描边 */
  --pulse: rgba(36,138,61,.4);              /* 在线人数呼吸 */
  --avatar-wash: linear-gradient(145deg,#f7e8eb,#fff);
  --on-tone: rgba(255,255,255,.72);         /* 彩色卡上的淡字，与导航描边无关 */
}

* { box-sizing: border-box; }
html { background: var(--system-bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--label); background: var(--system-bg); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.hidden { visibility: hidden !important; pointer-events: none !important; }
.app-shell { min-height: 100vh; }

.desktop-sidebar { display: none; }
.main-stage { min-height: 100vh; padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.ios-navbar {
  position: sticky; top: 0; z-index: 40; min-height: calc(62px + env(safe-area-inset-top));
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  background: var(--chrome-bar); border-bottom: 1px solid transparent;
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.ios-navbar.scrolled { border-bottom-color: var(--separator); }
.nav-back, .icon-button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--chrome-chip); box-shadow: 0 1px 0 var(--card-sheen) inset; color: var(--accent); }
.nav-back { font-size: 2rem; line-height: 1; display: grid; place-items: center; padding: 0 0 3px; }
.icon-button { font-size: 1.65rem; display: grid; place-items: center; padding: 0 0 5px; }
.nav-title-wrap { min-width: 0; text-align: center; }
.nav-title-wrap h1 { margin: 0; font-size: 1.08rem; line-height: 1.15; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-kicker { display: block; color: var(--accent); font-size: .64rem; line-height: 1; font-weight: 800; letter-spacing: .14em; }
.nav-kicker:empty { display: none; }
.screen { width: min(100%, var(--content)); margin: 0 auto; padding: 12px 16px 32px; }

.tabbar {
  position: fixed; z-index: 50; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom));
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; min-height: 68px; padding: 6px 4px;
  border: 1px solid var(--chrome-border); border-radius: 22px;
  background: var(--chrome-tabbar); box-shadow: 0 12px 40px var(--chrome-shadow);
  backdrop-filter: saturate(180%) blur(28px); -webkit-backdrop-filter: saturate(180%) blur(28px);
}
.tab-button { position: relative; z-index: 1; border: 0; background: transparent; border-radius: 17px; color: var(--tab-idle); display: grid; place-items: center; align-content: center; gap: 2px; min-width: 0; }
.tab-button.active { color: var(--accent); }
/* 底栏选中态是一块独立指示块，切换时横向滑动（iOS 风格） */
.tab-indicator { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 0; width: 0; border-radius: 17px; background: var(--accent-wash); pointer-events: none; transition: transform .34s cubic-bezier(.32,.72,0,1), width .34s cubic-bezier(.32,.72,0,1); }
@media (prefers-reduced-motion: reduce) { .tab-indicator { transition: none; } }
.tab-label { font-size: .78rem; font-weight: 700; letter-spacing: .02em; transition: color .2s ease; }

.hero-line { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 8px 2px 18px; }
.hero-line h2 { margin: 0; font-size: clamp(1.9rem, 8vw, 2.75rem); line-height: 1.08; letter-spacing: -.04em; }
.hero-line p { margin: 7px 0 0; color: var(--secondary-label); font-size: .92rem; }
.root-word { color: var(--accent); font-weight: 850; letter-spacing: -.04em; }
.stage-pill { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: .76rem; font-weight: 700; }

.search-entry { width: 100%; min-height: 48px; margin-bottom: 20px; padding: 0 15px; border: 0; border-radius: 15px; display: flex; align-items: center; gap: 9px; text-align: left; color: var(--secondary-label); background: var(--fill); }
.search-entry span { font-size: 1.3rem; line-height: 1; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 4px 11px; }
.section-heading h2, .section-heading h3 { margin: 0; font-size: 1.25rem; letter-spacing: -.02em; }
.section-heading span, .section-heading p { margin: 0; color: var(--secondary-label); font-size: .78rem; }

.book-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.book-card { min-width: 0; min-height: 174px; padding: 16px; border: 0; border-radius: var(--radius-lg); display: flex; flex-direction: column; text-align: left; color: white; overflow: hidden; position: relative; box-shadow: var(--shadow); transition: transform .18s ease, filter .18s ease; }
.book-card:active { transform: scale(.98); }
.book-card::after { content: attr(data-watermark); position: absolute; right: -3px; bottom: -25px; font-size: 5rem; line-height: 1; font-weight: 900; opacity: .1; }
.book-card[data-book="physiology"] { background: linear-gradient(145deg,#006a59,#00a17a); }
.book-card[data-book="ecology"] { background: linear-gradient(145deg,#34723e,#6f9e3e); }
.book-card[data-book="production"] { background: linear-gradient(145deg,#865316,#bd812c); }
.book-card[data-book="botany"] { background: linear-gradient(145deg,#344782,#536aad); }
.book-card[data-book="molecular"] { background: linear-gradient(145deg,#5d367a,#885aa0); }
.book-card[data-book="horticulture"] { background: linear-gradient(145deg,#8b3151,#c25777); }
.book-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.book-code { font-size: .72rem; font-weight: 750; letter-spacing: .08em; opacity: .9; }
.book-stage { padding: 3px 7px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px; font-size: .62rem; }
.book-card h3 { margin: auto 0 5px; font-size: 1.2rem; letter-spacing: -.02em; }
.book-card p { margin: 0; max-width: 14em; font-size: .74rem; line-height: 1.4; opacity: .8; }
.progress-mini { margin-top: 12px; height: 4px; background: rgba(255,255,255,.22); border-radius: 99px; overflow: hidden; }
.progress-mini i { display: block; height: 100%; width: 0; border-radius: inherit; background: #fff; }
.book-card.completed { background: linear-gradient(145deg,#1d7636,#34c759); }

.grouped-list { border-radius: var(--radius-lg); overflow: hidden; background: var(--card-solid); box-shadow: 0 1px 0 var(--card-sheen) inset; }
.list-row { width: 100%; min-height: 72px; padding: 13px 15px; border: 0; border-bottom: 1px solid var(--separator); background: transparent; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; text-align: left; }
.list-row:last-child { border-bottom: 0; }
.list-row:active { background: var(--fill-weak); }
.row-copy { min-width: 0; }
.row-copy strong { display: block; font-size: .98rem; line-height: 1.35; }
.row-copy small { display: block; margin-top: 3px; color: var(--secondary-label); font-size: .76rem; line-height: 1.4; }
.row-tail { display: flex; align-items: center; gap: 7px; color: var(--tertiary-label); font-size: 1.25rem; }
.status-badge { display: inline-flex; min-height: 24px; align-items: center; padding: 2px 8px; border-radius: 999px; background: var(--secondary-bg); color: var(--secondary-label); font-size: .68rem; font-weight: 700; white-space: nowrap; }
.status-badge.nonkey { color: var(--orange); background: var(--orange-soft); }
.status-badge.mastered { color: var(--green); background: var(--green-soft); }
.type-badge { color: var(--blue); background: var(--blue-badge); }
.type-badge.short { color: var(--purple); background: var(--purple-soft); }

.book-summary { margin: 4px 0 18px; padding: 18px; border-radius: var(--radius-xl); color: white; box-shadow: var(--shadow); }
.book-summary h2 { margin: 16px 0 5px; font-size: 1.65rem; }
.book-summary p { margin: 0; max-width: 38em; font-size: .88rem; opacity: .84; }
.summary-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.summary-meta span { font-size: .74rem; font-weight: 700; letter-spacing: .04em; }
.summary-note { margin-top: 12px !important; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.2); font-size: .74rem !important; }
.tone-physiology { background: linear-gradient(145deg,#006a59,#00a17a); }
.tone-ecology { background: linear-gradient(145deg,#34723e,#6f9e3e); }
.tone-production { background: linear-gradient(145deg,#865316,#bd812c); }
.tone-botany { background: linear-gradient(145deg,#344782,#536aad); }
.tone-molecular { background: linear-gradient(145deg,#5d367a,#885aa0); }
.tone-horticulture { background: linear-gradient(145deg,#8b3151,#c25777); }

.empty-state { padding: 48px 22px; border-radius: var(--radius-xl); background: var(--card-solid); text-align: center; color: var(--secondary-label); }
.empty-state strong { display: block; color: var(--label); font-size: 1.05rem; }
.empty-glyph { width: 58px; height: 58px; margin: 0 auto 13px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 1.7rem; }

.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%,20px); max-width: calc(100vw - 36px); padding: 10px 15px; border-radius: 999px; background: var(--toast-bg); color: var(--toast-label); font-size: .84rem; opacity: 0; pointer-events: none; transition: .24s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (min-width: 700px) {
  .book-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
  .book-card { min-height: 196px; padding: 19px; }
  .screen { padding: 20px 24px 44px; }
}

@media (min-width: 1000px) {
  .app-shell { display: grid; grid-template-columns: 250px minmax(0,1fr); }
  .desktop-sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 28px 18px 24px; background: var(--sidebar); border-right: 1px solid var(--separator); backdrop-filter: blur(24px); }
  .side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
  .root-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: white; background: var(--accent); font-size: 1.25rem; font-weight: 850; }
  .side-brand strong { display: block; letter-spacing: .05em; }
  .side-brand small { display: block; color: var(--secondary-label); font-size: .72rem; }
  .side-nav { display: grid; gap: 6px; }
  .side-nav .tab-button { min-height: 50px; padding: 0 13px; grid-template-columns: 1fr; justify-items: start; align-content: center; font-size: 1rem; }
  .side-nav .tab-button.active { background: var(--accent-wash); }
  .side-nav .tab-label { font-size: .9rem; }
  .side-motto { margin: auto 8px 0; padding: 15px; border-radius: 16px; color: var(--accent); background: var(--accent-soft); font-size: .78rem; font-weight: 700; line-height: 1.65; }
  .main-stage { padding-bottom: 20px; }
  .tabbar { display: none; }
  .ios-navbar { min-height: 72px; padding: 12px 28px; grid-template-columns: 44px 1fr 44px; }
  .screen { padding: 22px 32px 54px; }
  .toast { bottom: 32px; }
}

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

.scope-note { margin: 22px 6px 0; color: var(--tertiary-label); font-size: .73rem; text-align: center; }
.chapter-banner { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin: 8px 2px 20px; }
.chapter-banner > div { min-width: 0; }
.chapter-banner div > span { color: var(--accent); font-size: .72rem; font-weight: 750; letter-spacing: .05em; }
.chapter-banner h2 { margin: 4px 0 0; font-size: clamp(1.6rem,6vw,2.4rem); line-height: 1.15; letter-spacing: -.035em; }
.knowledge-list { display: grid; gap: 10px; }
.knowledge-group-title { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 4px 0; padding: 4px 2px; color: var(--secondary-label); font-size: .78rem; }
.knowledge-group-title strong { color: var(--label); font-size: .98rem; }
.item-number { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; min-height: 24px; margin-right: 6px; padding: 2px 7px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: .72rem; font-weight: 800; letter-spacing: .02em; vertical-align: middle; }
.item-number.large { min-width: 48px; min-height: 28px; font-size: .82rem; }
.knowledge-row { width: 100%; min-height: 98px; padding: 15px 15px 14px; border: 1px solid var(--hairline-2); border-radius: var(--radius-lg); background: var(--card-solid); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; text-align: left; box-shadow: 0 5px 18px var(--row-shadow); }
.knowledge-row:active { transform: scale(.992); }
.knowledge-row.memorized { border-color: var(--green-line); background: var(--green-soft); }
.knowledge-main { min-width: 0; }
.knowledge-main strong { display: block; margin: 8px 0 5px; font-size: .96rem; line-height: 1.45; }
.knowledge-main small { display: block; color: var(--secondary-label); font-size: .73rem; }
.chevron { color: var(--tertiary-label); font-size: 1.5rem; }

.answer-card, .recall-card, .practice-card, .form-card, .paper-maker, .profile-card, .school-card { border: 1px solid var(--hairline); border-radius: var(--radius-xl); background: var(--card-solid); box-shadow: var(--shadow); }
.answer-card { padding: clamp(20px,5vw,34px); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.answer-card > h2, .recall-card > h2, .practice-card > h2 { margin: 20px 0 24px; font-size: clamp(1.45rem,5vw,2.15rem); line-height: 1.38; letter-spacing: -.025em; }
.answer-block { margin-top: 16px; padding: 18px; border-radius: 17px; background: var(--sunken); }
.answer-block.brief { background: var(--accent-soft); }
.answer-block > span, .answer-block-head > span, .recall-answer > span { color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .06em; }
.answer-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.answer-block-head .text-button { min-height: 26px; margin: -4px 0; padding: 2px 0; font-size: .78rem; }
.answer-block p, .recall-answer p { margin: 8px 0 0; line-height: 1.85; }
.answer-block small { display: block; margin-top: 8px; color: var(--secondary-label); font-size: .72rem; }
.source-line { margin: 24px 0 0; padding-top: 15px; border-top: 1px solid var(--separator); color: var(--tertiary-label); font-size: .7rem; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.answer-card > .inline-actions { flex-wrap: nowrap; }
.answer-card > .inline-actions > button { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; }
.embedded-note { margin-top: 18px; box-shadow: none; background: var(--sunken-2); }
.primary-button, .secondary-button, .soft-button, .danger-button, .text-button { min-height: 44px; border: 0; border-radius: 13px; padding: 10px 16px; font-weight: 720; }
.primary-button { color: #fff; background: var(--accent); }
.secondary-button { color: var(--accent); background: var(--accent-soft); }
.soft-button { color: var(--blue); background: var(--blue-soft); }
.danger-button { color: var(--red); background: var(--danger-soft); }
.text-button { padding-left: 0; padding-right: 0; color: var(--blue); background: transparent; }
.full-width { width: 100%; }
.primary-button:disabled, .secondary-button:disabled { opacity: .55; cursor: progress; }
.primary-button:disabled { opacity: .38; cursor: default; }

.recall-card, .practice-card { min-height: 490px; padding: clamp(20px,5vw,34px); display: flex; flex-direction: column; }
.recall-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.recall-timer { padding: 6px 10px; border-radius: 999px; color: var(--secondary-label); background: var(--system-bg); font-size: .76rem; }
.recall-timer strong { color: var(--label); font-variant-numeric: tabular-nums; }
.recall-hint { margin: 26px 0 0; color: var(--secondary-label); font-size: .82rem; }
.recall-answer { margin: 2px 0 20px; padding: 18px; border-radius: 17px; background: var(--green-soft); }
.recall-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: auto; padding-top: 22px; }
.recall-card .inline-actions, .practice-card .inline-actions { justify-content: center; }
.form-card { margin-top: 16px; padding: 18px; }
.form-card > label:first-child, .field-label { display: block; margin: 0 0 7px; color: var(--secondary-label); font-size: .76rem; font-weight: 700; }
.form-card textarea, .large-textarea, .form-card input, .form-card select, .bottom-sheet select, .bottom-sheet input { width: 100%; border: 1px solid var(--separator); border-radius: 13px; color: var(--label); background: var(--sunken-2); padding: 12px; }
.form-card textarea, .large-textarea { resize: vertical; line-height: 1.65; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.form-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.form-title h2 { margin: 0; font-size: 1.2rem; }
.form-title span { color: var(--secondary-label); font-size: .72rem; }
.form-card select, .bottom-sheet select { min-height: 48px; margin-bottom: 15px; }
.scope-chip { margin-bottom: 16px; padding: 12px; border-radius: 13px; color: var(--accent); background: var(--accent-soft); font-weight: 750; }
.count-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 18px; }
.count-grid label { color: var(--secondary-label); font-size: .75rem; font-weight: 700; }
.count-grid input { display: block; margin-top: 6px; min-height: 48px; font-size: 1rem; }

.preset-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.preset-card { min-height: 66px; padding: 11px 10px; border: 1px solid var(--separator); border-radius: 15px; background: var(--card-solid); text-align: left; }
.preset-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-ring); background: var(--accent-soft); }
.preset-card strong { display: block; font-size: .84rem; line-height: 1.3; letter-spacing: -.2px; }
.preset-card span { display: block; margin-top: 3px; color: var(--secondary-label); font-size: .68rem; line-height: 1.3; }
.preset-card span:empty { display: none; }
.check-list { max-height: 330px; overflow: auto; margin: 2px 0 18px; border: 1px solid var(--separator); border-radius: 15px; background: var(--sunken-4); }
.check-row { display: grid; grid-template-columns: 23px 1fr; gap: 10px; align-items: start; padding: 12px; border-bottom: 1px solid var(--separator); font-size: .86rem; }
.check-row:last-child { border-bottom: 0; }
.check-row input { width: 19px; height: 19px; accent-color: var(--accent); }
.check-row small { display: block; margin-bottom: 2px; color: var(--secondary-label); font-size: .68rem; }
.practice-progress { height: 5px; margin: -4px 0 22px; border-radius: 99px; background: var(--secondary-bg); overflow: hidden; }
.practice-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.stat-strip { display: grid; grid-template-columns: repeat(5,1fr); margin-bottom: 14px; border-radius: var(--radius-lg); background: var(--card-solid); overflow: hidden; }
.stat-strip button { min-height: 78px; border: 0; border-right: 1px solid var(--separator); background: transparent; }
.stat-strip button:last-child { border-right: 0; }
.stat-strip strong, .stat-strip span { display: block; }
.stat-strip strong { font-size: 1.35rem; }
.stat-strip span { color: var(--secondary-label); font-size: .7rem; }
.stat-strip small { display: block; margin-top: 3px; color: var(--accent); font-size: .62rem; font-weight: 750; }
.paper-maker { margin-bottom: 18px; padding: 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.paper-maker h2 { margin: 8px 0 3px; font-size: 1.12rem; }
.paper-maker p { margin: 0; color: var(--secondary-label); font-size: .75rem; }
.paper-maker button { flex: 0 0 auto; }
.segmented-control { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 4px; border-radius: 13px; background: var(--track); }
.segmented-control button { min-height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--secondary-label); font-size: .78rem; font-weight: 700; }
.segmented-control button.active { color: var(--label); background: var(--track-active); box-shadow: 0 2px 8px var(--track-shadow); }
.collection-list { display: grid; gap: 10px; margin-top: 14px; }
.collection-row { width: 100%; padding: 15px; border: 0; border-radius: 17px; background: var(--card-solid); display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; text-align: left; }
.collection-row small, .collection-row strong { display: block; }
.collection-row small { color: var(--secondary-label); font-size: .69rem; }
.collection-row strong { margin-top: 5px; line-height: 1.42; }
.collection-row .row-note { display: block; margin-top: 6px; color: var(--accent); font-size: .69rem; font-style: normal; font-weight: 700; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* 抽背续做 / 薄弱统计 / 记对错 */
.resume-card, .due-card, .weak-card { margin-bottom: 18px; padding: 18px; border: 1px solid var(--accent-line); border-radius: var(--radius-xl); background: var(--card-solid); box-shadow: var(--shadow); }
.due-card, .paper-maker { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.due-card h2 { margin: 6px 0 5px; font-size: 1.2rem; }
.due-card p { margin: 0; color: var(--secondary-label); font-size: .76rem; }
.resume-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.resume-card h3 { margin: 7px 0 4px; font-size: 1.12rem; }
.resume-card p { margin: 0; color: var(--secondary-label); font-size: .76rem; }
.resume-actions { display: grid; gap: 8px; justify-items: center; }
.weak-card { border-color: var(--separator); }
.weak-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--separator); }
.weak-row:first-of-type { border-top: 0; }
.weak-copy strong { display: block; font-size: .92rem; line-height: 1.35; }
.weak-copy small { display: block; margin-top: 3px; color: var(--secondary-label); font-size: .68rem; }
.weak-pct { font-size: .9rem; font-weight: 800; color: var(--accent); }
.weak-bar { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: var(--secondary-bg); overflow: hidden; }
.weak-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.weak-row .text-button { grid-column: 1 / -1; justify-self: start; }
.judge-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.judge-row button { min-height: 48px; border-radius: var(--radius-lg); font-size: .95rem; font-weight: 750; }
.judge-ok { border: 0; color: white; background: var(--accent); box-shadow: 0 6px 18px var(--accent-lift); }
.judge-no { border: 1px solid var(--separator); color: var(--secondary-label); background: var(--card-solid); }
.judge-row button:active { transform: scale(.985); }

/* 试卷是纸：主题再怎么变、要不要打印，它永远是白纸黑字 */
.paper-sheet { --label: #16161a; --secondary-label: #6e6e73; --tertiary-label: #8e8e93; --accent: #8a1f2d; --separator: rgba(60,60,67,.2); --shadow: 0 14px 38px rgba(31,31,36,.08); padding: clamp(22px,5vw,48px); border-radius: 8px; background: #fff; color: #16161a; box-shadow: var(--shadow); }
.paper-title { padding-bottom: 22px; border-bottom: 2px solid var(--label); text-align: center; }
.paper-title span { color: var(--accent); font-weight: 900; letter-spacing: .16em; }
.paper-title h1 { margin: 8px 0 4px; font-size: clamp(1.35rem,5vw,2rem); }
.paper-title p { margin: 0; color: var(--secondary-label); font-size: .75rem; }
.paper-section { margin-top: 28px; }
.paper-section h2 { margin: 0 0 12px; font-size: 1.1rem; }
.paper-question { display: grid; grid-template-columns: 26px 1fr; gap: 4px; padding: 11px 0; border-bottom: 1px dashed var(--separator); }
.paper-question p { margin: 0; }
.paper-question small { grid-column: 2; color: var(--tertiary-label); }
.paper-actions { display: flex; gap: 10px; margin-top: 14px; }
.paper-actions > * { flex: 1; }
.paper-preview { display: flex; flex-direction: column; gap: 16px; margin: 18px 0 4px; }
.paper-preview figure { margin: 0; }
.paper-preview img { display: block; width: 100%; border: 1px solid var(--separator); border-radius: 6px; background: #fff; }
.paper-preview figcaption { margin-top: 6px; text-align: center; color: var(--tertiary-label); font-size: .7rem; }
.answer-key { display: grid; gap: 12px; max-height: 62vh; overflow: auto; }
.answer-key > div { padding: 14px; border-radius: 14px; background: var(--sunken-3); }
.answer-key strong { font-size: .86rem; }
.answer-key p { margin: 7px 0 0; color: var(--secondary-label); font-size: .84rem; line-height: 1.6; }

.profile-card { padding: 18px; display: flex; align-items: center; gap: 15px; }
.profile-copy { flex: 1 1 auto; min-width: 0; }
.profile-copy h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card h2 { margin: 3px 0; font-size: 1.35rem; }
.profile-card p, .profile-card small { margin: 0; color: var(--secondary-label); font-size: .73rem; }
.avatar-button { position: relative; flex: 0 0 72px; width: 72px; height: 72px; padding: 0; border: 0; border-radius: 50%; background: var(--avatar-wash); overflow: hidden; font-size: 2rem; }
.avatar-button span { display: inline-block; color: var(--accent); font-size: 2rem; font-weight: 700; line-height: 1; transform: translateY(-7px); }
.avatar-button img { width: 100%; height: 100%; object-fit: cover; }
.avatar-button i { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px; color: white; background: rgba(0,0,0,.45); font-size: .58rem; font-style: normal; }
.inline-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.inline-field input { min-width: 0; }
.inline-field button { border: 0; border-radius: 12px; padding: 0 16px; color: white; background: var(--accent); font-weight: 700; }
.school-card { margin-top: 16px; padding: 20px; color: white; background: linear-gradient(145deg,#5c111c,#9c2938); overflow: hidden; }
.school-card blockquote { margin: 0 0 8px; font-family: "STKaiti","KaiTi",serif; font-size: 1.35rem; }
.school-card p { margin: 0; color: var(--on-tone); font-size: .75rem; }
.settings-group { margin-top: 16px; border-radius: var(--radius-lg); background: var(--card-solid); overflow: hidden; }
.settings-group button { width: 100%; min-height: 68px; padding: 12px 15px; border: 0; border-bottom: 1px solid var(--separator); background: transparent; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; text-align: left; }
.settings-group button:last-child { border-bottom: 0; }
.settings-group strong, .settings-group small { display: block; }
.settings-group small { margin-top: 2px; color: var(--secondary-label); font-size: .7rem; }
.settings-group button > span:last-child { color: var(--blue); font-size: .78rem; }
.settings-group .danger-row strong, .settings-group .danger-row > span:last-child { color: var(--red); }

.no-scroll { overflow: hidden; }
.overlay-backdrop { position: fixed; z-index: 100; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 12px; background: var(--scrim); backdrop-filter: blur(8px); }
.bottom-sheet { width: min(100%,640px); max-height: calc(100vh - 26px); padding: 20px; border-radius: 28px; background: var(--card-solid); box-shadow: 0 22px 70px var(--sheet-shadow); overflow: auto; animation: sheetUp .25s ease; }
@keyframes sheetUp { from { transform: translateY(22px); opacity: .6; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.sheet-head small { color: var(--accent); font-weight: 750; }
.sheet-head h2 { margin: 2px 0 0; }
.close-button { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--secondary-label); background: var(--secondary-bg); font-size: 1.4rem; }
.sheet-question { padding: 13px; border-radius: 13px; background: var(--system-bg); font-weight: 700; }
.stack-actions { display: grid; gap: 8px; margin-top: 12px; }
.full-overlay { position: absolute; inset: 0; width: 100%; min-height: 100%; padding: calc(12px + env(safe-area-inset-top)) 12px 20px; background: var(--system-bg); }
.search-sheet { width: min(100%,760px); margin: 0 auto; }
.search-bar { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 5px 5px 5px 12px; border-radius: 14px; background: var(--fill); }
.search-bar span { color: var(--secondary-label); font-size: 1.25rem; }
.search-bar input { min-width: 0; height: 38px; border: 0; outline: 0; background: transparent; font-size: 1rem; }
.search-bar button { height: 38px; border: 0; background: transparent; color: var(--blue); }
.search-results { display: grid; gap: 9px; margin-top: 16px; }
.search-result { padding: 14px; border: 0; border-radius: 16px; background: var(--card-solid); text-align: left; }
.search-result span, .search-result strong, .search-result small { display: block; }
.search-result span, .search-result small { color: var(--secondary-label); font-size: .69rem; }
.search-result strong { margin: 5px 0; line-height: 1.4; }
.search-empty { padding: 58px 20px; text-align: center; color: var(--secondary-label); }

@media (min-width: 700px) {
  .preset-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .preset-card { min-height: 72px; }
  .preset-card strong { font-size: .92rem; }
  .answer-card, .recall-card, .practice-card { padding: 34px; }
}

@media print {
  html, body { background: #fff; color: #16161a; }
  .desktop-sidebar, .ios-navbar, .tabbar, .paper-actions, .toast { display: none !important; }
  .app-shell, .main-stage { display: block; padding: 0; }
  .screen { width: 100%; max-width: none; padding: 0; }
  .paper-sheet { box-shadow: none; padding: 12mm; }
}

/* 版权声明 */
.site-footer { padding: 18px 16px 8px; text-align: center; color: var(--secondary-label); font-size: .72rem; line-height: 1.6; }
.side-copyright { margin: 10px 8px 0; padding: 0 8px; color: var(--secondary-label); font-size: .66rem; line-height: 1.6; }

/* 付费墙 */
.paywall { max-width: 560px; margin: 0 auto; padding: 6px 0 26px; display: grid; gap: 14px; }
.pw-card { padding: 22px 20px; border-radius: 18px; background: var(--card-solid); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.pw-hero { text-align: center; }
.pw-hero h2 { margin: 10px 0 6px; font-size: 1.28rem; }
.pw-hero > p { color: var(--secondary-label); font-size: .84rem; line-height: 1.6; margin: 0 0 14px; }
.pw-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: .68rem; font-weight: 700; color: white; background: var(--accent); letter-spacing: .12em; }
.pw-price { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-bottom: 16px; }
.pw-price strong { font-size: 2.1rem; color: var(--accent); font-weight: 850; }
.pw-price span { color: var(--secondary-label); font-size: .78rem; }
.pw-steps { display: grid; gap: 8px; text-align: left; margin: 0 0 16px; padding: 14px 16px 14px 34px; border-radius: 14px; background: var(--accent-soft); }
.pw-steps li { font-size: .84rem; }
.pw-steps small { display: block; color: var(--secondary-label); }
.pw-qr { display: grid; place-items: center; }
.pw-qr img { width: 200px; height: 200px; object-fit: contain; border-radius: 14px; border: 1px solid var(--separator); background: white; }
.pw-qr-missing { width: 200px; padding: 26px 16px; text-align: center; color: var(--secondary-label); font-size: .76rem; border: 1px dashed var(--separator); border-radius: 14px; background: var(--fill-ghost); }
.pw-hint { margin: 10px 0 0; font-size: .74rem; color: var(--secondary-label); }
.pw-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.pw-tabs button { min-height: 42px; border: 0; border-radius: 12px; background: var(--fill-mute); font-weight: 700; color: var(--secondary-label); }
.pw-tabs button.active { background: var(--accent-wash-3); color: var(--accent); }
.pw-form { display: grid; gap: 10px; }
.pw-form input { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--separator); border-radius: 13px; background: var(--card-solid); font-size: .92rem; box-sizing: border-box; }
.pw-form input:focus { outline: none; border-color: var(--accent); }
.pw-otp-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.pw-primary { min-height: 46px; border: 0; border-radius: 13px; background: var(--accent); color: white; font-weight: 700; font-size: .95rem; }
.pw-primary:disabled { opacity: .6; }
.pw-soft { min-height: 46px; padding: 0 16px; border: 0; border-radius: 13px; background: var(--accent-wash-3); color: var(--accent); font-weight: 700; white-space: nowrap; }
.pw-soft:disabled { opacity: .55; }
.pw-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--secondary-label); font-size: .72rem; }
.pw-divider::before, .pw-divider::after { content: ""; flex: 1; height: 1px; background: var(--separator); }
.pw-link { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--secondary-label); font-size: .8rem; text-decoration: underline; }
.pw-account { margin: 0 0 10px; color: var(--secondary-label); font-size: .78rem; }
.pw-notice { text-align: center; }
.pw-notice p { color: var(--secondary-label); font-size: .78rem; margin: 4px 0 0; }
.member-text { font-size: .88rem; margin: 0 0 8px; }
.member-text.ok { color: var(--accent); font-weight: 700; }
.member-text small { display: block; color: var(--secondary-label); font-weight: 400; font-size: .72rem; margin-top: 2px; }

/* 管理员数据看板 */
.admin-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.admin-numbers > div { text-align: center; padding: 10px 4px; border-radius: 12px; background: var(--accent-wash-2); }
.admin-numbers strong { display: block; font-size: 1.25rem; color: var(--accent); font-weight: 800; }
.admin-numbers small { color: var(--secondary-label); font-size: .66rem; }
.admin-users { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; margin-top: 10px; }
.admin-user { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--fill-faint); }
.admin-email { font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-meta { font-size: .66rem; color: var(--secondary-label); white-space: nowrap; }

/* ── 自建题库 ── */
.status-badge.mine { color: var(--accent); background: var(--accent-soft); }
.knowledge-row.mine { box-shadow: inset 3px 0 0 var(--accent); }
.soft-button.danger { color: var(--red); background: var(--danger-soft); }
.add-item-entry { width: 100%; min-height: 52px; margin-bottom: 14px; border: 1.5px dashed var(--accent-dash); border-radius: 17px; color: var(--accent); background: var(--accent-soft); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; }
.add-item-entry span { font-size: 1.15rem; line-height: 1; }
.collection-entry { position: relative; }
.collection-entry .collection-row { padding-right: 52px; }
.entry-edit { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--accent); background: var(--accent-soft); font-size: .95rem; font-weight: 800; }
.mine-toolbar { display: flex; margin-top: 14px; }
.mine-toolbar .primary-button { width: 100%; }
.item-editor { padding: 0 2px; }
.item-editor .field-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.item-editor .counter { color: var(--tertiary-label); font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.item-editor .counter.over { color: var(--red); }
.item-editor input, .item-editor select, .item-editor textarea { width: 100%; border: 1px solid var(--separator); border-radius: 13px; color: var(--label); background: var(--sunken-2); padding: 12px; margin-bottom: 14px; }
.item-editor textarea { resize: vertical; line-height: 1.65; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.editor-grid .field-label { display: block; }
.editor-hint { display: none; margin-top: 4px; padding: 11px 13px; border-radius: 13px; color: var(--red); background: var(--danger-soft); font-size: .76rem; font-weight: 650; line-height: 1.55; }
.editor-hint.show { display: grid; gap: 4px; }
.profile-mine { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.profile-mine p { margin: 0; color: var(--secondary-label); font-size: .78rem; line-height: 1.5; }
.profile-mine strong { color: var(--accent); font-size: 1rem; }
.profile-mine button { flex: 0 0 auto; }
@media (min-width: 720px) { .editor-grid { grid-template-columns: repeat(4,1fr); } }

/* 集合列表：搜索 / 科目筛选 / 批量管理 */
.list-tools { margin-top: 14px; display: grid; gap: 8px; }
.list-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--separator); border-radius: 13px; background: var(--card-solid); }
.list-search span { color: var(--tertiary-label); font-size: .95rem; }
.list-search input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; font-size: .9rem; }
.list-search input:focus { outline: none; }
.list-tools-row { display: flex; gap: 8px; }
.list-tools-row select { flex: 1; min-width: 0; min-height: 40px; border: 1px solid var(--separator); border-radius: 12px; color: var(--label); background: var(--card-solid); padding: 0 10px; font-size: .82rem; }
.list-tools-row .soft-button { min-height: 40px; padding: 8px 14px; font-size: .82rem; white-space: nowrap; }
.bulk-bar { margin-top: 14px; padding: 9px 12px; border-radius: 15px; background: var(--card-solid); border: 1px solid var(--separator); display: flex; align-items: center; gap: 10px; }
.bulk-bar .text-button { flex: 0 0 auto; font-size: .8rem; }
.bulk-bar #bulk-clear { margin-left: auto; color: var(--red); }
.bulk-count { flex: 1; color: var(--secondary-label); font-size: .78rem; font-weight: 700; text-align: center; }
.bulk-bar .soft-button { min-height: 38px; padding: 8px 14px; font-size: .82rem; white-space: nowrap; }
.soft-button.danger { color: var(--red); background: var(--danger-soft); }
.soft-button.danger:disabled { opacity: .4; }
.list-caption { margin: 12px 2px 8px; color: var(--tertiary-label); font-size: .72rem; font-weight: 700; }
.collection-entry.picking { display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 8px; }
.collection-entry.picking .collection-row { pointer-events: none; }
.bulk-check { display: flex; align-items: center; justify-content: center; }
.bulk-check input { position: absolute; opacity: 0; pointer-events: none; }
.bulk-check span { width: 22px; height: 22px; border: 2px solid var(--separator); border-radius: 50%; background: var(--card-solid); display: block; }
.bulk-check input:checked + span { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px #fff; }
/* 在线人数：数字是主角，标签退到背景；取不到时点变灰且不再呼吸 */
.presence { display: flex; align-items: baseline; gap: 5px; }
.presence-dot { align-self: center; width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: presence-pulse 2.6s cubic-bezier(.3,0,.2,1) infinite; }
.presence-count { color: var(--label); font-size: 1.2rem; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.presence-label { color: var(--tertiary-label); font-size: .74rem; font-weight: 600; letter-spacing: .02em; }
.presence.idle .presence-dot { background: var(--separator); animation: none; }
.presence.idle .presence-count { color: var(--tertiary-label); }
@keyframes presence-pulse {
  0% { box-shadow: 0 0 0 0 var(--pulse); }
  60% { box-shadow: 0 0 0 6px rgba(36,138,61,0); }
  100% { box-shadow: 0 0 0 0 rgba(36,138,61,0); }
}
@media (prefers-reduced-motion: reduce) { .presence-dot { animation: none; } }

/* ── 外观：个人资料卡右侧的圆形图标按钮，点一下在 跟随系统→深色→浅色 之间循环 ── */
.theme-button { flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.theme-button:active { transform: scale(.94); }
.theme-icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon .fill { fill: currentColor; stroke: none; }
/* 卡片标题行：左边小标题，右边挂一个状态（如在线人数） */
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.card-head .field-label { margin: 0; }

/* ── 黑夜模式 ──
   深色不是把颜色反过来：底色走纯黑、卡片走深灰、文字走白、线条走半透明白，
   品牌色（酒红/蓝/绿/橙/红）统一提亮到在深底上读得清的亮度。 */
:root[data-theme="dark"] {
  color-scheme: dark;
  --system-bg: #000;
  --secondary-bg: #1c1c1e;
  --card: rgba(28,28,30,.92);
  --card-solid: #1c1c1e;
  --label: #f2f2f7;
  --secondary-label: #98989f;
  --tertiary-label: #6c6c72;
  --separator: rgba(84,84,88,.62);
  --accent: #d2455a;
  --accent-soft: rgba(210,69,90,.16);
  --blue: #0a84ff;
  --green: #32d74b;
  --green-soft: rgba(50,215,75,.15);
  --orange: #ff9f0a;
  --orange-soft: rgba(255,159,10,.15);
  --red: #ff453a;
  --shadow: 0 14px 38px rgba(0,0,0,.55);
  --fill: rgba(118,118,128,.24);
  --fill-mute: rgba(118,118,128,.2);
  --fill-weak: rgba(118,118,128,.18);
  --fill-faint: rgba(118,118,128,.14);
  --fill-ghost: rgba(118,118,128,.12);
  --track: #2c2c2e;
  --track-active: #48484a;
  --sunken: #161618;
  --sunken-2: #161618;
  --sunken-3: #1a1a1c;
  --sunken-4: #1a1a1c;
  --tab-idle: #98989f;
  --hairline: rgba(84,84,88,.45);
  --hairline-2: rgba(84,84,88,.55);
  --card-sheen: rgba(255,255,255,.05);
  --row-shadow: rgba(0,0,0,.3);
  --track-shadow: rgba(0,0,0,.35);
  --sheet-shadow: 0 22px 70px rgba(0,0,0,.6);
  --scrim: rgba(0,0,0,.55);
  --focus-ring: rgba(10,132,255,.45);
  --toast-bg: rgba(240,240,242,.95);
  --toast-label: #16161a;
  --chrome-bar: rgba(0,0,0,.66);
  --chrome-chip: rgba(44,44,46,.82);
  --chrome-border: rgba(255,255,255,.1);
  --chrome-tabbar: rgba(28,28,30,.86);
  --chrome-shadow: rgba(0,0,0,.6);
  --sidebar: rgba(16,16,18,.72);
  --accent-wash: rgba(210,69,90,.14);
  --accent-wash-2: rgba(210,69,90,.12);
  --accent-wash-3: rgba(210,69,90,.16);
  --accent-line: rgba(210,69,90,.34);
  --accent-dash: rgba(210,69,90,.5);
  --accent-ring: rgba(210,69,90,.2);
  --accent-lift: rgba(210,69,90,.35);
  --blue-soft: rgba(10,132,255,.18);
  --blue-badge: rgba(10,132,255,.18);
  --purple: #bf9cf5;
  --purple-soft: rgba(191,156,245,.18);
  --danger-soft: rgba(255,69,58,.18);
  --green-line: rgba(50,215,75,.3);
  --pulse: rgba(50,215,75,.45);
  --avatar-wash: linear-gradient(145deg,#3a1f26,#2a1a1e);
  --on-tone: rgba(255,255,255,.82);         /* 深色下彩色卡被压暗，淡字要跟着提亮 */
}
/* 彩色书卡在纯黑底上略压一档，避免六张高饱和色块抢戏 */
:root[data-theme="dark"] .book-card,
:root[data-theme="dark"] .book-summary,
:root[data-theme="dark"] .school-card,
:root[data-theme="dark"] [class*="tone-"] { filter: brightness(.9); }
/* ── 首页「接着背」与今日进度 ── */
.hero-count { margin: 0 0 4px; color: var(--secondary-label); font-size: .82rem; white-space: nowrap; }
.hero-count strong { color: var(--label); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.today-line { margin: -6px 4px 4px; color: var(--secondary-label); font-size: .82rem; }
.today-line strong { color: var(--accent); }
.continue-card { width: 100%; margin: -4px 0 4px; padding: 15px 16px 15px 20px; border: 1px solid var(--hairline); border-radius: var(--radius-lg); display: flex; align-items: center; gap: 14px; position: relative; overflow: hidden; text-align: left; color: var(--label); background: var(--card-solid); box-shadow: var(--shadow); transition: transform .18s ease; }
.continue-card:active { transform: scale(.985); }
.continue-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.continue-copy { flex: 1; min-width: 0; display: grid; gap: 3px; }
.continue-copy small { color: var(--secondary-label); font-size: .72rem; font-weight: 650; }
.continue-copy strong { font-size: 1.02rem; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-copy em { color: var(--secondary-label); font-size: .78rem; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-side { flex: none; display: grid; justify-items: end; gap: 2px; }
.continue-side b { font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.continue-side b i { color: var(--tertiary-label); font-size: .82rem; font-style: normal; font-weight: 650; }
.continue-side small { color: var(--accent); font-size: .7rem; font-weight: 700; }

/* ── 搜索：命中计数、关键词高亮、答案片段 ── */
.search-count { margin: 0 4px 2px; color: var(--secondary-label); font-size: .74rem; }
.search-result mark { padding: 0 1px; border-radius: 3px; color: inherit; background: rgba(255,204,0,.42); }
.search-snippet { margin: 0 0 6px; color: var(--secondary-label); font-size: .78rem; line-height: 1.55; }

/* ── 收藏 / 错题按钮的选中态 ── */
.soft-button.on { color: var(--accent); background: var(--accent-soft); }

/* ── 详情页：没有单独助记版时的入口 ── */
.text-button.add-brief { min-height: 36px; margin: -2px 0 10px; padding: 6px 2px; color: var(--secondary-label); background: none; font-size: .82rem; font-weight: 650; }

/* ── 答案速查：与卷面同样分组 ── */
.answer-key-title { margin: 6px 2px -4px; color: var(--accent); font-size: .86rem; letter-spacing: .02em; }
.answer-key-title:first-child { margin-top: 0; }

:root[data-theme="dark"] .search-result mark { background: rgba(255,214,10,.32); }
:root[data-theme="dark"] .continue-card { border-color: rgba(255,255,255,.08); }

/* 「我的」页管理员卡片里的后台入口 */
.admin-open { display: inline-flex; align-items: center; margin-top: 12px; text-decoration: none; font-size: .86rem; }

/* 论述题徽标：与名词解释（蓝）、简答（紫）区分 */
.type-badge.essay { color: var(--orange); background: var(--orange-soft); }

/* ══ 抽背 / 复习 两页的版式（2026-11 改版） ══ */
.page-hero { margin: 6px 2px 18px; }
.page-hero h2 { margin: 0; font-size: clamp(1.9rem, 8vw, 2.6rem); line-height: 1.08; letter-spacing: -.04em; }
.page-hero p { margin: 8px 0 0; color: var(--secondary-label); font-size: .9rem; line-height: 1.5; }
.block-title { margin: 4px 4px 9px; color: var(--secondary-label); font-size: .76rem; font-weight: 750; letter-spacing: .04em; }
.block-title ~ .block-title { margin-top: 20px; }
.primary-button.small, .secondary-button.small { min-height: 36px; padding: 7px 14px; border-radius: 11px; font-size: .82rem; }

/* 抽背：范围分段 + 集合卡片 + 右侧设置面板 */
.practice-layout { display: grid; gap: 18px; }
.scope-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 4px; border-radius: 15px; background: var(--track); }
.scope-seg button { min-height: 42px; padding: 6px 4px; border: 0; border-radius: 11px; color: var(--secondary-label); background: transparent; font-size: .84rem; font-weight: 720; white-space: nowrap; }
.scope-seg button.active { color: var(--accent); background: var(--track-active); box-shadow: 0 2px 8px var(--track-shadow); }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.set-tile { position: relative; min-height: 74px; padding: 12px; border: 1px solid var(--hairline-2); border-radius: 17px; background: var(--card-solid); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; text-align: left; box-shadow: 0 4px 14px var(--row-shadow); }
.set-tile .set-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-size: 1rem; font-weight: 800; }
.set-tile strong, .set-tile small { display: block; }
.set-tile strong { font-size: .9rem; letter-spacing: -.2px; }
.set-tile small { margin-top: 2px; color: var(--secondary-label); font-size: .7rem; }
.set-tile b { position: absolute; top: 10px; right: 12px; color: var(--accent); font-size: .78rem; }
.set-tile.empty { opacity: .62; box-shadow: none; }
.set-tile.empty .set-icon { color: var(--secondary-label); background: var(--fill-mute); }
.set-tile.active { opacity: 1; border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-ring); }
.set-tile.active .set-icon { color: #fff; background: var(--accent); }
.practice-scope .weak-card { margin: 20px 0 0; }
.practice-panel { margin-top: 0; padding: 20px; }
.panel-kicker { color: var(--secondary-label); font-size: .74rem; font-weight: 750; letter-spacing: .04em; }
.panel-title { margin: 4px 0 16px; font-size: 1.3rem; line-height: 1.3; letter-spacing: -.02em; }
.practice-panel .count-grid { margin: 2px 0 16px; }
.count-field > span { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin: 0 2px 7px; color: var(--label); font-size: .82rem; font-weight: 720; }
.count-field em { color: var(--tertiary-label); font-size: .7rem; font-style: normal; font-weight: 600; }
.stepper { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; height: 50px; border: 1px solid var(--separator); border-radius: 14px; background: var(--sunken-2); overflow: hidden; }
.stepper button { height: 100%; border: 0; color: var(--accent); background: transparent; font-size: 1.15rem; font-weight: 700; }
.stepper button:disabled { color: var(--tertiary-label); }
.stepper button:active:not(:disabled) { background: var(--fill-weak); }
.form-card .stepper input { width: 100%; min-height: 0; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; text-align: center; background: transparent; font-size: 1.15rem; font-weight: 750; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.panel-empty { margin: 4px 0 16px; padding: 14px; border-radius: 13px; color: var(--secondary-label); background: var(--fill-faint); font-size: .84rem; line-height: 1.55; }
.panel-note { margin: 10px 2px 0; color: var(--tertiary-label); font-size: .74rem; text-align: center; }

/* 复习：分类卡片 + 列表面板 + 组卷入口 */
.library-layout { display: grid; gap: 16px; }
.library-main { display: grid; gap: 16px; }
.collection-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.collection-tile { position: relative; min-height: 86px; padding: 11px 12px; border: 1px solid var(--hairline-2); border-radius: 17px; background: var(--card-solid); display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; align-items: start; text-align: left; box-shadow: 0 4px 14px var(--row-shadow); }
.collection-tile .tile-icon { grid-column: 2; grid-row: 1; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--secondary-label); background: var(--fill-mute); font-size: .8rem; font-weight: 800; }
.collection-tile strong { grid-column: 1; grid-row: 1; font-size: 1.45rem; line-height: 1.1; letter-spacing: -.03em; }
.collection-tile .tile-label { grid-column: 1 / -1; grid-row: 2; align-self: end; color: var(--secondary-label); font-size: .76rem; font-weight: 700; }
.collection-tile small { position: absolute; left: 12px; bottom: 28px; color: var(--accent); font-size: .62rem; font-weight: 750; }
.collection-tile.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent-ring); }
.collection-tile.active .tile-icon { color: #fff; background: var(--accent); }
.collection-tile.active .tile-label { color: var(--accent); }
.collection-panel { padding: 18px; border: 1px solid var(--hairline); border-radius: var(--radius-xl); background: var(--card); box-shadow: var(--shadow); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.02em; }
.panel-head > div:first-child span { display: block; margin-top: 3px; color: var(--secondary-label); font-size: .76rem; }
.panel-actions { display: flex; gap: 8px; }
.collection-panel .list-tools { margin-top: 14px; }
.collection-panel .collection-list { margin-top: 14px; }
.collection-panel .collection-row { background: var(--sunken-2); }
.collection-panel .empty-state { padding: 34px 16px; background: transparent; }
.row-note.muted { color: var(--tertiary-label) !important; }
.entry-edit.text { width: auto; height: 32px; padding: 0 12px; border-radius: 16px; font-size: .78rem; }
.paper-entry { width: 100%; padding: 16px 18px; border: 1px solid var(--hairline); border-radius: var(--radius-lg); background: var(--card-solid); display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; text-align: left; box-shadow: 0 4px 14px var(--row-shadow); }
.paper-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; background: var(--accent); font-weight: 800; }
.paper-copy strong, .paper-copy small { display: block; }
.paper-copy strong { font-size: 1rem; }
.paper-copy small { margin-top: 3px; color: var(--secondary-label); font-size: .76rem; line-height: 1.45; }
.paper-entry > i { color: var(--tertiary-label); font-size: 1.3rem; font-style: normal; }

@media (min-width: 1000px) {
  .practice-layout { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; gap: 22px; }
  .practice-panel { position: sticky; top: 84px; }
  .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .library-layout { grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 20px; }
  .collection-tiles { position: sticky; top: 84px; grid-template-columns: 1fr; gap: 6px; }
  .collection-tile { min-height: 0; padding: 11px 12px; grid-template-columns: auto 1fr auto; grid-template-rows: auto; align-items: center; gap: 10px; box-shadow: none; }
  .collection-tile .tile-icon { grid-column: 1; grid-row: 1; }
  .collection-tile .tile-label { grid-column: 2; grid-row: 1; align-self: center; font-size: .86rem; color: var(--label); }
  .collection-tile strong { grid-column: 3; grid-row: 1; font-size: 1rem; color: var(--secondary-label); }
  .collection-tile small { position: static; grid-column: 2; grid-row: 2; margin-top: -6px; }
  .collection-tile.active strong { color: var(--accent); }
  .library-main { display: grid; gap: 16px; }
}

/* 章节页：选择隐藏、已隐藏折叠区 */
.chapter-tools { display: flex; gap: 8px; align-items: stretch; margin-bottom: 14px; }
.chapter-tools .add-item-entry { flex: 1; margin-bottom: 0; }
.chapter-tools > .soft-button { flex: 0 0 auto; min-height: 52px; border-radius: 17px; color: var(--secondary-label); background: var(--fill-mute); }
.chapter-tools-hint { flex: 1; align-self: center; color: var(--secondary-label); font-size: .84rem; }
.knowledge-group-title .text-button { min-height: 28px; margin-left: auto; padding: 0; font-size: .78rem; }
.knowledge-row.picking { grid-template-columns: auto 1fr; }
.pick-box { width: 22px; height: 22px; border: 2px solid var(--separator); border-radius: 50%; background: var(--card-solid); }
.knowledge-row.picked { border-color: var(--accent); background: var(--accent-soft); }
.knowledge-row.picked .pick-box { border-color: var(--accent); background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.pick-bar { position: sticky; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 5; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 18px; background: var(--chrome-tabbar); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 28px var(--chrome-shadow); }
.pick-bar span { flex: 1; color: var(--secondary-label); font-size: .84rem; text-align: center; }
.pick-bar .primary-button { min-height: 40px; }
@media (min-width: 1000px) { .pick-bar { bottom: 18px; } }
.hidden-fold { margin-top: 18px; border: 1px dashed var(--separator); border-radius: var(--radius-lg); background: var(--fill-ghost); }
.hidden-fold-head { width: 100%; min-height: 54px; padding: 12px 16px; border: 0; background: transparent; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; text-align: left; }
.hidden-fold-head span { color: var(--label); font-weight: 750; font-size: .9rem; }
.hidden-fold-head small { color: var(--tertiary-label); font-size: .74rem; }
.hidden-fold-head i { color: var(--tertiary-label); font-style: normal; transition: transform .2s; }
.hidden-fold.open .hidden-fold-head i { transform: rotate(90deg); }
.hidden-fold-list { padding: 0 10px 10px; display: grid; gap: 6px; }
.hidden-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 13px; background: var(--card-solid); }
.hidden-row-main { flex: 1; min-width: 0; min-height: 40px; border: 0; background: transparent; display: flex; align-items: center; gap: 8px; text-align: left; color: var(--secondary-label); }
.hidden-row-main strong { font-size: .86rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden-row .text-button { min-height: 34px; padding: 0 10px; font-size: .8rem; }
.soft-button.quiet { color: var(--secondary-label); background: var(--fill-mute); }
.soft-button.quiet.on { color: var(--accent); background: var(--accent-soft); }
.status-badge.hidden-badge { color: var(--secondary-label); background: var(--fill-mute); }
.knowledge-group-title { gap: 8px; }
.collection-entry.with-action .collection-row { padding-right: 88px; }
.collection-entry.with-action .collection-row > span:last-child { display: none; }

/* ===== 登录 / 注册 ===== */
/* 显示哪一屏由 index.html 头部脚本在第一帧前写好的 html[data-auth] 决定，两屏不会同时出现 */
.auth-screen { display: none; }
html[data-auth="out"] .app-shell { display: none; }
html[data-auth="out"] .auth-screen { display: flex; }
html[data-auth="out"] .toast { bottom: calc(28px + env(safe-area-inset-bottom)); }
.auth-screen { min-height: 100vh; min-height: 100dvh; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: calc(32px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom)); background: radial-gradient(120% 60% at 50% -10%, var(--accent-wash-3), transparent 70%), var(--system-bg); }
.auth-panel { width: 100%; max-width: 400px; padding: 30px 24px 24px; border-radius: var(--radius-xl); background: var(--card-solid); border: 1px solid var(--hairline); box-shadow: var(--shadow); }
.auth-brand { display: grid; justify-items: center; text-align: center; margin-bottom: 22px; }
.auth-mark { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: var(--accent); font-size: 1.6rem; font-weight: 850; box-shadow: 0 10px 24px var(--accent-lift); }
.auth-brand h1 { margin: 14px 0 4px; font-size: 1.6rem; letter-spacing: .06em; font-weight: 820; color: var(--label); }
.auth-brand p { margin: 0; color: var(--secondary-label); font-size: .86rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; margin-bottom: 20px; border-radius: 12px; background: var(--track); }
.auth-tabs button { min-height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--secondary-label); font-weight: 680; font-size: .92rem; cursor: pointer; transition: background .18s ease, color .18s ease; }
.auth-tabs button.active { background: var(--track-active); color: var(--label); box-shadow: 0 1px 4px var(--track-shadow); }
.auth-form { display: grid; gap: 14px; }
.auth-form[hidden] { display: none; }
.auth-field { display: grid; gap: 6px; }
.auth-field > span:first-child { font-size: .8rem; font-weight: 650; color: var(--secondary-label); }
.auth-field input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--separator); border-radius: 13px; background: var(--sunken-2); color: var(--label); font-size: 1rem; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.auth-field input::placeholder { color: var(--tertiary-label); font-size: .88rem; }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.auth-field input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255,59,48,.14); }
.auth-pass { position: relative; display: block; }
.auth-pass input { padding-right: 64px; }
.auth-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); min-height: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--secondary-label); font-size: .8rem; font-weight: 650; cursor: pointer; }
.auth-eye:hover { background: var(--fill-weak); }
.auth-error { min-height: 1.2em; margin: -4px 0 -2px; color: var(--red); font-size: .84rem; line-height: 1.45; }
.auth-error:empty { min-height: 0; margin: -7px 0 0; }
.auth-submit { min-height: 48px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-size: 1rem; font-weight: 750; cursor: pointer; transition: opacity .15s ease, transform .1s ease; }
.auth-submit:active { transform: scale(.985); }
.auth-submit:disabled { opacity: .6; cursor: progress; }
.auth-foot { margin: 2px 0 0; text-align: center; color: var(--tertiary-label); font-size: .78rem; line-height: 1.5; }
.auth-copy { margin: 0; text-align: center; color: var(--tertiary-label); font-size: .74rem; line-height: 1.7; }
@media (min-width: 700px) { .auth-panel { padding: 36px 34px 28px; } }

/* 「我的」页账号卡 */
.account-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.account-avatar { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.account-copy { min-width: 0; flex: 1; display: grid; }
.account-copy strong { font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: var(--secondary-label); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-sync { flex: none; padding: 4px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .72rem; font-weight: 700; }
.account-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.password-form { display: grid; gap: 8px; }
.password-form input { margin-bottom: 6px; }
.password-form .primary-button { margin-top: 4px; }
.form-error { min-height: 0; margin: 0; color: var(--red); font-size: .84rem; }
.form-error:empty { display: none; }
.account-actions + .admin-open { display: flex; justify-content: center; width: 100%; margin-top: 10px; }

/* ===== 付费墙 ===== */
/* html[data-pay]：lock = 今日免费时长用完（整页，不能关）；open = 主动打开（弹层）。由头部脚本 / paywall.js 设置 */
.pay-screen { display: none; }
html[data-auth="in"][data-pay] .pay-screen { display: flex; }
html[data-auth="in"][data-pay="lock"] .app-shell { display: none; }
.pay-screen { position: fixed; inset: 0; z-index: 80; overflow-y: auto; align-items: flex-start; justify-content: center; padding: calc(28px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }
html[data-pay="lock"] .pay-screen { background: radial-gradient(120% 60% at 50% -10%, var(--accent-wash-3), transparent 70%), var(--system-bg); }
html[data-pay="open"] .pay-screen { background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
html[data-pay="open"] body { overflow: hidden; }
.pay-panel { position: relative; width: 100%; max-width: 420px; margin: auto 0; padding: 28px 22px 20px; border-radius: var(--radius-xl); background: var(--card-solid); border: 1px solid var(--hairline); box-shadow: var(--shadow); }
.pay-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--fill-mute); color: var(--secondary-label); font-size: 1.25rem; line-height: 1; cursor: pointer; display: none; }
html[data-pay="open"] .pay-close { display: block; }
.when-open { display: none; }
html[data-pay="open"] .when-open { display: inline; }
html[data-pay="open"] .when-lock { display: none; }
.pay-head { text-align: center; }
.pay-icon { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.pay-head h2 { margin: 0 0 8px; font-size: 1.32rem; font-weight: 800; color: var(--label); }
.pay-head p { margin: 0; color: var(--secondary-label); font-size: .86rem; line-height: 1.6; }
.pay-prices { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 20px 0 0; }
html[data-old="1"] .pay-prices { grid-template-columns: 1fr 1fr; }
.old-only, .price-card.old-only { display: none; }
html[data-old="1"] .old-only { display: block; }
html[data-old="1"] .price-card.old-only { display: grid; }
.price-card { position: relative; display: grid; justify-items: center; gap: 2px; padding: 16px 12px 14px; border-radius: 18px; border: 1px solid var(--separator); background: var(--sunken-2); text-align: center; }
.price-card.featured { border: 2px solid var(--accent); background: var(--accent-soft); }
.price-tag { font-size: .78rem; font-weight: 700; color: var(--secondary-label); }
.price-card.featured .price-tag { color: var(--accent); }
.price-card strong { font-size: 2.1rem; line-height: 1.15; font-weight: 850; color: var(--label); letter-spacing: -.02em; }
.price-card strong small { font-size: 1rem; font-weight: 750; margin-right: 1px; }
.price-card.featured strong { color: var(--accent); }
.price-card em { font-style: normal; font-size: .76rem; color: var(--tertiary-label); }
html[data-old="1"] .new-price strong { font-size: 1.6rem; color: var(--secondary-label); padding-top: 6px; }
.pay-old-note { margin: 10px 0 0; text-align: center; font-size: .8rem; color: var(--accent); font-weight: 650; }
.pay-qq { display: grid; justify-items: center; gap: 6px; margin: 18px 0 0; padding: 16px 14px; border-radius: 18px; background: var(--blue-soft); text-align: center; }
.pay-qq-label { font-size: .82rem; font-weight: 700; color: var(--secondary-label); }
.pay-qq-number { font-size: 1.7rem; font-weight: 850; letter-spacing: .06em; color: var(--blue); font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; }
.pay-copy { min-height: 38px; padding: 0 18px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 750; font-size: .88rem; cursor: pointer; }
.pay-qq small { color: var(--secondary-label); font-size: .76rem; line-height: 1.55; }
.pay-redeem { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 16px; }
.pay-redeem input { min-width: 0; min-height: 46px; padding: 10px 13px; border: 1px solid var(--separator); border-radius: 13px; background: var(--sunken-2); color: var(--label); font-size: .95rem; letter-spacing: .03em; outline: none; }
.pay-redeem input::placeholder { letter-spacing: 0; color: var(--tertiary-label); font-size: .86rem; }
.pay-redeem input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.pay-redeem button { min-height: 46px; padding: 0 20px; border: 0; border-radius: 13px; background: var(--accent); color: #fff; font-weight: 750; cursor: pointer; }
.pay-redeem button:disabled { opacity: .6; }
.pay-error { margin: 8px 0 0; color: var(--red); font-size: .84rem; text-align: center; }
.pay-error:empty { display: none; }
.pay-foot { margin: 14px 0 0; text-align: center; font-size: .78rem; color: var(--tertiary-label); }
.pay-foot b { color: var(--secondary-label); font-weight: 650; }
.pay-foot button { border: 0; background: none; padding: 0; color: var(--blue); font: inherit; cursor: pointer; }

/* 「我的」页：免费时长 */
.free-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border-radius: 13px; background: var(--orange-soft); }
.free-row span { font-size: .84rem; font-weight: 650; color: var(--orange); }
.free-row button { flex: none; min-height: 34px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 750; font-size: .82rem; cursor: pointer; }
.account-sync.paid { background: var(--accent-soft); color: var(--accent); }
.account-sync.free { background: var(--fill-mute); color: var(--secondary-label); }
