/* ============================================================
   动态默写池 · 样式 v2
   设计原则：信息分层清晰、触控目标≥44px、一屏一主操作、
   键盘可达、减少视觉噪音。颜色统一走 CSS 变量。
   ============================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #f2f4fa;
  --bg-2: #e9edf7;
  --card: #ffffff;
  --ink: #171c26;
  --ink-2: #3d4657;
  --mut: #7b8396;
  --line: #e7eaf3;
  --pri: #4f46e5;
  --pri-deep: #4338ca;
  --pri-soft: #edf0fe;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --bad: #dc2626;
  --bad-soft: #fdeeee;
  --blue: #2563eb;
  --r-lg: 20px;
  --r: 14px;
  --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(23,28,38,.05), 0 2px 8px rgba(23,28,38,.05);
  --shadow: 0 4px 14px rgba(23,28,38,.07);
  --shadow-lg: 0 18px 46px rgba(23,28,38,.16);
  --tap: rgba(79,70,229,.10);
}
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(79,70,229,.08), transparent 60%),
    radial-gradient(900px 420px at -10% 10%, rgba(37,99,235,.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; }
button { touch-action: manipulation; }
button:not(:disabled) { cursor: pointer; }
.hidden { display: none !important; }

#app { max-width: 700px; margin: 0 auto; padding: 0 12px calc(18px + env(safe-area-inset-bottom, 0px)); }
::selection { background: rgba(79,70,229,.18); }

/* ---------- 密码门 ---------- */
.gate { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 22px;
  background: radial-gradient(900px 500px at 80% -10%, rgba(79,70,229,.14), transparent 55%), var(--bg); }
.gate-card { background: var(--card); border-radius: 26px; box-shadow: var(--shadow-lg); padding: 38px 28px 30px; width: 100%; max-width: 360px; text-align: center;
  animation: rise .22s ease; }
.gate-logo { font-size: 46px; line-height: 1; }
.gate-card h1 { margin: 12px 0 2px; font-size: 23px; letter-spacing: .3px; }
.gate-sub { color: var(--mut); margin: 0 0 22px; font-size: 13px; }
.gate-input { width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 13px; font-size: 17px; text-align: center; letter-spacing: 1px;
  outline: none; background: #fafbfe; transition: border-color .15s, box-shadow .15s; }
.gate-input:focus { border-color: var(--pri); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.gate-err { color: var(--bad); font-size: 13px; margin-top: 10px; }
.gate-hint { color: var(--mut); font-size: 12px; margin-top: 14px; }

/* ---------- 顶部栏 ---------- */
.top { display: flex; align-items: center; justify-content: space-between; padding: 16px 4px 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-icon { font-size: 27px; }
.brand-name { font-size: 17.5px; font-weight: 800; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
.sync { flex: 0 0 auto; font-size: 11.5px; color: var(--mut); background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 5px 11px; box-shadow: var(--shadow-sm); white-space: nowrap; }
.sync.ok { color: var(--ok); border-color: #cfeedd; background: var(--ok-soft); }
.sync.saving { color: var(--warn); border-color: #f0dcba; background: var(--warn-soft); }
.sync.err { color: var(--bad); border-color: #f2cccc; background: var(--bad-soft); }
.offline-bar { position: sticky; top: 60px; z-index: 18; max-width: 700px; margin: 0 auto 8px; background: var(--warn-soft);
  color: #7c4a03; border: 1px solid #f0dcba; border-radius: 12px; padding: 9px 14px; font-size: 13px; }

/* ---------- 页签 ---------- */
.tabs { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 5px;
  box-shadow: var(--shadow-sm); position: sticky; top: 8px; z-index: 20; margin-bottom: 12px; backdrop-filter: blur(8px); }
.tab { flex: 1; border: 0; background: transparent; padding: 10px 2px; border-radius: 11px; font-size: 14px; font-weight: 650;
  color: var(--mut); cursor: pointer; position: relative; transition: color .15s, background .15s; -webkit-user-select: none; user-select: none; }
.tab.active { background: var(--pri); color: #fff; box-shadow: 0 4px 10px rgba(79,70,229,.28); }
.badge { position: absolute; top: 1px; right: 4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad);
  color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; padding: 0 4px; }
.badge.zero { background: #ccd3e2; }

.view-pad { animation: rise .16s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid rgba(231,234,243,.8); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 16px 16px 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 15px; font-weight: 750; }
.card-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.card-title-row h3 { margin: 0; }
.muted { color: var(--mut); font-size: 13px; }
code, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.mini-help { font-size: 12px; color: var(--mut); }
.hero { background: linear-gradient(140deg, var(--pri), #6d5bf5 70%, #8b5cf6); color: #fff; border-radius: var(--r-lg);
  padding: 22px 20px; margin-bottom: 12px; box-shadow: 0 12px 30px rgba(79,70,229,.3); }
.hero h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: .2px; }
.hero p { margin: 0; opacity: .94; font-size: 13.5px; }
.hero .btn { margin-top: 14px; }
.tip-card ul.tips { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; line-height: 1.9; }
.tip-card ul.tips li { margin: 2px 0; }
.tip-card { background: linear-gradient(180deg, #fff, #fafbff); }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi { background: var(--card); border: 1px solid rgba(231,234,243,.8); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 12px 6px 10px; text-align: center; }
.kpi .num { font-size: 23px; font-weight: 850; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.kpi .num.red { color: var(--bad); }
.kpi .num.green { color: var(--ok); }
.kpi .num.pri { color: var(--pri); }
.kpi .num.warn { color: var(--warn); }
.kpi .lbl { font-size: 11px; color: var(--mut); margin-top: 1px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 13px;
  padding: 12px 18px; min-height: 46px; font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1.2;
  transition: transform .05s ease, box-shadow .15s, opacity .15s, background .15s; -webkit-user-select: none; user-select: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--pri); color: #fff; box-shadow: 0 6px 16px rgba(79,70,229,.28); }
.btn-primary:hover { background: var(--pri-deep); }
.btn-soft { background: var(--pri-soft); color: var(--pri-deep); }
.btn-green { background: var(--ok); color: #fff; }
.btn-warn { background: var(--warn-soft); color: var(--warn); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-ghost { background: transparent; color: var(--mut); border: 1px solid var(--line); }
.btn-block { width: 100%; }
.btn.sm { padding: 8px 14px; min-height: 38px; font-size: 13px; border-radius: 11px; }
.btn.xs { padding: 6px 10px; min-height: 32px; font-size: 12px; border-radius: 9px; }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; margin: 0 2px; border-radius: 5px; background: rgba(127,127,127,.16);
  font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; vertical-align: 1px; }

/* ---------- 底部常驻操作栏 ---------- */
.action-bar { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 15; margin: 14px 0 4px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 18px;
  padding: 10px 12px; box-shadow: var(--shadow-lg); }
.action-bar .btn { min-height: 50px; font-size: 16px; }
.action-hint { text-align: center; margin-top: 6px; }

/* ---------- 标签 / chip ---------- */
.tag { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; line-height: 1.7; }
.st-fresh { background: #e5efff; color: #1d4ed8; }
.st-relearn { background: var(--bad-soft); color: var(--bad); }
.st-learn { background: var(--warn-soft); color: var(--warn); }
.st-grow { background: #e7f6ec; color: #15803d; }
.st-stable { background: #e2f4fb; color: #0e7490; }
.st-master { background: #ede9fe; color: #6d28d9; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 22px; padding: 8px 15px; min-height: 38px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: all .12s ease;
  -webkit-user-select: none; user-select: none; }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--pri); border-color: var(--pri); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.3); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-row .chip { padding: 6px 13px; font-size: 13px; min-height: 34px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label, .field > label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.textarea { width: 100%; min-height: 132px; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 13px; font-size: 16px;
  line-height: 1.7; resize: vertical; outline: none; background: #fafbfe; transition: border-color .15s, box-shadow .15s; }
.textarea:focus, input:focus-visible { border-color: var(--pri); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
input[type="text"], input[type="search"], input[type="date"] { font-size: 16px; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.add-stats { margin-top: 6px; font-size: 12.5px; color: var(--mut); }
.add-stats code { background: var(--pri-soft); color: var(--pri-deep); padding: 0 5px; border-radius: 5px; }
.date-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.date-status { font-size: 12.5px; color: var(--pri-deep); font-weight: 600; flex: 1 1 200px; }
.ck { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; padding: 3px 0; }
.ck input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--pri); margin: 1px 0 0; flex: 0 0 auto; }
.ck-date { flex: 0 0 auto; color: var(--mut); }
.ck-date input[type="date"] { border: 1px solid var(--line); border-radius: 9px; padding: 5px 8px; font-size: 14px; background: #fafbfe; }

/* ---------- 录入预览 ---------- */
.pv-row { display: grid; grid-template-columns: 20px 1fr 64px 1.4fr auto auto; gap: 6px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 7px 9px; margin-bottom: 7px; transition: border-color .15s; }
.pv-row:focus-within { border-color: var(--pri); }
.pv-row.dup { border-color: #f3d9a4; background: #fffdf6; }
.pv-row .idx { color: var(--mut); font-size: 12px; text-align: center; }
.pv-row input { border: 1px solid transparent; border-radius: 8px; padding: 7px 8px; font-size: 15px; min-width: 0; background: transparent; outline: none; }
.pv-row input:focus { background: #f4f5fb; border-color: var(--line); }
.pv-en { font-weight: 700; }
.pv-row .dup-tip { display: none; color: var(--warn); font-size: 11px; font-weight: 700; }
.pv-row.dup .dup-tip { display: inline; }
.pv-del { background: transparent; border: 0; color: #c2c8d6; font-size: 17px; padding: 8px 6px; cursor: pointer; border-radius: 8px; }
.pv-del:hover, .pv-del:active { color: var(--bad); background: var(--bad-soft); }

/* ---------- 今天：开始卡片 ---------- */
.big-cta { text-align: center; padding: 24px 14px 22px; }
.big-cta .emoji { font-size: 46px; line-height: 1; }
.big-cta h3 { margin: 10px 0 2px; font-size: 20px; }
.start-btns { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.start-btns .btn { flex: 1 1 220px; min-height: 52px; }

/* ---------- 复习会话 ---------- */
.prog { height: 7px; background: #e9ecf5; border-radius: 4px; overflow: hidden; margin: 12px 0 16px; }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--pri), #8b5cf6); border-radius: 4px; transition: width .3s ease; }
.session-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 2px; flex-wrap: wrap; }
.session-foot .cnt { font-weight: 800; font-size: 14px; }
.q-stage { max-width: 560px; margin: 0 auto; }
.q-card { background: var(--card); border-radius: 24px; box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 30px 22px 24px; text-align: center; }
.q-pos { color: var(--pri); font-weight: 800; font-size: 13px; letter-spacing: .8px; text-transform: uppercase; }
.q-cn { font-size: 27px; font-weight: 850; margin: 10px 0 6px; line-height: 1.35; word-break: break-all; }
.q-hint { color: var(--mut); font-size: 13.5px; min-height: 20px; }
.q-input { width: 100%; padding: 14px 12px; font-size: 24px; letter-spacing: .6px; text-align: center;
  border: 2px solid var(--line); border-radius: 15px; outline: none; margin-top: 16px; background: #fafbfe;
  transition: border-color .15s, box-shadow .15s; }
.q-input:focus { border-color: var(--pri); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.q-btns { display: grid; gap: 8px; margin-top: 12px; }
.fb-head { font-weight: 800; font-size: 16px; margin-bottom: 2px; }
.fb-correct .fb-head { color: var(--ok); }
.fb-wrong .fb-head { color: var(--bad); }
.fb-answer { font-size: 24px; font-weight: 850; margin: 6px 0 4px; letter-spacing: .3px; word-break: break-all; }
.fb-mine { color: var(--mut); font-size: 14px; margin: 2px 0; }
.fb-mine .strike { text-decoration: line-through; }
.q-feedback { margin-top: 16px; animation: rise .15s ease; }
.grade-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.grade { border: 0; border-radius: 14px; padding: 11px 4px 9px; font-size: 13.5px; font-weight: 800; line-height: 1.5; min-height: 70px;
  -webkit-user-select: none; user-select: none; transition: transform .05s; }
.grade:active { transform: scale(.95); }
.grade kbd { display: block; margin: 4px auto 0; width: 20px; background: rgba(127,127,127,.25); }
.grade-ok { background: var(--ok); color: #fff; }
.grade-part { background: var(--warn); color: #fff; }
.grade-fail { background: var(--bad); color: #fff; }

/* ---------- 结果汇总 ---------- */
.res-summary { text-align: center; }
.res-nums { display: flex; justify-content: center; align-items: flex-end; gap: 30px; margin: 16px 0; flex-wrap: wrap; }
.res-nums b { font-size: 38px; display: block; line-height: 1.1; font-variant-numeric: tabular-nums; }
.res-ok b { color: var(--ok); } .res-bad b { color: var(--bad); } .res-part b { color: var(--warn); }
.res-list { list-style: none; padding: 0; margin: 8px 0 0; text-align: left; }
.res-list li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 2px; border-bottom: 1px dashed var(--line); font-size: 14px; }
.res-list li .en { font-weight: 750; }
.res-list li .cn { color: var(--mut); text-align: right; }

/* ---------- 纸笔模式 ---------- */
.paper-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.paper-bar .bar-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.paper-row { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm);
  padding: 13px 15px; margin-bottom: 9px; }
.paper-q { font-size: 15.5px; font-weight: 750; }
.paper-q .pos { color: var(--pri); font-size: 12px; font-weight: 700; margin-right: 6px; }
.paper-a { display: none; margin-top: 8px; font-size: 19px; font-weight: 850; color: var(--pri-deep);
  border-top: 1px dashed var(--line); padding-top: 8px; word-break: break-all; }
.paper-row.show .paper-a { display: block; }
.paper-act { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.paper-note { font-size: 12px; margin-top: 7px; }
.paper-row.done-ok { outline: 2px solid #b8e6c8; outline-offset: -1px; }
.paper-row.done-part { outline: 2px solid #f3dca8; outline-offset: -1px; }
.paper-row.done-fail { outline: 2px solid #f3bdbd; outline-offset: -1px; }

/* ---------- 词库 ---------- */
.words-head { padding-bottom: 10px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar input[type="search"] { flex: 1 1 180px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px;
  font-size: 15px; outline: none; background: #fafbfe; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.toolbar input[type="search"]:focus { border-color: var(--pri); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
#wCount { margin: 6px 2px 0; }
.w-row { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm);
  padding: 12px 14px; margin-bottom: 9px; display: flex; align-items: center; gap: 10px; transition: border-color .15s; }
.w-row.is-due { border-color: rgba(220,38,38,.35); background: #fffdfd; }
.w-row:active { background: #fafbfe; }
.w-main { flex: 1; min-width: 0; }
.w-en { font-size: 16.5px; font-weight: 800; word-break: break-all; }
.w-en .pos { color: var(--pri); font-size: 12px; font-weight: 700; margin-left: 4px; }
.w-cn { color: var(--ink-2); font-size: 13px; word-break: break-all; margin-top: 1px; }
.w-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.w-meta .due-ok { color: var(--bad); font-weight: 800; }
.w-meta .due-later { color: var(--mut); }
.w-meta .due-soon { color: var(--warn); font-weight: 700; }
.w-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px;
  border: 1px solid var(--line); background: #fff; font-size: 17px; cursor: pointer; transition: background .12s, transform .05s; }
.icon-btn:active { transform: scale(.93); }
.icon-btn:hover { background: var(--pri-soft); }
.icon-btn.danger:hover { background: var(--bad-soft); }
.list-empty { text-align: center; color: var(--mut); padding: 44px 12px; line-height: 2; }

/* ---------- 统计 ---------- */
.chart-title { font-size: 12px; color: var(--mut); margin: 2px 0 8px; line-height: 1.6; }
.chart-box { width: 100%; margin-bottom: 4px; }
canvas { width: 100%; height: 150px; display: block; }
.legend { display: flex; gap: 14px; justify-content: center; font-size: 12px; color: var(--mut); margin-top: 4px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
details.acc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 4px 16px; margin-bottom: 12px; }
details.acc summary { cursor: pointer; font-weight: 750; font-size: 14.5px; padding: 10px 0; list-style: none; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::before { content: '▸ '; color: var(--pri); }
details.acc[open] summary::before { content: '▾ '; }
details.acc .acc-body { color: var(--ink-2); font-size: 13.5px; padding: 2px 0 12px; line-height: 1.85; }
details.acc ul { margin: 0; padding-left: 18px; }
details.acc li { margin: 4px 0; }

/* ---------- Toast ---------- */
#toasts { position: fixed; left: 0; right: 0; top: calc(12px + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column;
  align-items: center; gap: 8px; z-index: 90; pointer-events: none; padding: 0 14px; }
.toast { background: #232b3b; color: #fff; padding: 10px 18px; border-radius: 24px; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 26px rgba(0,0,0,.2); animation: drop .2s ease; max-width: 92%; }
.toast.ok { background: #15803d; } .toast.bad { background: var(--bad); }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- 内置键盘（打字默写） ---------- */
.type-head { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.q-type { flex: 1; min-width: 0; background: #f6f7fc; border: 2px solid var(--line); border-radius: 13px;
  padding: 12px 14px; min-height: 54px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; box-shadow: inset 0 1px 3px rgba(23,28,38,.04); }
.q-text { font-size: 26px; font-weight: 800; letter-spacing: 2px; color: var(--ink); word-break: break-all;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.q-caret { width: 2.5px; height: 30px; background: var(--pri); margin-left: 3px; flex: 0 0 auto;
  animation: blink 1.1s steps(1) infinite; border-radius: 1px; }
@keyframes blink { 50% { opacity: 0; } }
.vk-grid { margin-top: 10px; }
.vk-row { display: flex; gap: 5px; margin-top: 6px; }
.vk-key { flex: 1; min-height: 46px; border: 1px solid var(--line); border-radius: 11px; background: #fff;
  font-size: 18px; font-weight: 700; color: var(--ink); cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .04s ease, background .1s; -webkit-user-select: none; user-select: none; padding: 0; }
.vk-key:active { transform: scale(.93); background: var(--pri-soft); }
.vk-fn { background: #eef0f6; color: var(--ink-2); font-size: 19px; flex: 1.2; }
.vk-go { background: var(--pri); border-color: var(--pri); color: #fff; font-size: 14px; flex: 1.6; }
.vk-go:active { background: var(--pri-deep); }
.vk-space { background: #eef0f6; flex: 1; font-size: 14px; color: var(--ink-2); }
.vk-util { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.vk-util span { flex: 1; }
.vk-tip { margin-top: 8px; text-align: center; }

/* ---------- 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(13,17,30,.48); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal input.textline { width: 100%; border: 1.5px solid var(--line); border-radius: 11px; padding: 10px 12px; font-size: 16px; outline: none; background: #fafbfe; }
.modal input.textline:focus { border-color: var(--pri); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.no-cn { color: var(--warn); font-size: 12.5px; font-weight: 600; }
.icon-btn.primary { border-color: var(--pri-soft); background: var(--pri-soft); color: var(--pri-deep); }
.icon-btn.primary:hover { background: #e0e4fc; }
.modal { background: var(--card); border-radius: 20px; padding: 22px 20px 18px; max-width: 380px; width: 100%;
  box-shadow: var(--shadow-lg); animation: rise .18s ease; }
.modal h3 { margin: 0 0 8px; font-size: 16px; }
.modal p { margin: 0 0 14px; color: var(--ink-2); font-size: 14px; word-break: break-all; line-height: 1.7; }
.modal-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.file-label { display: inline-block; cursor: pointer; }

/* ---------- 打印（纸版清单页用不上时保留） ---------- */
@media print {
  body { background: #fff; }
  .top, .tabs, #toasts, .offline-bar { display: none !important; }
}
