/* ===== 词匣 · 应用样式 ===== */
:root {
  --bg: #f2f1ec;
  --card: #ffffff;
  --ink: #212633;
  --ink-2: #5b6373;
  --ink-3: #9aa1b0;
  --line: #e6e4dc;
  --accent: #2b5bbd;
  --accent-2: #7a4de0;
  --accent-soft: #e9eefb;
  --on-accent: #ffffff;
  --pos-c: #c05621;      /* 词性 */
  --ipa-c: #0e7c86;      /* 音标 */
  --en-c: #26418f;       /* 例句英文 */
  --zh-c: #6b7280;       /* 例句中文 */
  --syn-c: #7c5cbf;      /* 同义词 */
  --danger: #c0392b;
  --ok: #2e8b57;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(30, 35, 50, .07);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191f;
    --card: #21242d;
    --ink: #e8eaf0;
    --ink-2: #a7aeba;
    --ink-3: #6b7280;
    --line: #32363f;
    --accent: #5b8af0;
    --accent-2: #9a7af0;
    --accent-soft: #2a3050;
    --pos-c: #e8935a;
    --ipa-c: #4fc3c9;
    --en-c: #9ab4f0;
    --zh-c: #98a0ad;
    --syn-c: #b9a1ec;
    --danger: #e07060;
    --ok: #5cc08a;
    --shadow: 0 1px 3px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column;
  max-width: 720px; margin: 0 auto;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }

/* ===== 顶栏 ===== */
#topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
#brand-home { cursor: pointer; }
.back-btn {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  color: var(--accent); background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
}
.back-btn svg { width: 16px; height: 16px; display: block; }
.back-btn:active { transform: scale(.9); }
.brand-logo { font-size: 20px; font-weight: 800; letter-spacing: 2px; }
.brand-sub { font-size: 11px; opacity: .85; }
.top-actions { display: flex; gap: 4px; }
.icon-btn { font-size: 17px; padding: 6px 9px; border-radius: 10px; opacity: .9; }
.icon-btn:active { background: rgba(255,255,255,.18); }

/* ===== 视图 ===== */
#views { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 14px 24px; }
.view { display: none; animation: fadein .18s ease; }
.view.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===== 搜索 ===== */
.search-wrap { position: relative; z-index: 30; }
.searchbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 0 12px; height: 46px;
  box-shadow: var(--shadow);
}
.searchbar:focus-within { border-color: var(--accent); }
.search-ico { font-size: 15px; opacity: .6; }
#search-input {
  flex: 1; border: none; outline: none; background: none;
  font-size: 16.5px; color: var(--ink); min-width: 0;
}
#search-input::placeholder { color: var(--ink-3); }
.clear-btn { font-size: 13px; color: var(--ink-3); padding: 6px; }

.suggest {
  position: absolute; left: 0; right: 0; top: 52px;
  list-style: none; margin: 0; padding: 6px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 8px 28px rgba(20,25,40,.14);
  max-height: 46vh; overflow-y: auto; z-index: 50;
}
.suggest li {
  padding: 11px 12px; border-radius: 9px; font-size: 15.5px;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.suggest li mark { background: none; color: var(--accent); font-weight: 800; }
.suggest li .src { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.suggest li:active, .suggest li.sel { background: var(--accent-soft); }

/* 搜索历史 */
.suggest li.his-head { padding: 7px 12px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.suggest li.his-head:active { background: none; }
.his-clear { font-size: 12px; color: var(--ink-3); padding: 2px 8px; border-radius: 8px; }
.his-clear:active { color: var(--danger); background: var(--wrong-soft); }
.his-word { font-size: 15.5px; }
.his-del {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  color: var(--ink-3); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.his-del:active { color: var(--danger); background: var(--wrong-soft); }

/* ===== 空态 ===== */
.empty-hint { text-align: center; padding: 46px 20px 30px; color: var(--ink-2); }
.empty-hint.small { padding: 30px 20px; }
.empty-logo {
  width: 76px; height: 76px; margin: 0 auto 16px;
  border-radius: 22px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent-btn); font-size: 30px; font-weight: 800; letter-spacing: 2px;
}
.empty-hint p { margin: 0; line-height: 1.7; font-size: 15px; }
.empty-hint p span { font-size: 12.5px; color: var(--ink-3); }
.hot-words { margin-top: 20px; font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.hot-words button {
  padding: 6px 14px; border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); font-size: 13.5px; color: var(--accent);
}

/* ===== 卡片 ===== */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.snapshot { margin-top: 16px; }

/* ===== 五栏速览卡 ===== */
.snap-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.snap-word-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.speak-btn {
  font-size: 15px; align-self: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); flex: none;
}
.snap-word { margin: 0; font-size: 27px; font-weight: 800; word-break: break-all; }
/* 考纲层级徽标：中考（绿）/ 高考（橙金）/ 超纲（灰） */
.exam-badge {
  display: inline-block; flex: none; align-self: center; vertical-align: middle;
  font-size: 10.5px; font-weight: 800; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.exam-badge[hidden] { display: none; }
.exam-badge.zk { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok-mid); }
.exam-badge.gk { background: #fdf0d8; color: #8a6116; border-color: #eccf92; }
.exam-badge.out { background: var(--bg); color: var(--ink-3); border-color: var(--line); }
/* 掌握度徽标：已掌握（绿）/ 学习中（暖棕）/ 薄弱（红） */
.mastery-badge {
  display: inline-block; flex: none; align-self: center; vertical-align: middle;
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
  padding: 1px 7px; border-radius: 999px; white-space: nowrap; margin-left: 6px;
}
.mastery-badge.mastered { background: var(--ok-soft); color: var(--ok-ink); }
.mastery-badge.learning { background: #f3ead4; color: #8c6c5e; }
.mastery-badge.weak { background: #fde8e6; color: #c0392b; }
:root[data-theme="dark"] .mastery-badge.learning { background: #3a3020; color: #d9b98a; }
:root[data-theme="dark"] .mastery-badge.weak { background: #3a2220; color: #f0a39b; }
/* 深色模式：高考徽标换深底暖金字 */
:root[data-theme="dark"] .exam-badge.gk { background: #3a3020; color: #f0c96b; border-color: #5c4a28; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .exam-badge.gk { background: #3a3020; color: #f0c96b; border-color: #5c4a28; }
}
.snap-ipa {
  font-size: 15.5px; color: var(--ipa-c);
  font-family: "Times New Roman", "Segoe UI", "Lucida Grande", serif;
}
.snap-body { margin-top: 10px; font-size: 14.5px; line-height: 1.75; }
.snap-ipas { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
/* 星星收藏：未收藏描边灰，收藏实心金黄 */
.star-btn {
  width: 40px; height: 40px; border-radius: 50%; flex: none; align-self: center;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); transition: transform .12s;
}
.star-btn:active { background: var(--accent-soft); transform: scale(.88); }
.star-btn svg {
  width: 27px; height: 27px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round;
  transition: fill .15s, stroke .15s;
}
.star-btn.on { color: #f0a90a; }
.star-btn.on svg { fill: #ffc02e; stroke: #ffc02e; }
.ipa-item { display: flex; align-items: center; gap: 7px; }
.ipa-item .ipa-tag {
  font-size: 10px; font-weight: 800; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; letter-spacing: .5px;
}
.ipa-item .play-btn {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.ipa-item .play-btn svg { width: 17px; height: 17px; display: block; }
.ipa-item .play-btn:active { background: var(--accent); color: var(--on-accent-btn); }
.ipa-item .ipa-text {
  font-size: 17px; color: var(--ipa-c);
  font-family: "Times New Roman", "Segoe UI", "Lucida Grande", serif;
}
.snap-body .sec { margin-top: 9px; }
.snap-body .sec:first-child { margin-top: 0; }
.sec-label {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; margin-right: 8px;
  vertical-align: 1px;
}
.defs .pos { color: var(--pos-c); font-weight: 700; font-style: italic; margin-right: 4px; }
.defs .en { color: var(--ink-2); }
.defs .zh { color: var(--ink); }
.ex .en { color: var(--en-c); }
.ex .zh { color: var(--zh-c); font-size: 13px; }
.collo .g-name { color: var(--pos-c); font-weight: 700; font-size: 12px; margin-right: 6px; }
.collo .g-items { color: var(--ink-2); }
.syn .w { color: var(--syn-c); }
.snap-sources { margin-top: 12px; padding-top: 9px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--ink-3); }

/* ===== 词典标签页 ===== */
#entry-area { margin-top: 14px; }
.dict-tabs {
  display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 10px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.dict-tabs::-webkit-scrollbar { display: none; }
.dict-tabs button {
  flex: none; padding: 7px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2); white-space: nowrap;
}
.dict-tabs button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent-btn); font-weight: 600; }
.dict-tabs button b { font-weight: 800; }

.entry-card { padding: 8px 10px; min-height: 120px; }
.entry-loading { padding: 30px; text-align: center; color: var(--ink-3); font-size: 14px; }
.entry-empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 14px; }
/* 查词聚合视图（「全部」标签）：每部词典一个带标题的分段 */
.entry-dict-head {
  margin: 12px 0 2px; padding: 6px 10px 5px; border-radius: 8px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .5px;
  color: var(--accent); background: var(--accent-soft);
}
.entry-dict-head:first-child { margin-top: 0; }
.entry-dict-body { padding-top: 6px; }
.entry-dict-body + .entry-dict-head { border-top: 1px dashed var(--line); }

/* 词条正文（词典 HTML 注入后的排版） */
.entry-body { font-size: 15px; line-height: 1.65; word-break: break-word; }
/* 长按选择复制：词条正文/速览卡可选中复制；UI 控件禁用选中避免误触 */
.entry-body, .entry-dict-body, .entry-dict-head, .snapshot-card, .snap-word, .snap-ipas, .ipa-text {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}
button, .tab, .icon-btn, .dict-tabs, .seg, .ghost-btn, .primary-btn, .suggest, .hot-words {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.entry-body a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px dotted rgba(43, 91, 189, .35); /* 浅色虚线：标识可跳查 */
}
/* 牛津搭配黑体搭配词：可点查但保持黑体原样（无变色、无虚线） */
.entry-body a.ocollo-w { color: inherit; border-bottom: none; }
.entry-body img { max-width: 100%; height: auto; }
.entry-body table { max-width: 100%; border-collapse: collapse; }
.entry-body .dict-src-tag { display:none; }

/* ===== 底部导航 ===== */
#tabbar {
  position: sticky; bottom: 0; z-index: 40;
  display: flex; background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 6px; font-size: 10.5px; color: var(--ink-3);
}
.tab i { font-style: normal; font-size: 19px; line-height: 1.15; }
.tab.active { color: var(--accent); font-weight: 700; }
.tab .dot {
  position: absolute; margin-left: 26px; margin-top: -2px;
  min-width: 8px; height: 8px; border-radius: 999px; background: var(--danger);
}

/* ===== 生词本 ===== */
.wb-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.group-chips { display: flex; gap: 7px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.group-chips::-webkit-scrollbar { display: none; }
.group-chips button {
  flex: none; padding: 7px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}
.group-chips button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent-btn); }
/* 分组管理按钮（汉堡细线） */
.mgr-btn {
  flex: none; width: 38px; height: 38px; border-radius: 11px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.mgr-btn svg { width: 19px; height: 19px; display: block; }
.mgr-btn:active { background: var(--accent-soft); color: var(--accent); }

/* 生词本搜索 + 排序 */
.wb-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.wb-search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 0 12px; height: 38px; min-width: 0;
}
.wb-search:focus-within { border-color: var(--accent); }
.wb-search-ico { width: 16px; height: 16px; color: var(--ink-3); flex: none; }
#wb-search { flex: 1; border: none; outline: none; background: none; font-size: 14px; color: var(--ink); min-width: 0; }
#wb-search::placeholder { color: var(--ink-3); }
.wb-search-clear { font-size: 13px; color: var(--ink-3); padding: 4px; flex: none; }
.wb-sort {
  flex: none; height: 38px; padding: 0 12px; border-radius: 12px;
  background: var(--card); border: 1.5px solid var(--line); color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px;
}
.wb-sort svg { width: 15px; height: 15px; display: block; }
.wb-sort:active { background: var(--accent-soft); color: var(--accent); }
.wb-sort.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.wb-list-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-bottom: 4px; font-size: 13px; color: var(--ink-3);
}
.wb-head-btns { display: flex; gap: 8px; align-items: center; }
.primary-btn {
  background: var(--accent); color: var(--on-accent-btn); font-weight: 600;
  padding: 9px 16px; border-radius: 10px; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.primary-btn svg { width: 15px; height: 15px; display: block; }
.primary-btn:disabled { opacity: .45; }
.ghost-btn {
  border: 1px solid var(--line); background: var(--card);
  padding: 8px 14px; border-radius: 10px; font-size: 13.5px; color: var(--ink-2);
}
.ghost-btn.danger { color: var(--danger); }
.ghost-btn.wide { width: 100%; padding: 12px; }
.ghost-btn:disabled { opacity: .5; }
#btn-select.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.wb-list { list-style: none; margin: 0; padding: 0; }
/* 日期分组头：胶囊日期 + 词数 + 延伸细线 */
.wb-date-head {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 2px 9px;
}
.wb-date-head:first-child { margin-top: 6px; }
.wb-date-head .dt {
  font-size: 12px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 3px 11px; border-radius: 999px; flex: none;
}
.wb-date-head .n { font-size: 11px; color: var(--ink-3); flex: none; }
.wb-date-head::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.wb-list .wb-item + .wb-item { margin-top: 9px; }
.wb-item {
  background: var(--card); border-radius: 13px; box-shadow: var(--shadow);
  padding: 12px 12px 12px 14px; display: flex; align-items: center; gap: 10px;
  transition: box-shadow .12s;
}
.wb-item .w-info { flex: 1; min-width: 0; }
.wb-item .w-word { font-size: 16.5px; font-weight: 700; word-break: break-all; }
.wb-item .w-word .ipa {
  font-size: 12.5px; color: var(--ipa-c); font-weight: 400; margin-left: 7px;
  font-family: "Times New Roman", "Segoe UI", "Lucida Grande", serif;
}
.wb-item .w-def { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-item .w-def .pos { color: var(--pos-c); font-style: italic; }
.wb-item .ops { display: flex; gap: 2px; flex: none; }
.wb-item .ops button {
  width: 34px; height: 34px; border-radius: 9px; padding: 0;
  display: flex; align-items: center; justify-content: center; color: var(--ink-3);
}
.wb-item .ops button svg { width: 17px; height: 17px; display: block; }
.wb-item .ops button:active { background: var(--accent-soft); color: var(--accent); }
.wb-item .ops button[data-act="del"]:active { background: var(--danger-soft); color: var(--danger); }

/* 多选模式：圆形勾选框 */
.wb-check {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2px solid var(--line); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.wb-item.checked .wb-check { background: var(--accent); border-color: var(--accent); }
.wb-item.checked .wb-check::after {
  content: ''; width: 10px; height: 5.5px;
  border-left: 2.2px solid var(--on-accent-btn); border-bottom: 2.2px solid var(--on-accent-btn);
  transform: rotate(-45deg) translateY(-1px);
}
.wb-item.checked { box-shadow: 0 0 0 1.6px var(--accent), var(--shadow); }
.wb-item.checked .w-info { opacity: .92; }

/* 多选底部操作栏（悬浮于 tabbar 上方） */
#sel-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(62px + var(--safe-b) + 10px);
  z-index: 80; width: min(94vw, 668px);
  background: var(--card); border-radius: 16px;
  box-shadow: 0 10px 34px rgba(20, 25, 40, .24);
  display: flex; align-items: center; gap: 2px;
  padding: 8px 10px;
}
#sel-bar[hidden] { display: none; }
#sel-bar .sb-btn {
  padding: 9px 11px; border-radius: 10px; font-size: 13px; color: var(--ink-2); flex: none;
}
#sel-bar .sb-btn:active { background: var(--accent-soft); }
#sel-bar .sb-btn:disabled { opacity: .4; }
#sel-bar .sb-btn.primary { background: var(--accent); color: var(--on-accent-btn); font-weight: 600; }
#sel-bar .sb-btn.primary:disabled { background: var(--accent); }
#sel-bar .sb-btn.danger { color: var(--danger); }
#sel-count { flex: 1; text-align: center; font-size: 13px; font-weight: 700; color: var(--accent); }

/* ===== 底部弹层（分组管理 / 移动分组） ===== */
#group-layer, #move-layer, #stats-layer { position: fixed; inset: 0; z-index: 120; }
#group-layer[hidden], #move-layer[hidden], #stats-layer[hidden] { display: none; }
.gl-mask { position: absolute; inset: 0; background: rgba(15, 18, 26, .45); }
.gl-panel {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 0; width: min(100vw, 720px);
  border-radius: 22px 22px 0 0;
  padding: 6px 18px calc(20px + var(--safe-b));
  max-height: 74vh; overflow-y: auto;
  animation: sheet-up .22s ease;
}
@keyframes sheet-up { from { transform: translate(-50%, 48px); opacity: .35; } to { transform: translate(-50%, 0); opacity: 1; } }
.gl-head {
  position: sticky; top: 0; background: var(--card);
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0 10px; margin-bottom: 2px;
}
.gl-head h3 { margin: 0; font-size: 16.5px; }
.gl-close {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--ink-3);
}
.gl-close svg { width: 16px; height: 16px; display: block; }
.gl-close:active { background: var(--accent-soft); }
#gl-list, #mv-list { list-style: none; margin: 0; padding: 0; }

/* 分组管理行 */
.gm-row {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 2px; border-bottom: 1px solid var(--line);
}
.gm-row:last-child { border-bottom: none; }
.gm-row .g-name { flex: 1; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-row .lock-tag {
  font-style: normal; font-size: 10px; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; margin-left: 7px; vertical-align: 1px;
}
.gm-row .g-cnt { font-size: 12px; color: var(--ink-3); flex: none; }
.gm-row button {
  width: 34px; height: 34px; border-radius: 9px; flex: none; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.gm-row button svg { width: 17px; height: 17px; display: block; }
.gm-row button:active { background: var(--accent-soft); color: var(--accent); }
.gm-row button[data-act="del"]:active { background: var(--danger-soft); color: var(--danger); }
.gm-row.locked button { opacity: .22; pointer-events: none; }
.gl-new { display: flex; gap: 8px; margin-top: 14px; }
.gl-new input {
  flex: 1; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 14px;
  background: var(--bg); color: var(--ink); outline: none; min-width: 0;
}
.gl-new input:focus { border-color: var(--accent); }
.gl-tip { margin: 12px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }

/* ===== 学习统计弹层 ===== */
.stats-grid { display: flex; gap: 10px; margin-top: 4px; }
.stats-box {
  flex: 1; text-align: center; padding: 12px 6px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--line);
}
.stats-box b { display: block; font-size: 22px; font-weight: 800; color: var(--ink); }
.stats-box span { display: block; margin-top: 3px; font-size: 11px; color: var(--ink-2); }
.stats-sec { margin: 16px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.stats-mastery { display: flex; gap: 8px; }
.m-chip { flex: 1; text-align: center; font-size: 12px; padding: 7px 4px; border-radius: 12px; }
.m-chip b { font-size: 16px; margin-left: 3px; }
.m-chip.mastered { background: var(--ok-soft); color: var(--ok-ink); }
.m-chip.learning { background: #f3ead4; color: #8c6c5e; }
.m-chip.weak { background: #fde8e6; color: #c0392b; }
:root[data-theme="dark"] .m-chip.learning { background: #3a3020; color: #d9b98a; }
:root[data-theme="dark"] .m-chip.weak { background: #3a2220; color: #f0a39b; }
.stats-heat { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; padding: 4px 2px; }
.ht-row { display: flex; gap: 3px; }
.ht-cell { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.ht-cell.off { visibility: hidden; }
.ht-cell.l0 { background: var(--line); }
.ht-cell.l1 { background: #cfe4c4; }
.ht-cell.l2 { background: #79b851; }
.ht-cell.l3 { background: #3f7d33; }

/* 移动分组行 */
.mv-row {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 4px; border-bottom: 1px solid var(--line); font-size: 15px;
}
.mv-row:last-child { border-bottom: none; }
.mv-row .g-cnt { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.mv-row:active { background: var(--accent-soft); }

/* ===== 词库管理 ===== */
.storage-bar { margin-bottom: 14px; font-size: 13px; }
.storage-row { display: flex; justify-content: space-between; color: var(--ink-2); }
.storage-row b { color: var(--ink); }
.storage-track { height: 7px; border-radius: 99px; background: var(--line); margin: 9px 0; overflow: hidden; }
.storage-fill { height: 100%; width: 0%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.storage-tip { margin: 0; font-size: 11.5px; color: var(--ink-3); }

.dict-list { display: flex; flex-direction: column; gap: 10px; }
.dict-card.hidden-dict { opacity: .48; }
.dict-card .d-ops { display: flex; align-items: center; gap: 8px; }
.move-btns { display: flex; flex-direction: column; gap: 2px; }
.move-btns button {
  font-size: 10px; line-height: 1; padding: 5px 8px; border-radius: 7px;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--card);
}
.move-btns button:disabled { opacity: .3; }
/* 显示/隐藏开关 */
.toggle { position: relative; width: 46px; height: 26px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; z-index: 2; }
.toggle .tk {
  position: absolute; inset: 0; border-radius: 99px; background: var(--line);
  transition: background .18s;
}
.toggle .tk::after {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s;
}
.toggle input:checked + .tk { background: var(--accent); }
.toggle input:checked + .tk::after { transform: translateX(20px); }
.d-progress { height: 5px; border-radius: 99px; background: var(--line); margin-top: 7px; overflow: hidden; display: none; }
.d-progress.show { display: block; }
.d-progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.d-status { font-size: 11.5px; color: var(--ok); margin-top: 5px; display: none; }
.d-status.show { display: block; }
.dict-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }

/* ===== 初始化进度层 / file:// 引导层 ===== */
#setup-layer, #file-layer {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
#setup-layer[hidden], #file-layer[hidden] { display: none; }
.setup-box { width: 100%; max-width: 360px; text-align: center; padding: 30px 26px; }
.setup-logo {
  width: 72px; height: 72px; margin: 0 auto 16px;
  border-radius: 20px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent-btn); font-size: 26px; font-weight: 800; letter-spacing: 1px;
}
.setup-box h2 { margin: 0 0 6px; font-size: 18px; }
.setup-sub { margin: 0 0 14px; font-size: 13px; color: var(--ink-2); min-height: 19px; }
.setup-track { height: 9px; border-radius: 99px; background: var(--line); overflow: hidden; }
.setup-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .25s; }
.setup-pct { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); }
.setup-note { margin: 14px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.7; }
/* file:// 引导层：启动器完整路径 */
.file-path {
  margin: 12px 0 0; padding: 10px 12px;
  background: var(--bg); border: 1px dashed var(--accent); border-radius: 10px;
  font-size: 12px; color: var(--accent); font-weight: 700;
  word-break: break-all; line-height: 1.6; text-align: left;
}
.dict-card {
  background: var(--card); border-radius: 13px; box-shadow: var(--shadow);
  padding: 13px 15px; display: flex; align-items: center; gap: 12px;
}
.dict-card .d-badge {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff; letter-spacing: .5px;
}
.dict-card .d-info { flex: 1; min-width: 0; }
.dict-card .d-name { font-size: 15px; font-weight: 700; }
.dict-card .d-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.dict-card .d-roles { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.dict-card .d-roles span {
  font-size: 10px; padding: 1px 7px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent);
}
.dict-card .d-ops { flex: none; }
.dict-card .d-ops button {
  padding: 8px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
  background: var(--accent); color: var(--on-accent-btn);
}
.dict-card .d-ops button.rm { background: none; color: var(--danger); border: 1px solid var(--line); }
.dict-card .d-ops button:disabled { opacity: .5; }
.d-progress { height: 5px; border-radius: 99px; background: var(--line); margin-top: 7px; overflow: hidden; display: none; }
.d-progress.show { display: block; }
.d-progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.d-status { font-size: 11.5px; color: var(--ok); margin-top: 5px; display: none; }
.d-status.show { display: block; }
.dict-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }

/* ===== 设置 ===== */
.sec-title { font-size: 13px; color: var(--ink-3); margin: 18px 4px 8px; font-weight: 700; }
.setting-card { display: flex; flex-direction: column; gap: 2px; }
.setting-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 2px; font-size: 14.5px;
}
.setting-row select {
  font: inherit; max-width: 58%; background: var(--bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px;
}
.setting-row input[type="range"] { width: 58%; accent-color: var(--accent); }
.theme-seg { flex: none; width: 220px; }
.setting-tip { margin: 2px 2px 10px; font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.btn-row { justify-content: flex-end; }
/* 发音引擎状态行 */
.engine-status { padding: 9px 2px 3px; font-size: 12.5px; line-height: 1.55; }
.engine-status span { color: var(--danger); }
.engine-status .ok-text { color: var(--ok); }
.about p { margin: 4px 0; font-size: 14px; }
.about .dim { color: var(--ink-3); font-size: 12.5px; }

/* ===== Toast ===== */
#toast {
  position: fixed; left: 50%; bottom: calc(84px + var(--safe-b));
  transform: translateX(-50%); z-index: 99;
  background: rgba(28, 32, 44, .93); color: #fff;
  padding: 10px 18px; border-radius: 11px; font-size: 13.5px;
  max-width: 82vw; text-align: center; line-height: 1.5;
  animation: toast-in .22s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== 响应式 ===== */
@media (min-width: 720px) {
  body { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ===== 收藏分组选择小选框 ===== */
#star-pick { position: fixed; inset: 0; z-index: 170; }
.stp-mask { position: absolute; inset: 0; background: rgba(36, 50, 94, .42); }
.stp-sheet {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100vw, 720px);
  background: var(--card); border-radius: 20px 20px 0 0;
  padding: 14px 18px calc(16px + var(--safe-b));
  animation: stp-up .22s ease;
}
@keyframes stp-up { from { transform: translate(-50%, 60%); opacity: .4; } to { transform: translate(-50%, 0); opacity: 1; } }
.stp-sheet h4 { margin: 0; font-size: 15px; font-weight: 800; color: var(--accent); }
.stp-word {
  margin-top: 6px; font-family: Georgia, "Times New Roman", serif;
  font-size: 22px; font-weight: 800; color: var(--ink);
}
.stp-groups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; max-height: 32vh; overflow-y: auto; }
.stp-groups button {
  padding: 8px 16px; border-radius: 999px;
  background: var(--bg); border: 1.5px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
}
.stp-groups button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent-btn); }
.stp-btns { display: flex; gap: 10px; margin-top: 16px; }
.stp-btn { flex: 1; padding: 12px 0; border-radius: 999px; font-size: 14.5px; font-weight: 800; }
.stp-cancel { background: var(--bg); border: 1.5px solid var(--line); color: var(--ink-2); }
.stp-ok { background: var(--accent); border: none; color: var(--on-accent-btn); }
.stp-btn:active { transform: scale(.97); }

/* =================================================================
   生词本改版（v57）：自绘头部 / 暖色卡片 / 眼罩 / 排序菜单 / 底部详情弹层
   ================================================================= */
/* 进入生词本时隐藏全局顶栏，由生词本自绘头部接管 */
body.wb-active #topbar { display: none; }
body.wb-active #views { padding-top: calc(var(--safe-t) + 10px); }

#view-wordbook {
  --wb-word: #8c5a2b; --wb-border: #e6d3a8; --wb-card: #fffdf7;
  --wb-gold: #c97a1a; --wb-gold-soft: #fdf0d8; --wb-muted: #a08b74;
}
:root[data-theme="dark"] #view-wordbook {
  --wb-word: #e6c9a3; --wb-border: #3b3529; --wb-card: #232838;
  --wb-gold: #e0b060; --wb-gold-soft: #3a3226; --wb-muted: #9a8f7e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #view-wordbook {
    --wb-word: #e6c9a3; --wb-border: #3b3529; --wb-card: #232838;
    --wb-gold: #e0b060; --wb-gold-soft: #3a3226; --wb-muted: #9a8f7e;
  }
}

/* 头部 */
.wb-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 4px 2px 14px; }
.wb-back {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--wb-word); background: var(--card); border: 1.5px solid var(--wb-border);
}
.wb-back svg { width: 20px; height: 20px; }
.wb-back:active { background: var(--accent-soft); }
.wb-title {
  flex: 1; margin: 0; font-size: 19px; font-weight: 800; letter-spacing: 1px;
  color: var(--wb-word); text-align: center;
}
.wb-head-actions { display: flex; gap: 8px; }
.wb-icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--wb-word); background: var(--card); border: 1.5px solid var(--wb-border);
}
.wb-icon svg { width: 20px; height: 20px; }
.wb-icon:active { background: var(--accent-soft); }
.wb-icon.sm { width: 34px; height: 34px; border-radius: 10px; }
.wb-icon.sm svg { width: 18px; height: 18px; }
/* 眼罩：默认睁眼，隐藏释义时显示闭眼 */
.wb-icon .eye-off { display: none; }
#view-wordbook.hide-def #wb-eye .eye-on { display: none; }
#view-wordbook.hide-def #wb-eye .eye-off { display: block; }

/* 计数行 */
.wb-meta { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px; }
.wb-count { font-size: 13px; font-weight: 600; color: var(--wb-muted); }

/* 排序下拉 */
.wb-sort-menu {
  position: absolute; right: 6px; top: 52px; z-index: 60; width: 176px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 34px rgba(20,24,34,.18); padding: 6px; overflow: hidden;
}
.wb-sort-menu[hidden] { display: none; }
.wb-sort-menu button {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 9px; font-size: 14px; color: var(--ink);
}
.wb-sort-menu button i {
  font-style: normal; font-size: 13px; font-weight: 800; color: var(--wb-gold);
  width: 20px; text-align: center; flex: none;
}
.wb-sort-menu button:active { background: var(--wb-gold-soft); }
.wb-sort-menu button.on { background: var(--wb-gold-soft); font-weight: 700; color: var(--wb-word); }

/* 搜索行（工具菜单打开） */
.wb-search-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  background: var(--card); border: 1.5px solid var(--wb-border);
  border-radius: 12px; padding: 0 12px; height: 40px;
}
.wb-search-row[hidden] { display: none; }

/* 分组 chips：仅存在自定义分组时显示 */
#view-wordbook .group-chips { margin-bottom: 10px; }
#view-wordbook .group-chips[hidden] { display: none; }

/* 卡片 */
.wb-date-head { display: flex; align-items: center; gap: 8px; margin: 16px 2px 8px; }
.wb-date-head:first-child { margin-top: 2px; }
.wb-date-head .dt { font-size: 12.5px; font-weight: 600; color: var(--wb-muted); background: none; padding: 0; }
.wb-date-head .n { display: none; }
.wb-date-head::after { display: none; }
#view-wordbook .wb-list { padding-bottom: 100px; }
#view-wordbook .wb-item {
  background: var(--wb-card); border: 1.5px solid var(--wb-border);
  border-radius: 16px; box-shadow: none; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
#view-wordbook .wb-item + .wb-item { margin-top: 10px; }
#view-wordbook .wb-item:active { transform: scale(.99); }
.wb-say {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--wb-gold); background: var(--wb-gold-soft);
}
.wb-say svg { width: 19px; height: 19px; display: block; }
.wb-say:active { transform: scale(.9); }
#view-wordbook .wb-item .w-word { font-size: 17px; font-weight: 800; color: var(--wb-word); }
#view-wordbook .wb-item .w-def { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
#view-wordbook .wb-item .w-def .pos { color: var(--pos-c); }
#view-wordbook.hide-def .wb-item .w-def { display: none; }
#view-wordbook.hide-def .wb-item { padding-top: 18px; padding-bottom: 18px; }

/* 导出词表 FAB */
.wb-fab {
  position: fixed; right: 16px; bottom: calc(76px + var(--safe-b)); z-index: 45;
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--wb-gold-soft); color: var(--wb-gold);
  border: 1.5px solid var(--wb-border);
  box-shadow: 0 8px 22px rgba(201,122,26,.26);
}
.wb-fab svg { width: 20px; height: 20px; }
.wb-fab span { font-size: 9px; font-weight: 700; letter-spacing: .3px; }
.wb-fab:active { transform: scale(.95); }

/* 单词详情底部弹层 */
.wb-sheet { position: fixed; inset: 0; z-index: 130; }
.wb-sheet[hidden] { display: none; }
.wb-sheet-mask { position: absolute; inset: 0; background: rgba(20, 24, 34, .35); }
.wb-sheet-panel {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 0;
  width: min(100vw, 720px); height: 34vh;
  background: var(--wb-card); border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(20,24,34,.16);
  display: flex; flex-direction: column; overflow: hidden;
  padding: 0 16px calc(10px + var(--safe-b));
  transition: height .26s ease;
}
.wb-sheet-panel[data-state="expanded"] { height: 88vh; }
.wb-sheet-grip {
  flex: none; align-self: center; width: 46px; height: 30px; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); border-radius: 0 0 12px 12px;
}
.wb-sheet-grip svg { width: 22px; height: 22px; transition: transform .2s; }
.wb-sheet-panel[data-state="expanded"] .wb-sheet-grip svg { transform: rotate(180deg); }
.wb-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wb-sheet-head h3 { margin: 0; font-size: 24px; font-weight: 800; color: var(--wb-word); word-break: break-word; }
.wb-sheet-star { font-size: 22px; color: var(--star, #e8a33a); line-height: 1; flex: none; }
.wb-sheet-meta { display: flex; align-items: center; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.wb-sheet-say {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--wb-gold-soft); color: var(--wb-gold); font-size: 13px; font-weight: 700;
}
.wb-sheet-say svg { width: 17px; height: 17px; }
.wb-sheet-say b { font-weight: 700; }
.wb-sheet-exam { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--ok-soft); color: var(--ok-ink); }
.wb-sheet-def { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--ink-2); flex: none; }
.wb-sheet-def .pos { color: var(--pos-c); font-style: italic; margin-right: 4px; }
.wb-sheet-body {
  flex: 1; overflow-y: auto; margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed var(--line); display: none;
}
.wb-sheet-panel[data-state="expanded"] .wb-sheet-body { display: block; }
.wb-sheet-panel[data-state="peek"] .wb-sheet-foot { display: none; }
.wb-sheet-body .entry-dict-head { margin-top: 12px; color: var(--wb-gold); background: var(--wb-gold-soft); }
.wb-sheet-body .entry-body a { color: var(--wb-gold); border-bottom-color: rgba(201, 122, 26, .35); }
.wb-sheet-body .entry-body a.ocollo-w { color: inherit; border-bottom: none; }
.wb-sheet-foot { flex: none; padding-top: 8px; }
.wb-sheet-del {
  width: 100%; padding: 11px; border-radius: 12px;
  border: 1.5px solid var(--danger-soft, #f3c9c4); color: var(--danger); font-size: 14px; font-weight: 700;
}
.wb-sheet-del:active { background: var(--danger-soft, #fdecea); }
.wb-sheet-none { padding: 20px 0; text-align: center; color: var(--ink-3); font-size: 14px; }

/* 更多工具弹层 */
.wb-tools-layer { position: fixed; inset: 0; z-index: 125; }
.wb-tools-layer[hidden] { display: none; }
.wb-tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.wb-tool-grid button {
  padding: 15px 10px; border-radius: 14px;
  background: var(--bg); border: 1.5px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.wb-tool-grid button:active { background: var(--accent-soft); color: var(--accent); }

/* ===== 生词本 v58：收藏本首页 / 两级导航 / 头部多选 / 考纲筛选 ===== */
.wb-home[hidden], .wb-book[hidden] { display: none; }

/* 收藏本首页（图8） */
.wb-books { list-style: none; margin: 6px 0 0; padding: 0; }
.wb-book-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--wb-card); border: 1.5px solid var(--wb-border);
  border-radius: 16px; padding: 13px 14px; margin-bottom: 12px;
}
.wb-book-card:active { transform: scale(.995); }
.wb-book-cover {
  width: 54px; height: 66px; border-radius: 10px; flex: none; position: relative;
  background: var(--bk, #f6d9a8);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 800; letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(60, 40, 20, .18);
}
.wb-book-cover::after {
  content: ''; position: absolute; right: 7px; top: 0; width: 8px; height: 13px;
  background: rgba(255, 255, 255, .55);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}
.wb-book-cover::before {
  content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px;
  background: rgba(255, 255, 255, .4); border-radius: 2px;
}
.wb-book-info { flex: 1; min-width: 0; }
.wb-book-name { font-size: 18px; font-weight: 800; color: var(--wb-word); word-break: break-all; }
.wb-book-count { margin-top: 5px; font-size: 13px; color: var(--wb-muted); }
.wb-book-del { flex: none; font-size: 13px; color: var(--wb-muted); padding: 6px 8px; border-radius: 8px; }
.wb-book-del:active { background: var(--wb-gold-soft); color: var(--wb-gold); }
.wb-create {
  width: 100%; margin: 20px 0 0; padding: 15px; border-radius: 14px;
  background: #cfe4a8; border: 1.5px solid #b8d07f; color: #56662a;
  font-size: 16px; font-weight: 800; letter-spacing: 1px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.wb-create svg { width: 18px; height: 18px; }
.wb-create:active { transform: scale(.99); }

/* 收藏本标题可重命名 */
.wb-rename {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-left: 4px; border-radius: 8px;
  color: var(--wb-muted); vertical-align: middle;
}
.wb-rename svg { width: 16px; height: 16px; }
.wb-rename:active { background: var(--wb-gold-soft); color: var(--wb-gold); }
.wb-rename[hidden] { display: none; }

/* 考纲筛选（页面顶部） */
.wb-exam-chips { display: flex; gap: 8px; margin: 2px 0 12px; }
.wb-exam-chips button {
  padding: 6px 15px; border-radius: 999px; font-size: 12.5px;
  background: var(--wb-card); border: 1.5px solid var(--wb-border); color: var(--wb-muted);
}
.wb-exam-chips button.on { background: var(--wb-gold-soft); border-color: transparent; color: var(--wb-gold); font-weight: 700; }

/* 多选模式头部：隐藏多选/排序，显示「取消」 */
.wb-cancel { display: none; align-items: center; padding: 0 6px; font-size: 15px; font-weight: 600; color: var(--wb-word); }
#view-wordbook.select-mode #wb-select,
#view-wordbook.select-mode #btn-wb-sort { display: none; }
#view-wordbook.select-mode #wb-cancel { display: inline-flex; }
#view-wordbook.select-mode .wb-fab { display: none; }

/* 卡片选中态（图7）：橙色勾 + 暖色底 */
#view-wordbook .wb-item.checked { box-shadow: 0 0 0 1.6px var(--wb-gold); background: var(--wb-gold-soft); }
#view-wordbook .wb-item.checked .wb-check { background: var(--wb-gold); border-color: var(--wb-gold); }
#view-wordbook .wb-check { border-color: #c9ab7c; }
#view-wordbook .wb-item.checked .wb-check::after {
  content: ''; width: 10px; height: 5.5px;
  border-left: 2.2px solid #fff; border-bottom: 2.2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

/* 多选底栏（图6/7）：全选圆点 / 已选 / 红色删除 */
#sel-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  width: auto; transform: none;
  background: var(--wb-card, #fffdf7);
  border-top: 1px solid var(--wb-border, #e6d3a8);
  padding: 10px 18px calc(10px + var(--safe-b));
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 -4px 18px rgba(20, 24, 34, .08);
  box-sizing: border-box;
}
#sel-bar[hidden] { display: none; }
.sb-all { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 600; color: var(--wb-word, #8c5a2b); flex: none; }
.sb-circle { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c9ab7c; background: transparent; display: inline-flex; align-items: center; justify-content: center; }
.sb-all.all .sb-circle { background: var(--wb-gold, #c97a1a); border-color: var(--wb-gold, #c97a1a); }
.sb-all.all .sb-circle::after {
  content: ''; width: 10px; height: 5.5px;
  border-left: 2.2px solid #fff; border-bottom: 2.2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.sb-count { flex: 1; text-align: center; font-size: 15px; font-weight: 600; color: var(--wb-muted, #a08b74); }
.sb-del { flex: none; padding: 10px 26px; border-radius: 12px; background: #c0392b; color: #fff; font-size: 15px; font-weight: 700; }
.sb-del:disabled { opacity: .4; }

/* 收藏弹层「新建收藏本」行 */
.stp-new { display: flex; gap: 8px; margin-top: 12px; }
.stp-new-input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: var(--bg); font-size: 14px; color: var(--ink);
}
.stp-new-input:focus { border-color: var(--accent); outline: none; }
.stp-new-btn {
  flex: none; padding: 10px 16px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700;
}
.sb-del.is-empty { opacity: .55; }

/* ===== 导出选词页（可折叠日期分组） ===== */
.wb-export {
  position: fixed; inset: 0; z-index: 130; background: var(--bg);
  display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 10px) 14px 0;
}
.wb-export[hidden] { display: none; }
.wb-export-head { display: flex; align-items: center; gap: 10px; padding: 4px 2px 8px; }
.wb-export-head .wb-title { flex: 1; text-align: center; }
.wb-export-total { font-size: 13px; font-weight: 600; color: var(--wb-muted); padding: 0 4px 10px; }
.wb-export-list { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.wb-export-group {
  background: var(--wb-card); border: 1.5px solid var(--wb-border);
  border-radius: 14px; margin-bottom: 10px; overflow: hidden;
}
.wb-export-ghead { display: flex; align-items: center; gap: 12px; padding: 13px 14px; }
.wb-export-circle {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c9ab7c; background: transparent;
  flex: none; display: inline-flex; align-items: center; justify-content: center;
}
.wb-export-circle.on { background: var(--wb-gold); border-color: var(--wb-gold); }
.wb-export-circle.on::after {
  content: ''; width: 10px; height: 5.5px;
  border-left: 2.2px solid #fff; border-bottom: 2.2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}
.wb-export-date { flex: 1; font-size: 15px; font-weight: 600; color: var(--wb-word); }
.wb-export-cnt { font-size: 13px; color: var(--wb-muted); }
.wb-export-chev { width: 20px; height: 20px; color: var(--wb-muted); transition: transform .2s; }
.wb-export-group.collapsed .wb-export-chev { transform: rotate(180deg); }
.wb-export-words { border-top: 1px solid var(--wb-border); }
.wb-export-group.collapsed .wb-export-words { display: none; }
.wb-export-word { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--wb-border); }
.wb-export-word:first-child { border-top: none; }
.wb-export-word .w { font-size: 16px; font-weight: 700; color: var(--wb-word); }
.wb-export-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px calc(10px + var(--safe-b));
  border-top: 1px solid var(--wb-border); background: var(--bg);
}
.wb-export-info { flex: 1; }
.wb-export-info b { display: block; font-size: 15px; color: var(--wb-word); }
.wb-export-info span { display: block; font-size: 11px; color: var(--wb-muted); margin-top: 2px; }
.wb-export-go {
  flex: none; padding: 13px 24px; border-radius: 12px;
  background: #cfe4a8; border: 1.5px solid #b8d07f; color: #56662a;
  font-size: 15px; font-weight: 800;
}
.wb-export-go:active { transform: scale(.98); }

/* v96：新版本提示条 */
.sw-update {
  position: fixed; left: 10px; right: 10px;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  z-index: 500;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: #24325e; color: #fffdf6;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(20, 25, 40, .32);
  font-size: 13px; line-height: 1.4;
}
.sw-update span { flex: 1; min-width: 0; font-weight: 700; }
.sw-update button {
  flex: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 800;
}
#sw-update-go {
  padding: 6px 10px; border-radius: 9px;
  background: #f6c875; color: #3a2a1a;
}
.sw-update-x {
  padding: 0 2px; background: transparent;
  color: rgba(255, 253, 246, .65); font-size: 18px; line-height: 1;
}

/* v96：设置页 360px 下拉不被截断 */
.setting-row select { min-width: 0; max-width: 100%; }
@media (max-width: 400px) {
  .setting-row select { font-size: 13px; }
}
