/* ============ 拾词 · 主题变量（苹果式毛玻璃） ============ */
:root {
  --bg: #dfe5f4;
  --bg2: rgba(255, 255, 255, .34);
  --card: rgba(255, 255, 255, .52);
  --card2: rgba(255, 255, 255, .42);
  --text: #17203a;
  --sub: #55607e;
  --border: rgba(255, 255, 255, .55);
  --border-soft: rgba(23, 32, 58, .08);
  --accent: #4f66ff;
  --accent-weak: rgba(79, 102, 255, .14);
  --green: #0f9d63;
  --green-weak: rgba(31, 194, 126, .16);
  --amber: #d97706;
  --amber-weak: rgba(245, 166, 35, .18);
  --red: #e5484d;
  --red-weak: rgba(239, 91, 108, .16);
  --glass-blur: blur(36px) saturate(190%);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .60);
  --shadow: 0 18px 50px rgba(40, 55, 120, .13);
  --shadow-sm: 0 6px 26px rgba(40, 55, 120, .07);
  --radius: 24px;
  --nav-h: 60px;
}
[data-theme="dark"] {
  --bg: #05070f;
  --bg2: rgba(255, 255, 255, .05);
  --card: rgba(22, 27, 46, .50);
  --card2: rgba(40, 47, 76, .42);
  --text: #edf0fb;
  --sub: #9ba4c2;
  --border: rgba(255, 255, 255, .10);
  --border-soft: rgba(255, 255, 255, .07);
  --accent: #93a2ff;
  --accent-weak: rgba(123, 138, 255, .18);
  --green: #34e0a1;
  --green-weak: rgba(52, 224, 161, .15);
  --amber: #ffc94d;
  --amber-weak: rgba(255, 201, 77, .16);
  --red: #ff8089;
  --red-weak: rgba(255, 128, 137, .15);
  --glass-blur: blur(36px) saturate(160%);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .08);
  --shadow: 0 18px 54px rgba(0, 0, 0, .45);
  --shadow-sm: 0 6px 26px rgba(0, 0, 0, .26);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans JP", sans-serif;
  background: transparent;
  color: var(--text);
  line-height: 1.6;
}
/* 苹果式极光背景（毛玻璃的"内容层"） */
body::before {
  content: "";
  position: fixed; inset: -18%; z-index: -1;
  background:
    radial-gradient(42% 44% at 12% 6%, rgba(96, 118, 255, .62), transparent 62%),
    radial-gradient(38% 40% at 88% 12%, rgba(255, 122, 178, .50), transparent 64%),
    radial-gradient(44% 46% at 82% 86%, rgba(56, 208, 178, .48), transparent 64%),
    radial-gradient(36% 38% at 10% 88%, rgba(255, 187, 92, .44), transparent 64%),
    radial-gradient(34% 34% at 50% 46%, rgba(140, 120, 255, .34), transparent 66%),
    radial-gradient(26% 26% at 34% 68%, rgba(255, 140, 105, .28), transparent 66%);
  pointer-events: none;
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(42% 44% at 12% 6%, rgba(64, 84, 220, .42), transparent 62%),
    radial-gradient(38% 40% at 88% 12%, rgba(170, 60, 130, .32), transparent 64%),
    radial-gradient(44% 46% at 82% 86%, rgba(26, 130, 112, .34), transparent 64%),
    radial-gradient(36% 38% at 10% 88%, rgba(140, 100, 40, .26), transparent 64%),
    radial-gradient(34% 34% at 50% 46%, rgba(80, 90, 200, .30), transparent 66%),
    radial-gradient(26% 26% at 34% 68%, rgba(160, 80, 70, .22), transparent 66%);
}
::selection { background: rgba(91, 108, 255, .28); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; color: inherit; }
::selection { background: rgba(91, 108, 255, .25); }

#app { max-width: 860px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* ============ 顶栏 ============ */
#topbar {
  position: sticky; top: 12px; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  margin: 12px 16px 4px;
  padding: 10px 22px;
  background: color-mix(in srgb, var(--card) 66%, transparent);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--glass-edge), var(--shadow-sm);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1), opacity .3s ease;
  will-change: transform;
}
#topbar.topbar-hidden {
  transform: translateY(calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; }
.brand-logo {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(135deg, #5b6cff, #8f7bff); color: #fff; font-size: 17px;
  box-shadow: 0 4px 12px rgba(91, 108, 255, .35);
}
.brand-sub { font-size: 12px; font-weight: 500; color: var(--sub); margin-left: 2px; padding-left: 12px; border-left: 1px solid var(--border); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; font-size: 17px;
  display: grid; place-items: center; background: var(--card); border: 1px solid var(--border);
  transition: transform .15s;
}
.icon-btn:active { transform: scale(.9); }

/* ============ 导航 ============ */
.nav { display: flex; }
.nav-top { margin-left: auto; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 12px;
  color: var(--sub); text-decoration: none; font-size: 14.5px; font-weight: 600;
  transition: all .18s;
}
.nav a svg { width: 18px; height: 18px; flex: none; }
.nav a.active { color: var(--accent); background: var(--accent-weak); }
.nav a:hover { color: var(--text); }
.nav a.active:hover { color: var(--accent); }
.nav-bottom { display: none; }

/* ============ 主内容 ============ */
#view { flex: 1; padding: 20px 20px calc(28px + env(safe-area-inset-bottom)); animation: viewIn .28s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head { margin: 4px 2px 16px; }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.2px; }
.page-head p { color: var(--sub); font-size: 13.5px; margin-top: 2px; }

/* 毛玻璃卡片 */
.card, .set-item {
  background: var(--card);
}

/* 学习主卡与统计/设置面板是视觉焦点，用完整毛玻璃 */
.study-hero.card, .flashcard .fc-inner, .panel.card {
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.wl-row { background: var(--card); }
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.set-item, .wl-row { border: 1px solid var(--border); }

/* ============ 书库 ============ */
.seg { display: inline-flex; background: var(--card2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 4px; margin-bottom: 16px; backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); }
.seg button { padding: 7px 24px; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--sub); transition: all .18s; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button .cnt { font-size: 12px; color: var(--sub); font-weight: 500; margin-left: 4px; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.book-card { overflow: hidden; transition: transform .18s, box-shadow .18s; display: flex; flex-direction: column; }
.book-card { transition: transform .2s, box-shadow .2s, background .2s; }
.book-card:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .70); box-shadow: var(--glass-edge), var(--shadow); border-color: #fff; }
[data-theme="dark"] .book-card:hover { background: rgba(34, 40, 66, .62); border-color: rgba(255, 255, 255, .22); }
.book-cover {
  position: relative; height: 92px; padding: 14px 16px;
  display: flex; flex-direction: column; justify-content: space-between; color: #fff;
  overflow: hidden;
}
.book-cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, .40) 0%, rgba(255, 255, 255, .10) 30%, transparent 48%);
}
.book-cover .lv-chip, .book-cover .bk-emoji { position: relative; z-index: 1; }
.book-cover .lv-chip {
  align-self: flex-start; font-size: 11.5px; font-weight: 700; letter-spacing: 1px;
  background: rgba(255, 255, 255, .25); backdrop-filter: blur(4px);
  padding: 2.5px 10px; border-radius: 20px;
}
.book-cover .bk-emoji { position: absolute; right: 14px; bottom: 10px; font-size: 34px; opacity: .9; filter: drop-shadow(0 2px 4px rgba(0,0,0,.15)); }
.book-body { padding: 15px 18px 17px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.book-body h3 { font-size: 16.5px; font-weight: 700; }
.book-body .desc { font-size: 12.5px; color: var(--sub); line-height: 1.55; flex: 1; }
.book-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--sub); }
.book-meta b { color: var(--text); font-weight: 700; }

.bar { height: 6px; border-radius: 4px; background: var(--border-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), #9a8cff); transition: width .4s; }
.bar.big { height: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 20px; border-radius: 14px; font-size: 14.5px; font-weight: 700;
  background: var(--card2); color: var(--text); border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
  transition: transform .15s, box-shadow .15s, opacity .15s, background .15s; user-select: none;
}
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #8f7bff); color: #fff; border: none; box-shadow: 0 5px 16px rgba(91, 108, 255, .35); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); background: color-mix(in srgb, var(--red) 7%, transparent); }
.btn.block { width: 100%; }
.btn.big { padding: 14px 28px; font-size: 16px; border-radius: 18px; }
.btn.sm { padding: 6px 13px; font-size: 12.5px; border-radius: 11px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.added { background: var(--green-weak); color: var(--green); border-color: transparent; }
.btn.clear-rec { padding: 8px 13px; font-size: 12.5px; border-radius: 12px; color: var(--sub); background: transparent; border: 1px dashed var(--border); }
.btn.clear-rec:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.keep-hint { font-size: 11px; color: var(--sub); text-align: center; opacity: .75; margin-top: -3px; }

.empty-tip { text-align: center; color: var(--sub); padding: 30px 0; font-size: 14px; }

/* ============ 学习 ============ */
.study-hero { text-align: center; padding: 46px 22px 40px; }
.study-hero .big-emoji { font-size: 54px; }
.study-hero h2 { font-size: 21px; margin: 14px 0 6px; }
.study-hero p { color: var(--sub); font-size: 14px; }
.queue-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 18px 0 26px; }
.q-chip { font-size: 12.5px; font-weight: 600; padding: 5px 13px; border-radius: 20px; background: var(--card2); border: 1px solid var(--border); color: var(--sub); }
.q-chip b { color: var(--text); }
.q-chip.pick { cursor: pointer; transition: all .15s; }
.q-chip.pick:not(.on) { opacity: .55; }
.q-chip.pick.on { background: var(--accent-weak); border-color: var(--accent); color: var(--accent); }
.q-chip.pick.on b { color: var(--accent); }

.study-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.study-top .prog { flex: 1; }
.study-top .prog-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); margin-bottom: 5px; }
.study-top .prog-label b { color: var(--text); }
.quit-btn { font-size: 19px; width: 38px; height: 38px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); display: grid; place-items: center; color: var(--sub); }

.flashcard { perspective: 1200px; }
.fc-inner {
  position: relative; background: var(--card);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--glass-edge), var(--shadow);
  min-height: 380px; padding: 20px 24px 46px;
  display: flex; flex-direction: column;
  transition: transform .3s ease, opacity .25s;
}
.fc-meta { display: flex; align-items: center; gap: 8px; }
.mini-chip { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 16px; background: var(--card2); border: 1px solid var(--border); color: var(--sub); }
.mini-chip.acc { color: var(--accent); background: var(--accent-weak); border-color: transparent; }
.fc-star { margin-left: auto; font-size: 19px; opacity: .75; transition: transform .18s; }
.fc-star:active { transform: scale(1.3); }
.fc-star.on { opacity: 1; filter: drop-shadow(0 1px 3px rgba(245, 166, 35, .5)); }

.fc-front { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 8px; gap: 6px; }
.fc-word { font-weight: 800; letter-spacing: .5px; font-size: clamp(34px, 8vw, 52px); line-height: 1.25; word-break: break-word; }
.fc-reading { font-size: clamp(17px, 4.5vw, 22px); color: var(--accent); font-weight: 600; }
.fc-reading .accent-no { color: var(--amber); font-weight: 700; margin-left: 6px; font-size: .85em; }
.fc-pos { font-size: 13px; color: var(--sub); margin-top: 2px; }
.fc-hint { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: var(--sub); font-size: 12.5px; opacity: .8; }

.fc-back {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: 18px 6px 6px; animation: backIn .32s ease;
}
@keyframes backIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.fc-mean { font-size: clamp(19px, 5vw, 24px); font-weight: 700; line-height: 1.5; white-space: pre-line; }
.fc-word-rv { text-align: center; }
.fc-word-rv .fc-word { font-size: clamp(26px, 6.5vw, 38px); }
.fc-word-rv .fc-reading { font-size: clamp(15px, 4vw, 19px); }
.fc-sent { background: var(--card2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 15px; font-size: 14px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.fc-sent .s-row { display: flex; align-items: flex-start; gap: 8px; }
.fc-sent .s-row + .s-row { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.fc-sent .s-txt { flex: 1; }
.fc-sent .s-cn { color: var(--sub); font-size: 13px; }
.fc-sent .s-txt b { color: var(--accent); }
.fc-sent .spk { flex: none; width: 27px; height: 27px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); display: grid; place-items: center; font-size: 13px; color: var(--sub); }
.fc-back .speak-row { display: flex; justify-content: center; }

.judge-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 16px; }
.judge-btns.four { grid-template-columns: 1fr 1fr 1fr 1fr; }
.jbtn {
  padding: 14px 6px; border-radius: 18px; font-size: 15px; font-weight: 700;
  border: 1px solid var(--border); background: var(--card2); color: var(--text);
  transition: transform .13s, filter .13s;
}
.jbtn small { display: block; font-size: 10.5px; font-weight: 500; color: var(--sub); margin-top: 1px; }
.jbtn:active { transform: scale(.94); }
.jbtn.again { background: var(--red-weak); color: var(--red); border-color: transparent; }
.jbtn.hard { background: var(--amber-weak); color: var(--amber); border-color: transparent; }
.jbtn.good { background: var(--green-weak); color: var(--green); border-color: transparent; }
.jbtn.easy { background: var(--accent-weak); color: var(--accent); border-color: transparent; }

.reveal-btn { margin-top: 16px; }

/* ============ 词表 ============ */
.list-tools { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 200px; position: relative; }
.search-box input {
  width: 100%; padding: 11px 14px 11px 38px; border-radius: 16px; font-size: 14px;
  border: 1px solid var(--border); background: var(--card2); outline: none; transition: border .15s;
}
.search-box input:focus { border-color: var(--accent); }
.search-box::before { content: "🔍"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .55; }
select.pick {
  padding: 10px 13px; border-radius: 14px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--card); outline: none; max-width: 45%;
}
.filter-row { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.f-chip {
  flex: none; padding: 6px 15px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: var(--card); border: 1px solid var(--border); color: var(--sub); transition: all .15s;
}
.f-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.wl-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: 15px;
  margin-bottom: 10px; cursor: pointer; transition: transform .15s, box-shadow .15s; border-radius: 20px;
}
.wl-row:hover { transform: translateX(3px); box-shadow: var(--shadow-sm); }
.wl-main { flex: 1; min-width: 0; }
.wl-word { font-size: 16.5px; font-weight: 700; display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.wl-word .rd { font-size: 13px; color: var(--accent); font-weight: 600; }
.wl-word .ph { font-size: 12.5px; color: var(--sub); font-weight: 500; }
.wl-word .lv-dot { font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 12px; }
.lv-new { background: var(--bg2); color: var(--sub); }
.lv-lrn { background: var(--amber-weak); color: var(--amber); }
.lv-rev { background: var(--accent-weak); color: var(--accent); }
.lv-done { background: var(--green-weak); color: var(--green); }
.wl-mean { font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.wl-star { flex: none; font-size: 17px; opacity: .4; padding: 6px; }
.wl-star.on { opacity: 1; }
.load-more { display: block; margin: 16px auto; }

/* ============ 统计 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { padding: 16px 18px; }
.stat-card .num { font-size: 27px; font-weight: 800; letter-spacing: .5px; }
.stat-card .num small { font-size: 13px; font-weight: 600; color: var(--sub); margin-left: 3px; }
.stat-card .lbl { font-size: 12.5px; color: var(--sub); margin-top: 2px; }
.stat-card .em { float: right; font-size: 20px; }

.panel { padding: 18px 20px; margin-bottom: 14px; }
.panel h3 { font-size: 15.5px; margin-bottom: 13px; }
.chart { display: flex; align-items: flex-end; gap: 9px; height: 130px; padding-top: 6px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bars { display: flex; flex-direction: column-reverse; gap: 2px; width: 100%; max-width: 34px; }
.chart .b { border-radius: 5px; min-height: 2px; }
.chart .b.new { background: linear-gradient(180deg, var(--accent), #8f7bff); }
.chart .b.rev { background: color-mix(in srgb, var(--accent) 38%, transparent); }
.chart .x { font-size: 11px; color: var(--sub); }
.chart .v { font-size: 11px; color: var(--sub); }
.chart-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 12px; color: var(--sub); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.bp-row { margin-bottom: 15px; }
.bp-row:last-child { margin-bottom: 0; }
.bp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-size: 13.5px; }
.bp-head b { font-weight: 700; }
.bp-head .pct { color: var(--sub); font-size: 12.5px; }
.bar.stack { display: flex; height: 8px; gap: 2px; }
.bar.stack i { border-radius: 4px; min-width: 2px; }
.bar.stack .i-lrn { background: var(--amber); }
.bar.stack .i-rev { background: var(--accent); }
.bar.stack .i-done { background: var(--green); }

/* ============ 设置 ============ */
.set-group { margin-bottom: 18px; }
.set-group h4 { font-size: 12.5px; color: var(--sub); font-weight: 700; letter-spacing: 1px; margin: 0 4px 9px; text-transform: uppercase; }
.set-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; margin-bottom: 10px; }
.set-item .info { flex: 1; min-width: 0; }
.set-item .info .t { font-size: 14.5px; font-weight: 600; }
.set-item .info .d { font-size: 12px; color: var(--sub); margin-top: 1px; }
.set-item select { padding: 7px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--card2); font-size: 13.5px; font-weight: 600; outline: none; }
.switch { position: relative; width: 48px; height: 27px; border-radius: 20px; background: var(--bg2); border: 1px solid var(--border); transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2.5px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: left .2s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { left: 23px; }
.about-note { font-size: 12.5px; color: var(--sub); line-height: 1.8; padding: 2px 6px; }
.about-note a { color: var(--accent); text-decoration: none; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 90; background: rgba(18, 22, 40, .38);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  display: grid; place-items: center; padding: 20px; animation: fadeIn .2s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 480px; max-height: 84vh; overflow-y: auto;
  background: var(--card);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: 26px; padding: 26px;
  box-shadow: var(--glass-edge), 0 24px 70px rgba(0, 0, 0, .35); animation: popIn .25s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(12px); } }
.modal h3 { font-size: 18px; margin-bottom: 12px; }
.modal .close-x { float: right; font-size: 17px; color: var(--sub); width: 34px; height: 34px; border-radius: 12px; background: var(--card2); }
.detail-word { font-size: 34px; font-weight: 800; }
.detail-reading { font-size: 17px; color: var(--accent); font-weight: 600; margin-top: 2px; }
.detail-mean { font-size: 16.5px; font-weight: 600; line-height: 1.65; margin: 12px 0; white-space: pre-line; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }

/* ============ Anki 导入表单 ============ */
.anki-form { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; margin-top: 12px; }
.anki-form label { font-size: 13px; color: var(--sub); font-weight: 600; }
.anki-form input, .anki-form select {
  padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card2); font-size: 13.5px; outline: none; min-width: 0;
}
.anki-form input:focus, .anki-form select:focus { border-color: var(--accent); }

/* ============ Toast ============ */
#toastRoot { position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 120; pointer-events: none; }
.toast {
  padding: 10px 20px; border-radius: 30px; font-size: 13.5px; font-weight: 600;
  background: color-mix(in srgb, var(--text) 86%, transparent); color: var(--bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: toastIn .25s ease; max-width: 86%;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.92); } }
.toast.out { transition: opacity .3s, transform .3s; opacity: 0; transform: translateY(8px); }

/* ============ 响应式 ============ */
@media (max-width: 720px) {
  .nav-top { display: none; }
  .brand-sub { display: none; }
  #topbar { margin: 10px 12px 0; padding: 9px 16px; }
  #view { padding: 14px 14px calc(74px + env(safe-area-inset-bottom)); }
  .nav-bottom {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    height: calc(62px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--card) 80%, transparent);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border);
    box-shadow: 0 -1px 0 rgba(255, 255, 255, .18) inset;
    display: flex; align-items: stretch;
  }
  .nav-bottom a {
    flex: 1; flex-direction: column; justify-content: center; gap: 3px;
    padding: 6px 0; border-radius: 0; font-size: 10.5px;
  }
  .nav-bottom a svg { width: 21px; height: 21px; }
  .nav-bottom a.active { background: none; }
  .fc-inner { min-height: 0; }
  .judge-btns { gap: 7px; }
  .jbtn { padding: 12px 4px; font-size: 13.5px; border-radius: 12px; }
  .book-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .book-cover { height: 74px; padding: 11px 13px; }
  .book-body { padding: 12px 14px 14px; }
  .book-body .desc { display: none; }
  .page-head h1 { font-size: 20px; }
}
@media (max-width: 380px) { .book-grid { grid-template-columns: 1fr; } }
