:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1d2433;
  --muted: #7a8396;
  --line: #e6e9f0;
  --primary: #3b6cf6;
  --primary-soft: #e8eefe;
  --ok: #1fb36b;
  --ok-soft: #e3f7ec;
  --bad: #ef5350;
  --bad-soft: #fdecec;
  --warn: #ff9f1c;
  --radius: 18px;
  --shadow: 0 4px 18px rgba(30, 50, 100, .07);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11141b; --card: #1b2029; --text: #e8ebf2; --muted: #8d96a8; --line: #2a303c;
    --primary: #5b86ff; --primary-soft: #1f2a44; --ok-soft: #173426; --bad-soft: #3a1d1f;
    --shadow: 0 4px 18px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; color: var(--text); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

#app { max-width: 760px; margin: 0 auto; padding: env(safe-area-inset-top, 0) 16px calc(84px + var(--safe-b)); min-height: 100vh; }
.view { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 18px 2px 14px; }
.topbar h2 { margin: 0; font-size: 22px; }
.hello { font-size: 22px; font-weight: 700; }
.streak { display: flex; align-items: baseline; gap: 2px; background: var(--card); padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow); }
.streak b { font-size: 20px; color: var(--warn); }

.btn { display: block; width: 100%; padding: 12px 16px; border-radius: 14px; font-weight: 600; text-align: center; text-decoration: none; transition: transform .08s; }
.btn:active { transform: scale(.98); }
.btn.big { padding: 15px; font-size: 18px; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(59, 108, 246, .3); }
.btn.ghost { background: var(--primary-soft); color: var(--primary); margin-top: 10px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:active { background: var(--primary-soft); }

.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.bar i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 99px; transition: width .3s; }
.bar.thin { height: 6px; flex: 1; margin: 0 12px; }

/* home */
.today-card { text-align: center; padding: 24px 18px; }
.ring-wrap { position: relative; width: 170px; height: 170px; margin: 0 auto 10px; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .6s; }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-text b { font-size: 46px; line-height: 1.1; }
.today-nums { display: flex; justify-content: center; gap: 48px; margin: 6px 0 18px; }
.today-nums div { display: flex; flex-direction: column; }
.today-nums b { font-size: 24px; }
.today-nums span, .stat span { color: var(--muted); font-size: 13px; }
.book-card { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.book-icon { font-size: 34px; }
.book-info { flex: 1; min-width: 0; }
.book-name { font-weight: 700; }
.chev { font-size: 28px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { display: flex; flex-direction: column; align-items: center; margin: 0; }
.stat b { font-size: 26px; }

/* tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 0; background: var(--card); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); z-index: 10; }
.tabbar button { flex: 1; max-width: 200px; padding: 8px 0 10px; display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--muted); }
.tabbar button span { font-size: 22px; filter: grayscale(1); opacity: .6; }
.tabbar button.on { color: var(--primary); font-weight: 600; }
.tabbar button.on span { filter: none; opacity: 1; }

/* study */
.study-top { display: flex; align-items: center; padding: 12px 0; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.q-card { background: var(--card); border-radius: 24px; box-shadow: var(--shadow); padding: 20px; min-height: calc(100vh - 110px); display: flex; flex-direction: column; animation: fade .2s ease; }
.q-meta { display: flex; justify-content: space-between; align-items: center; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.pill.new { background: #fff1e0; color: #e07b00; }
.pill.spell { background: #efe6ff; color: #7b4ddb; }
.pill.listen { background: #def6f3; color: #0f8f80; }
@media (prefers-color-scheme: dark) { .pill.new { background: #3b2a12; } .pill.spell { background: #2c2142; } .pill.listen { background: #143530; color: #4fd1c0; } }
.kill { font-size: 14px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.kill:active { background: var(--bad-soft); color: var(--bad); }
.q-word { font-size: clamp(38px, 11vw, 64px); font-weight: 800; text-align: center; margin: 7vh 0 4px; letter-spacing: .5px; word-break: break-word; }
.q-ph { text-align: center; color: var(--muted); font-size: 18px; }
.q-cn { font-size: clamp(24px, 6.5vw, 34px); font-weight: 700; text-align: center; margin: 6vh 0 6px; }
.q-hint { text-align: center; }
.pos { font-size: .6em; color: var(--muted); font-weight: 500; margin-right: 8px; font-style: italic; }
.options { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: auto; padding-top: 28px; }
@media (min-width: 600px) { .options { grid-template-columns: 1fr 1fr; } }
.opt { background: var(--bg); border: 2px solid transparent; border-radius: 16px; padding: 16px 14px; font-size: 17px; min-height: 62px; text-align: left; transition: background .15s, border-color .15s; }
.options.en .opt { font-size: 20px; font-weight: 600; text-align: center; }
.opt:active { background: var(--primary-soft); }
.opt.right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); font-weight: 600; }
.opt.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); animation: shake .35s; }
.q-listen { width: 112px; height: 112px; border-radius: 50%; margin: 7vh auto 14px; display: flex; align-items: center; justify-content: center; font-size: 48px; background: var(--primary-soft); }
.q-listen:active { transform: scale(.95); }
.try-msg { min-height: 24px; margin-top: 18px; text-align: center; color: var(--bad); font-weight: 600; font-size: 15px; }
.round-card { justify-content: center; text-align: center; }
.round-icon { font-size: 64px; }
.round-title { font-size: 24px; font-weight: 800; margin: 6px 0; }
.round-actions { margin-top: 24px; }
.dunno { margin-top: 14px; background: transparent; color: var(--muted); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.result { padding-top: 16px; }
.result-flag { font-weight: 700; padding: 8px 12px; border-radius: 12px; margin-bottom: 8px; }
.result.ok .result-flag { background: var(--ok-soft); color: var(--ok); }
.result.bad .result-flag { background: var(--bad-soft); color: var(--bad); }
.result .btn { margin-top: auto; }
.detail { padding: 6px 0 18px; }
.d-head { display: flex; justify-content: space-between; align-items: center; }
.d-word { font-size: 34px; font-weight: 800; word-break: break-word; }
.d-ph { color: var(--muted); }
.d-mean { font-size: 20px; font-weight: 600; margin: 10px 0 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #fff3d6; color: #a46a00; font-weight: 600; white-space: nowrap; }
.tag.cloze { background: #ffe4e0; color: #c4382a; }
.tag.topic { background: var(--primary-soft); color: var(--primary); }
@media (prefers-color-scheme: dark) { .tag { background: #3a2f14; color: #f2c461; } .tag.cloze { background: #3d1c18; color: #ff8a7a; } .tag.topic { background: var(--primary-soft); color: var(--primary); } }
.q-tags { justify-content: center; margin-top: 12px; }
.wr-tags { grid-column: 1; margin: 2px 0 0; }
.note { background: var(--primary-soft); border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: 15px; }
.ex-title { font-weight: 700; margin-top: 14px; }
.ex-list { list-style: none; padding: 0; margin: 8px 0 0; }
.rel-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.rel-list li { padding: 6px 10px; border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 14px; line-height: 1.4; }
.rel-list b { margin-right: 6px; }
.w-rel { max-width: 220px; }
.w-rel .link-btn { padding: 0 2px; }
.rel-list .pos { color: var(--muted); margin-right: 4px; font-size: 12px; }
.ex { padding: 10px 12px; border-left: 3px solid var(--primary); background: var(--bg); border-radius: 0 10px 10px 0; margin-bottom: 8px; font-size: 15px; cursor: pointer; }
.ex .year { margin-right: 6px; }
mark { background: transparent; color: var(--primary); font-weight: 700; }

/* spelling */
.spell .slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 5vh 0 18px; }
.slot { width: 34px; height: 44px; border-bottom: 3px solid var(--line); font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.slot.on { border-color: var(--primary); }
.slot.fixed { border-color: transparent; width: 18px; }
.slots.ok .slot { color: var(--ok); border-color: var(--ok); }
.slots.bad .slot { color: var(--bad); border-color: var(--bad); animation: shake .35s; }
.spell-ans { text-align: center; background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 8px 12px; margin: -6px auto 14px; font-size: 18px; }
.spell-ans b { font-size: 22px; letter-spacing: 1px; }
.keys { margin-top: auto; }
.qwerty { display: flex; flex-direction: column; gap: 8px; }
.krow { display: flex; justify-content: center; gap: 5px; }
.key { flex: 1; max-width: 46px; height: 50px; border-radius: 9px; background: var(--bg); font-size: 20px; font-weight: 700; box-shadow: inset 0 -3px 0 var(--line); padding: 0; }
.key:active { transform: translateY(2px); background: var(--primary-soft); }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: auto; }
.tile { width: 52px; height: 56px; border-radius: 14px; background: var(--bg); font-size: 24px; font-weight: 700; box-shadow: inset 0 -3px 0 var(--line); }
.tile:active { transform: translateY(2px); }
.tile:disabled { opacity: .2; }
.spell-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.spell-actions .btn { padding: 12px 4px; font-size: 15px; }

/* done */
.done { text-align: center; padding-top: 12vh; }
.done-badge { font-size: 80px; animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.3); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.done h2 { margin: 6px 0; font-size: 28px; }
.done-stats { margin: 28px 0; }
.done-stats div { background: var(--card); border-radius: 16px; padding: 14px 4px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.done-stats b { font-size: 26px; }
.done-stats span { font-size: 13px; color: var(--muted); }

/* word list */
.tabs { display: flex; background: var(--card); border-radius: 14px; padding: 4px; box-shadow: var(--shadow); }
.tabs button { flex: 1; padding: 9px; border-radius: 10px; color: var(--muted); }
.tabs button.on { background: var(--primary); color: #fff; font-weight: 600; }
.search { width: 100%; margin: 12px 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); outline: none; }
.word-row { background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; cursor: pointer; }
.wr-main b { font-size: 18px; margin-right: 8px; }
.wr-mean { grid-column: 1; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dots { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--ok); }
.wc { font-size: 11px; color: var(--bad); margin-left: 6px; }
.empty { text-align: center; padding: 50px 0; }

/* me */
.row-between { display: flex; justify-content: space-between; align-items: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0 8px; text-align: center; }
.cal-h { font-size: 12px; color: var(--muted); }
.cal-d { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 13px; }
.c0 { background: var(--bg); color: var(--muted); }
.c1 { background: var(--primary-soft); color: var(--primary); }
.c2 { background: var(--primary); color: #fff; font-weight: 700; }
.legend { display: flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; margin-left: 8px; }
.stage-bars .sb { display: grid; grid-template-columns: 56px 1fr 40px; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; }
.stage-bars b { text-align: right; }
.stage-bars i.learning { background: var(--warn); }
.stage-bars i.familiar { background: var(--primary); }
.stage-bars i.mastered { background: var(--ok); }
.menu { padding: 4px 18px; }
.menu > * { display: flex; justify-content: space-between; width: 100%; padding: 15px 0; border-bottom: 1px solid var(--line); text-align: left; color: var(--text); text-decoration: none; }
.menu > *:last-child { border-bottom: 0; color: var(--bad); }

/* sheet */
.sheet { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet-panel { background: var(--card); width: 100%; max-width: 760px; max-height: 86vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 8px 20px calc(24px + var(--safe-b)); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-panel { border-radius: 24px; max-width: 560px; } }
.sheet-grip { width: 40px; height: 5px; background: var(--line); border-radius: 9px; margin: 4px auto 12px; }
.sheet h3 { margin: 4px 0 14px; }
.book-list { display: flex; flex-direction: column; gap: 10px; }
.book-item { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: 14px; background: var(--bg); border: 2px solid transparent; }
.book-item > div { flex: 1; }
.book-item.on { border-color: var(--primary); }
.form label, .login-card label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.form input, .login-card input { display: block; width: 100%; margin-top: 6px; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); outline: none; font-size: 16px; }
.form input:focus, .login-card input:focus { border-color: var(--primary); }

.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); background: rgba(20, 24, 33, .88); color: #fff; padding: 10px 18px; border-radius: 99px; z-index: 60; font-size: 15px; white-space: nowrap; }

/* login */
.login { max-width: 420px; margin: 0 auto; padding: 10vh 20px 40px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { width: 76px; height: 76px; }
.login-logo h1 { margin: 10px 0 4px; font-size: 26px; }
.login-logo p { margin: 0; color: var(--muted); }
.login-card { background: var(--card); padding: 22px; border-radius: 22px; box-shadow: var(--shadow); }
.login-card .link { display: block; text-align: center; margin-top: 14px; color: var(--primary); text-decoration: none; }
.login-card .muted { text-align: center; margin: 14px 0 0; }
.alert { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }

/* admin */
.admin { max-width: 1100px; margin: 0 auto; padding: 16px 16px 60px; }
.admin h1 { font-size: 22px; margin: 6px 0 16px; display: flex; justify-content: space-between; align-items: center; }
.admin h1 a { font-size: 14px; color: var(--primary); text-decoration: none; font-weight: 500; }
.admin h2 { font-size: 17px; margin: 0 0 12px; }
.seg { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { padding: 8px 18px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--primary); color: #fff; }
.field { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.field > label:first-child { min-width: 110px; font-weight: 600; }
.admin input[type=number], .admin input[type=text], .admin input[type=password], .admin select {
  padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 15px; color: var(--text);
}
.admin input[type=number] { width: 90px; }
.btn.inline { display: inline-block; width: auto; padding: 9px 18px; margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
td .link-btn { color: var(--primary); padding: 4px 6px; }
td .link-btn.danger { color: var(--bad); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); }
.badge.no { background: var(--bg); color: var(--muted); }
.add-user { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.up-stats { background: var(--primary-soft); border-radius: 12px; padding: 10px 14px; margin: 6px 0 14px; font-size: 14px; }
.filters .chk { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
.cand-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.cand-wrap thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
.cand-wrap td { white-space: normal; vertical-align: top; }
.cand-wrap .c-mean { width: 100%; min-width: 180px; padding: 6px 8px; }
.ex-cell { max-width: 320px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lvl { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg); color: var(--muted); font-weight: 600; }
.lvl.zk { background: var(--ok-soft); color: var(--ok); }
.lvl.gk { background: var(--primary-soft); color: var(--primary); }
.dups { margin-top: 12px; font-size: 14px; }
.dups summary { cursor: pointer; color: var(--muted); }
.dups div { margin-top: 6px; line-height: 1.8; }
.badge.st-pending { background: #fff3d6; color: #a46a00; }
.badge.st-discarded, .badge.st-reverted { background: var(--bg); color: var(--muted); }
.hist-words { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.hist-words span { background: var(--bg); border-radius: 8px; padding: 4px 10px; font-size: 14px; }
a.link-btn { text-decoration: none; color: var(--primary); padding: 4px 6px; }

/* admin: tabs, word bank */
.admin-tabs { margin-bottom: 14px; position: sticky; top: 8px; z-index: 20; overflow-x: auto; }
.admin-tabs button { white-space: nowrap; }
.admin h2 .small { font-weight: 400; margin-left: 6px; }
.grow { flex: 1; }
.w-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.w-toolbar #w-q { flex: 1 1 220px; min-width: 0; }
.w-toolbar .btn.ghost { text-decoration: none; }
.chk { display: inline-flex; align-items: center; gap: 4px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 4px; border-radius: 9px; border: 1px solid var(--line); font-size: 13px; color: var(--text); }
.tag-chip:first-child, .tag-chip[data-tag="__none"] { padding-left: 10px; }
.tag-chip i { font-style: normal; color: var(--muted); font-size: 12px; }
.tag-chip.on { border-color: var(--primary); background: var(--primary-soft); }
.tag-actions, .bulk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; background: var(--primary-soft); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
.bulk-bar { position: sticky; top: 60px; z-index: 15; }
.link-btn { color: var(--primary); padding: 4px 6px; font-size: 14px; }
.link-btn.danger { color: var(--bad); }
.link-btn:disabled { color: var(--muted); opacity: .5; }
.word-table td { vertical-align: top; }
td.wrap { white-space: normal; min-width: 140px; }
.word-table td .tags { margin: 0; min-width: 160px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 12px; }
.word-form label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.word-form input[type=text], .word-form textarea { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 15px; color: var(--text); font-family: inherit; }
.word-form textarea { resize: vertical; }
.wf-inline { display: flex; gap: 8px; align-items: center; }
.wf-inline input[type=text] { margin-top: 5px; flex: 1; }
.wf-inline .btn { margin-top: 5px !important; white-space: nowrap; }
.wf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .wf-grid { grid-template-columns: 1fr; } }
.wf-hint { margin: -6px 0 12px; min-height: 18px; }
.wf-hint.warn { color: var(--bad); font-weight: 600; }
.wf-tag-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.wf-tag-pick .tag { cursor: pointer; border: 0; }
.wf-label { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.wf-books { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 14px; font-size: 14px; }
.wf-books .chk { display: inline-flex; margin: 0; color: var(--text); }
.wf-foot { display: flex; align-items: center; gap: 10px; position: sticky; bottom: 0; background: var(--card); padding-top: 10px; }

/* word banks (单词库) */
.bank-card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.bank-tools { margin-left: auto; font-weight: 400; display: flex; flex-wrap: wrap; gap: 2px; }
.bank-card .add-book { margin: 12px 0 0; }
.bank-card .b-move { padding: 4px 6px; font-size: 13px; }
.bank-name { font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }
.bank-group { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; width: 100%; }
.bank-group .bank-name { width: 100%; margin: 6px 0 0; }
.wf-books { flex-direction: column; gap: 4px; }
.user-books .chk { font-size: 15px; padding: 4px 0; }
.wf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 24px; align-items: center; }
.wf-tags .tag { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; }
.wf-tags .tag button { font-size: 14px; line-height: 1; padding: 0 2px 0 4px; color: inherit; opacity: .7; }
.wf-newtag, .wf-newbook { margin-bottom: 10px; }
.wf-newtag input, .wf-newbook input { margin-top: 0 !important; }
.wf-newbook select { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.wf-label .link-btn { font-size: 13px; margin-left: 6px; }
.book-group-name { font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 0 6px; }
.book-item .chk-box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); flex: none; display: flex; align-items: center; justify-content: center; color: transparent; font-size: 14px; }
.book-item.on .chk-box { background: var(--primary); border-color: var(--primary); color: #fff; }
.book-save { position: sticky; bottom: 0; background: var(--card); padding-top: 12px; }
