/* ===========================================================
   拾词 · Word Pick — styles
   =========================================================== */
:root {
  --paper: #f4efe4;
  --paper-2: #efe7d8;
  --card: #fdfaf3;
  --card-solid: #fffdf8;
  --ink: #1f2a37;
  --ink-2: #3a4654;
  --muted: #7d7567;
  --muted-2: #a39a89;
  --line: #e5dccb;
  --line-strong: #d2c6af;
  --accent: #d9552f;
  --accent-2: #b83f1c;
  --accent-soft: #f7ddd0;
  --sage: #5f7d63;
  --sage-soft: #e6ece2;
  --gold: #b8892f;
  --gold-soft: #f3e6c7;
  --sky: #4c7792;
  --sky-soft: #e2edf2;
  --rose: #a9566a;
  --rose-soft: #f4e2e6;
  --violet: #6c5b8d;
  --violet-soft: #ebe5f4;
  --ok: #3f7a4f;
  --ok-soft: #e5efe4;
  --bad: #c0493a;
  --bad-soft: #f8e3de;
  --shadow-sm: 0 2px 8px rgba(53, 42, 23, .05);
  --shadow: 0 20px 50px -26px rgba(53, 42, 23, .38);
  --shadow-lg: 0 34px 80px -32px rgba(53, 42, 23, .46);
  --radius: 22px;
  --radius-lg: 30px;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --serif: Georgia, "Times New Roman", "Songti SC", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --paper: #151a20;
  --paper-2: #1b222a;
  --card: #1c242d;
  --card-solid: #202932;
  --ink: #f1ebdf;
  --ink-2: #d7d0c2;
  --muted: #9c9588;
  --muted-2: #6f6a5f;
  --line: #2d3842;
  --line-strong: #3b4854;
  --accent: #ef7a52;
  --accent-2: #ff906a;
  --accent-soft: #3a2620;
  --sage: #8fae92;
  --sage-soft: #23302a;
  --gold: #d9b168;
  --gold-soft: #332a1b;
  --sky: #82aec6;
  --sky-soft: #1f2d36;
  --rose: #d391a2;
  --rose-soft: #332227;
  --violet: #b3a3d4;
  --violet-soft: #292338;
  --ok: #8cc397;
  --ok-soft: #1f2f24;
  --bad: #ef8d7c;
  --bad-soft: #38221f;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .25);
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, .7);
  --shadow-lg: 0 34px 80px -30px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(217, 85, 47, .10), transparent 62%),
    radial-gradient(900px 560px at -8% 18%, rgba(95, 125, 99, .09), transparent 60%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
[data-theme="dark"] body {
  background:
    radial-gradient(1100px 620px at 88% -12%, rgba(239, 122, 82, .08), transparent 62%),
    radial-gradient(900px 560px at -8% 18%, rgba(143, 174, 146, .06), transparent 60%),
    var(--paper);
}
::selection { background: var(--accent); color: #fff; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 21px; padding: 0 6px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px;
  background: var(--card-solid);
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  line-height: 1;
}
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-flip { transform: rotate(180deg); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px;
  border: 1px solid transparent; background: transparent;
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn .icon { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -12px rgba(217, 85, 47, .75); }
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 14px 28px -12px rgba(217, 85, 47, .8); }
.btn-soft { background: var(--paper-2); border-color: var(--line); color: var(--ink); }
.btn-soft:hover { background: var(--card); border-color: var(--line-strong); }
.btn-ghost { border-color: var(--line); color: var(--ink-2); background: transparent; }
.btn-ghost:hover { background: var(--card); border-color: var(--line-strong); }
.btn-danger { background: var(--bad); color: #fff; box-shadow: 0 10px 24px -12px rgba(192, 73, 58, .65); }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 82%, #000); }
.btn:disabled, .tool-btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-lg { height: 52px; padding: 0 26px; border-radius: 14px; font-size: 15px; }
.btn-sm { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13px; }
.danger-text { color: var(--bad); }
.icon-btn {
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--ink-2);
  transition: background .18s, border-color .18s, color .18s;
}
.icon-btn:hover { background: var(--card); border-color: var(--line); }
.icon-btn .icon { width: 19px; height: 19px; }
#themeBtn .icon-moon { display: none; }
[data-theme="dark"] #themeBtn .icon-sun { display: none; }
[data-theme="dark"] #themeBtn .icon-moon { display: block; }
.text-link {
  display: inline-flex; align-items: center; gap: 4px; border: 0; background: none;
  color: var(--accent); font-size: 13px; font-weight: 600; padding: 2px 0;
}
.text-link .icon { width: 15px; height: 15px; }
.text-link:hover { color: var(--accent-2); }
.tool-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card-solid);
  color: var(--muted); font-size: 12px; font-weight: 600; transition: all .15s;
}
.tool-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--paper-2); }
.tool-btn.danger:hover { color: var(--bad); border-color: var(--bad); }
.tool-btn .icon { width: 14px; height: 14px; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 28px;
  height: 74px; padding: 0 clamp(20px, 4vw, 54px);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  font-family: "Songti SC", "SimSun", var(--serif); font-size: 23px; line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 8px 18px -10px rgba(31,42,55,.6);
}
.logo-mark.small { width: 30px; height: 30px; border-radius: 9px; font-size: 16px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font-size: 18px; letter-spacing: .08em; }
.brand-text small { font-size: 8.5px; letter-spacing: .24em; color: var(--muted); margin-top: 3px; font-weight: 700; }
.main-nav { display: flex; align-items: center; gap: 4px; margin: 0 auto; }
.nav-btn {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 15px; border: 0; border-radius: 11px; background: transparent;
  color: var(--muted); font-size: 13.5px; font-weight: 600; transition: all .18s;
}
.nav-btn .icon { width: 16px; height: 16px; }
.nav-btn:hover { color: var(--ink); background: color-mix(in srgb, var(--card) 60%, transparent); }
.nav-btn.active { color: var(--ink); background: var(--card); box-shadow: var(--shadow-sm); }
.nav-btn.active::after {
  content: ""; position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
  width: 18px; height: 2px; border-radius: 2px; background: var(--accent);
}
.nav-badge {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.topbar-actions { display: flex; gap: 4px; flex: none; }

/* ---------- generic layout ---------- */
#app { min-height: calc(100vh - 74px); }
.view { display: none; width: 100%; max-width: 1200px; margin: 0 auto; padding: 34px clamp(20px, 4vw, 48px) 90px; animation: viewIn .45s cubic-bezier(.2,.7,.2,1); }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 14px;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 6px 0 28px; }
.view-head h1 { font-size: clamp(30px, 3.6vw, 42px); letter-spacing: -.02em; line-height: 1.18; font-weight: 700; }
.view-head p:not(.eyebrow) { color: var(--muted); margin-top: 8px; max-width: 640px; font-size: 14.5px; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.panel-title { display: flex; align-items: baseline; gap: 10px; }
.panel-title h2 { font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.panel-sub { font-size: 11.5px; color: var(--muted-2); }
.panel-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.count-pill { min-width: 24px; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--paper-2); color: var(--muted); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.card-kicker { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.card-count { font-size: 11px; color: var(--muted-2); }
.side-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 4vw, 52px); align-items: center; padding: 34px 0 54px; min-height: 520px; }
.hero-copy { max-width: 610px; }
.hero-copy h1 {
  font-size: clamp(46px, 5.6vw, 76px); line-height: 1.04; letter-spacing: -.035em; font-weight: 700;
}
.hero-copy h1 em {
  font-style: normal; color: var(--accent); position: relative; display: inline-block;
  background: linear-gradient(transparent 68%, color-mix(in srgb, var(--accent) 16%, transparent) 68%, color-mix(in srgb, var(--accent) 16%, transparent) 94%, transparent 94%);
}
.lede { margin-top: 22px; max-width: 520px; color: var(--muted); font-size: 15.5px; line-height: 1.8; }
.hero-actions { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.hero-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 26px 0 0; color: var(--muted); font-size: 12px; }
.hero-meta li { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .8; }

.hero-art { position: relative; min-height: 510px; }
.art-glow { position: absolute; inset: 6% 4% 10% 8%; background: radial-gradient(circle at 55% 40%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 62%); filter: blur(10px); }
.art-photo {
  position: absolute; left: 6%; top: 12px; width: 318px; height: 430px;
  border-radius: 16px; padding: 7px; background: #fdfbf5;
  box-shadow: 0 30px 60px -24px rgba(50, 39, 20, .5), 0 2px 0 rgba(255,255,255,.7) inset;
  transform: rotate(-4deg); overflow: hidden;
}
.art-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 10px; }
.art-photo::after { content: ""; position: absolute; inset: 7px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(80,60,30,.08); }
.scan-line {
  position: absolute; left: 8px; right: 8px; top: 8px; height: 92px; z-index: 2;
  background: linear-gradient(to bottom, transparent, rgba(217,85,47,.16) 60%, rgba(217,85,47,.55));
  border-bottom: 2px solid rgba(217,85,47,.85); border-radius: 50% 50% 4px 4px / 12% 12% 4px 4px;
  mix-blend-mode: multiply; opacity: .85;
  animation: scan 4.2s ease-in-out infinite;
}
[data-theme="dark"] .scan-line { mix-blend-mode: screen; }
@keyframes scan { 0%, 100% { transform: translateY(0); opacity: .4; } 45%, 55% { transform: translateY(330px); opacity: .9; } }
.photo-tag {
  position: absolute; bottom: 20px; left: 20px; z-index: 3;
  background: rgba(31,42,55,.86); color: #f8f3e8; backdrop-filter: blur(6px);
  padding: 6px 11px; border-radius: 8px; font-size: 10.5px; letter-spacing: .08em;
}
.art-chip {
  position: absolute; z-index: 4; display: flex; align-items: center; gap: 7px;
  padding: 9px 12px; background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  font-family: var(--serif); font-size: 15px; color: var(--ink);
  backdrop-filter: blur(6px);
}
.art-chip .icon { width: 14px; height: 14px; color: var(--accent); }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip-dot.sage { background: var(--sage); }
.chip-dot.gold { background: var(--gold); }
.chip-1 { right: 2%; top: 72px; animation: float 7s ease-in-out infinite; }
.chip-2 { right: 10%; top: 142px; animation: float 8s ease-in-out infinite reverse; }
.chip-3 { left: -2%; bottom: 66px; animation: float 7.6s ease-in-out infinite 1s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.art-stamp {
  position: absolute; right: 2%; top: -4px; z-index: 4; transform: rotate(7deg);
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 12px; background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--accent); font-size: 12px; font-weight: 700;
}
.art-stamp .icon { width: 20px; height: 20px; }
.art-stamp small { display: block; font-size: 9.5px; font-weight: 500; color: var(--muted); letter-spacing: .05em; }
.art-bubble {
  position: absolute; right: 0; bottom: 8px; z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 11px 16px 11px 12px;
  background: var(--ink); color: var(--paper); border-radius: 18px;
  box-shadow: var(--shadow-lg);
}
.bubble-sound { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; }
.bubble-sound .icon { width: 18px; height: 18px; }
.bubble-wave { display: flex; align-items: center; gap: 2.5px; height: 22px; }
.bubble-wave i { width: 2.5px; border-radius: 2px; background: color-mix(in srgb, var(--paper) 70%, transparent); animation: wave 1.1s ease-in-out infinite; }
.bubble-wave i:nth-child(1) { height: 7px; animation-delay: 0s; }
.bubble-wave i:nth-child(2) { height: 14px; animation-delay: .12s; }
.bubble-wave i:nth-child(3) { height: 20px; animation-delay: .24s; }
.bubble-wave i:nth-child(4) { height: 12px; animation-delay: .36s; }
.bubble-wave i:nth-child(5) { height: 6px; animation-delay: .48s; }
@keyframes wave { 0%, 100% { transform: scaleY(.5); } 50% { transform: scaleY(1); } }
.bubble-text { font-family: var(--serif); font-size: 15px; line-height: 1.1; }
.bubble-text small { display: block; font-family: var(--sans); font-size: 9px; letter-spacing: .1em; color: color-mix(in srgb, var(--paper) 55%, transparent); margin-top: 3px; }

/* ---------- import ---------- */
.import-grid { display: grid; grid-template-columns: 1.55fr .85fr; gap: 20px; margin-top: 8px; }
.upload-card {
  position: relative; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--card) 72%, transparent);
  padding: 42px 36px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s, transform .2s;
  min-height: 290px;
}
.upload-card:hover, .upload-card:focus-visible, .upload-card.dragging {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 22%, var(--card));
  outline: none; transform: translateY(-2px);
}
.upload-icon {
  position: relative; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 18px;
}
.upload-icon .icon { width: 26px; height: 26px; }
.upload-ring { position: absolute; inset: -7px; border-radius: 50%; border: 1px dashed color-mix(in srgb, var(--accent) 35%, transparent); animation: spin 18s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.upload-card h2 { font-size: 24px; letter-spacing: -.01em; }
.upload-desc { color: var(--muted); margin-top: 7px; font-size: 13.5px; }
.upload-desc kbd { margin: 0 2px; }
.upload-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.upload-note { margin-top: 18px; color: var(--muted-2); font-size: 11px; letter-spacing: .015em; }
.upload-corners span { position: absolute; width: 16px; height: 16px; border-color: var(--line-strong); border-style: solid; }
.upload-corners span:nth-child(1) { top: 16px; left: 16px; border-width: 1.5px 0 0 1.5px; border-radius: 5px 0 0 0; }
.upload-corners span:nth-child(2) { top: 16px; right: 16px; border-width: 1.5px 1.5px 0 0; border-radius: 0 5px 0 0; }
.upload-corners span:nth-child(3) { bottom: 16px; left: 16px; border-width: 0 0 1.5px 1.5px; border-radius: 0 0 0 5px; }
.upload-corners span:nth-child(4) { bottom: 16px; right: 16px; border-width: 0 1.5px 1.5px 0; border-radius: 0 0 5px 0; }
.side-stack { display: flex; flex-direction: column; gap: 16px; }
.quick-card { padding: 20px 20px 16px; }
.quick-packs { display: flex; flex-direction: column; gap: 7px; }
.quick-pack {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px;
  border: 1px solid transparent; border-radius: 11px; background: transparent; text-align: left;
  transition: background .16s, border-color .16s;
}
.quick-pack:hover { background: var(--paper-2); border-color: var(--line); }
.quick-pack-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.quick-pack-icon .icon { width: 17px; height: 17px; }
.quick-pack-body { flex: 1; min-width: 0; }
.quick-pack-body b { display: block; font-size: 13px; font-weight: 600; }
.quick-pack-body small { display: block; color: var(--muted-2); font-size: 10.5px; margin-top: 1px; }
.quick-pack > .icon { width: 14px; height: 14px; color: var(--muted-2); }
.quick-card .text-link { margin-top: 10px; }
.tip-card { display: flex; gap: 12px; align-items: flex-start; padding: 18px 20px; }
.tip-card .tip-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; flex: none; }
.tip-card .tip-icon .icon { width: 17px; height: 17px; }
.tip-card b { font-size: 12.5px; }
.tip-card p { color: var(--muted); font-size: 11.5px; line-height: 1.65; margin-top: 3px; }

/* ---------- features ---------- */
.features { margin-top: 76px; }
.section-head { max-width: 620px; margin-bottom: 26px; }
.section-head h2 { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.02em; }
.section-head > p:not(.eyebrow) { color: var(--muted); margin-top: 9px; font-size: 14px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feature-card {
  position: relative; overflow: hidden; padding: 24px 22px 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: transform .22s, box-shadow .22s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.feature-num { position: absolute; right: 14px; top: 8px; font-family: var(--serif); font-size: 54px; line-height: 1; color: color-mix(in srgb, var(--ink) 6%, transparent); }
.feature-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.feature-card:nth-child(2) .feature-icon { background: var(--sage-soft); color: var(--sage); }
.feature-card:nth-child(3) .feature-icon { background: var(--sky-soft); color: var(--sky); }
.feature-card:nth-child(4) .feature-icon { background: var(--gold-soft); color: var(--gold); }
.feature-icon .icon { width: 20px; height: 20px; }
.feature-card h3 { font-size: 17px; margin-bottom: 6px; }
.feature-card p { color: var(--muted); font-size: 12.5px; line-height: 1.7; }

/* ---------- recent strip ---------- */
.recent-strip { margin-top: 54px; }
.recent-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.recent-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.recent-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-align: left; transition: border-color .16s, transform .16s; }
.recent-item:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.recent-score { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; background: var(--ok-soft); color: var(--ok); }
.recent-score.low { background: var(--bad-soft); color: var(--bad); }
.recent-body { min-width: 0; flex: 1; }
.recent-body b { font-size: 13px; display: block; }
.recent-body small { color: var(--muted-2); font-size: 10.5px; }

/* ---------- review ---------- */
.review-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 22px; align-items: start; }
.review-aside { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 96px; }
.image-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.image-card-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 11px; letter-spacing: .04em; text-transform: uppercase; }
.image-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.image-thumb { width: 72px; height: 90px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); cursor: zoom-in; padding: 0; background: var(--paper-2); }
.image-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.image-card .text-link { margin-top: 11px; font-size: 12px; }
.stats-card { padding: 16px 18px; }
.stat-line { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 12.5px; color: var(--muted); }
.stat-line b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mini-tip { display: flex; gap: 10px; padding: 14px 16px; align-items: flex-start; }
.mini-tip .icon { width: 16px; height: 16px; color: var(--gold); margin-top: 2px; }
.mini-tip p { font-size: 11.5px; color: var(--muted); line-height: 1.65; }
.review-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.word-chips { display: flex; flex-wrap: wrap; gap: 9px; padding: 22px 24px 18px; min-height: 130px; align-content: flex-start; }
.word-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 8px 7px 9px;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.word-chip:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.word-chip.low { border-style: dashed; border-color: var(--gold); }
.chip-index { font-family: var(--mono); font-size: 9.5px; color: var(--muted-2); min-width: 14px; text-align: right; }
.chip-input {
  border: 0; background: transparent; padding: 0; outline: none;
  font-family: var(--serif); font-size: 17px; color: var(--ink);
  min-width: 24px; max-width: 220px;
}
.chip-remove { width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: var(--muted-2); display: grid; place-items: center; }
.chip-remove:hover { background: var(--bad-soft); color: var(--bad); }
.chip-remove .icon { width: 11px; height: 11px; }
.add-word-row { display: flex; align-items: center; gap: 8px; padding: 14px 24px 18px; border-top: 1px solid var(--line); }
.add-word-row > .icon { color: var(--muted-2); width: 15px; height: 15px; }
.add-word-row input { flex: 1; border: 0; outline: none; background: transparent; font-size: 13.5px; min-width: 0; }
.add-word-row input::placeholder { color: var(--muted-2); }
.word-empty { width: 100%; text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0; }
.settings-panel .panel-head { padding-bottom: 16px; }
.setting-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; padding: 20px 24px 24px; }
.setting-item { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.setting-item > label { font-size: 11.5px; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.setting-item > label small { font-weight: 400; color: var(--muted-2); font-size: 10.5px; }
.setting-item > label > span { color: var(--ink); font-family: var(--mono); font-size: 11px; font-weight: 500; }
.switch-item { flex-direction: row; align-items: center; justify-content: space-between; }
.segmented { display: inline-flex; padding: 3px; background: var(--paper-2); border-radius: 10px; border: 1px solid var(--line); gap: 2px; width: fit-content; max-width: 100%; }
.segmented button { border: 0; background: transparent; border-radius: 7px; padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: all .15s; }
.segmented button:hover { color: var(--ink); }
.segmented button.active { background: var(--card-solid); color: var(--ink); box-shadow: 0 1px 4px rgba(40,30,15,.12); font-weight: 600; }
.select {
  height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--card-solid);
  padding: 0 30px 0 11px; font-size: 12.5px; outline: none; min-width: 0; width: 100%;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.voice-row { display: flex; gap: 6px; align-items: center; }
.voice-row .select { flex: 1; }
.voice-row .tool-btn { height: 38px; width: 38px; justify-content: center; padding: 0; flex: none; }
input[type="range"] {
  width: 100%; height: 22px; appearance: none; background: transparent; outline: none; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 3px; background: var(--line-strong); }
input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--accent);
  margin-top: -6px; border: 3px solid var(--card-solid); box-shadow: 0 1px 4px rgba(0,0,0,.18); cursor: pointer;
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 3px; background: var(--line-strong); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--card-solid); cursor: pointer; }
.switch { position: relative; width: 40px; height: 23px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--line-strong); transition: background .18s; }
.switch span::after { content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%; background: var(--card-solid); top: 3px; left: 3px; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(17px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.review-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 22px; background: var(--ink); color: var(--paper);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.review-footer b { font-family: var(--serif); font-size: 22px; }
.review-footer small { display: block; color: color-mix(in srgb, var(--paper) 55%, transparent); font-size: 10.5px; margin-top: 2px; letter-spacing: .02em; }
.review-footer .btn-primary { background: var(--accent); }

/* ---------- dictation ---------- */
.view-dictation { max-width: 1120px; }
.dictation-top { display: flex; align-items: center; gap: 22px; margin: 4px 0 26px; }
.progress-wrap { flex: 1; }
.progress-track { height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--gold))); transition: width .45s cubic-bezier(.2,.7,.2,1); }
.progress-meta { display: flex; justify-content: space-between; margin-top: 7px; font-size: 10.5px; color: var(--muted); font-family: var(--mono); letter-spacing: .03em; }
.score-pills { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 9px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill .icon { width: 12px; height: 12px; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.dictation-layout { display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 22px; align-items: start; }
.dictation-main { min-width: 0; }
.word-card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 26px clamp(24px, 4vw, 46px) 30px; overflow: hidden;
}
.word-card::before { content: ""; position: absolute; top: -100px; right: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 9%, transparent), transparent 68%); pointer-events: none; }
.word-card-top { display: flex; align-items: center; justify-content: space-between; }
.mode-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mode-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); animation: pulseDot 1.8s ease-in-out infinite; }
@keyframes pulseDot { 50% { box-shadow: 0 0 0 7px transparent; } }
.word-index { font-family: var(--mono); font-size: 11px; color: var(--muted-2); }
.speak-btn {
  position: relative; display: grid; place-items: center; width: 108px; height: 108px; margin: 30px auto 16px;
  border: 0; border-radius: 50%; color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 88%, #ffb08c), var(--accent-2));
  box-shadow: 0 20px 34px -16px rgba(217,85,47,.8), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform .18s ease, box-shadow .18s ease;
}
.speak-btn:hover { transform: scale(1.035); box-shadow: 0 24px 40px -16px rgba(217,85,47,.85); }
.speak-btn:active { transform: scale(.98); }
.speak-btn .icon { width: 38px; height: 38px; stroke-width: 1.6; }
.speak-ring { position: absolute; inset: -9px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); opacity: 0; }
.speak-btn.speaking .speak-ring { animation: ringPulse 1.5s ease-out infinite; }
.speak-btn.speaking .ring-2 { animation-delay: .55s; }
@keyframes ringPulse { 0% { transform: scale(.92); opacity: .7; } 100% { transform: scale(1.38); opacity: 0; } }
.sound-wave { display: flex; justify-content: center; align-items: center; gap: 3px; height: 20px; margin-bottom: 4px; }
.sound-wave i { width: 3px; height: 5px; border-radius: 3px; background: var(--line-strong); transition: height .15s; }
.sound-wave.active i { background: var(--accent); animation: bar 1s ease-in-out infinite; }
.sound-wave.active i:nth-child(1) { height: 7px; animation-delay: 0s; }
.sound-wave.active i:nth-child(2) { height: 14px; animation-delay: .1s; }
.sound-wave.active i:nth-child(3) { height: 19px; animation-delay: .2s; }
.sound-wave.active i:nth-child(4) { height: 11px; animation-delay: .3s; }
.sound-wave.active i:nth-child(5) { height: 17px; animation-delay: .4s; }
.sound-wave.active i:nth-child(6) { height: 9px; animation-delay: .5s; }
.sound-wave.active i:nth-child(7) { height: 5px; animation-delay: .6s; }
@keyframes bar { 0%, 100% { transform: scaleY(.6); } 50% { transform: scaleY(1.15); } }
.word-meta { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 20px; min-height: 20px; }
.hint-box { margin: 0 auto 16px; max-width: 480px; padding: 11px 15px; border-radius: 11px; background: var(--gold-soft); color: color-mix(in srgb, var(--gold) 78%, var(--ink)); font-size: 12.5px; display: flex; gap: 8px; align-items: center; justify-content: center; text-align: center; }
.hint-box .icon { width: 15px; height: 15px; flex: none; }
.hint-box b { font-family: var(--serif); font-size: 16px; letter-spacing: .06em; }
.answer-field { position: relative; max-width: 560px; margin: 0 auto; }
.answer-field input {
  width: 100%; height: 64px; border: 0; border-bottom: 2px solid var(--line-strong); border-radius: 0;
  background: transparent; text-align: center; outline: none;
  font-family: var(--serif); font-size: clamp(26px, 3.4vw, 34px); letter-spacing: .06em; color: var(--ink);
  transition: border-color .2s;
}
.answer-field input::placeholder { font-family: var(--sans); font-size: 13.5px; letter-spacing: .02em; color: var(--muted-2); }
.answer-field input:focus { border-color: var(--accent); }
.answer-field input:disabled { color: var(--muted); }
.letter-count { position: absolute; right: 2px; bottom: 10px; font-family: var(--mono); font-size: 10px; color: var(--muted-2); }
.answer-actions { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 18px; flex-wrap: wrap; }
.action-btn { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--card-solid); color: var(--muted); font-size: 11.5px; font-weight: 600; transition: all .15s; }
.action-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.action-btn .icon { width: 14px; height: 14px; }
.action-btn kbd { height: 17px; font-size: 9px; background: var(--paper-2); border-color: var(--line); }
.action-btn.subtle { border-color: transparent; background: transparent; }
.answer-submit { height: 36px; padding: 0 16px; font-size: 12.5px; border-radius: 9px; margin-left: 4px; }
.answer-submit kbd { height: 17px; font-size: 9px; background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
.feedback { margin-top: 20px; border-radius: 14px; padding: 16px 18px; display: flex; align-items: flex-start; gap: 12px; animation: feedbackIn .25s ease; }
@keyframes feedbackIn { from { opacity: 0; transform: translateY(6px); } }
.feedback.correct { background: var(--ok-soft); }
.feedback.wrong { background: var(--bad-soft); }
.fb-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--card-solid); }
.feedback.correct .fb-icon { color: var(--ok); }
.feedback.wrong .fb-icon { color: var(--bad); }
.fb-body { flex: 1; min-width: 0; }
.fb-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.feedback.correct .fb-title { color: var(--ok); }
.feedback.wrong .fb-title { color: var(--bad); }
.answer-diff { font-family: var(--serif); font-size: 22px; letter-spacing: .04em; line-height: 1.35; }
.diff-ok { color: var(--ok); }
.diff-missing { color: var(--bad); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }
.diff-extra { color: var(--bad); text-decoration: line-through; opacity: .65; }
.fb-sub { color: var(--muted); font-size: 11.5px; margin-top: 5px; }
.fb-actions { display: flex; gap: 7px; margin-top: 10px; }
.fb-actions .btn { height: 32px; padding: 0 12px; font-size: 11.5px; border-radius: 8px; }
.key-hints { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 16px; color: var(--muted-2); font-size: 10.5px; flex-wrap: wrap; }
.key-hints .icon { width: 14px; height: 14px; }
.key-hints span { display: inline-flex; align-items: center; gap: 5px; }
.dictation-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 96px; }
.progress-card .card-head { margin-bottom: 13px; }
.word-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.word-dot { aspect-ratio: 1; border-radius: 8px; background: var(--paper-2); color: var(--muted-2); display: grid; place-items: center; font-family: var(--mono); font-size: 9.5px; border: 1px solid transparent; transition: all .2s; }
.word-dot.current { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.word-dot.correct { background: var(--ok-soft); color: var(--ok); }
.word-dot.wrong { background: var(--bad-soft); color: var(--bad); }
.score-card { display: flex; flex-direction: column; gap: 10px; }
.score-mini { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.score-mini b { font-family: var(--mono); font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.rotating-tip { min-height: 98px; }

/* ---------- result ---------- */
.result-wrap { max-width: 1000px; margin: 0 auto; }
.result-view-head { align-items: flex-start; }
.result-hero { display: flex; align-items: center; gap: clamp(28px, 5vw, 60px); margin: 8px 0 30px; padding: 30px 0 10px; }
.score-ring { position: relative; width: 208px; height: 208px; flex: none; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring-bg { stroke: var(--line); }
.ring-fg { stroke: var(--accent); stroke-dasharray: 477.5; stroke-dashoffset: 477.5; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1); }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-text b { font-family: var(--serif); font-size: 52px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: lining-nums; }
.ring-text span { font-size: 10px; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; margin-top: 8px; }
.result-copy { flex: 1; min-width: 0; }
.grade-chip { display: inline-flex; align-items: center; height: 25px; padding: 0 10px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.result-copy h2 { font-size: clamp(27px, 3.4vw, 38px); letter-spacing: -.02em; margin-top: 10px; }
.result-note { color: var(--muted); font-size: 13.5px; margin-top: 8px; max-width: 520px; }
.result-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.stat-tile { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 11px 13px; }
.stat-tile b { display: block; font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.stat-tile span { font-size: 10px; color: var(--muted); letter-spacing: .03em; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.result-words-panel { margin-top: 8px; }
.legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 6px; height: 6px; border-radius: 50%; }
.dot-ok { background: var(--ok); }
.dot-bad { background: var(--bad); }
.result-words { padding: 8px 12px 14px; }
.result-word { display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 11px; }
.result-word + .result-word { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.result-word-status { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.result-word-status .icon { width: 12px; height: 12px; }
.result-word.ok .result-word-status { background: var(--ok-soft); color: var(--ok); }
.result-word.bad .result-word-status { background: var(--bad-soft); color: var(--bad); }
.result-word-main { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.result-word-main b { font-family: var(--serif); font-size: 19px; font-weight: 400; letter-spacing: .02em; }
.result-word-main span { font-size: 11.5px; color: var(--muted); }
.result-word-extra { font-size: 11px; color: var(--bad); font-family: var(--mono); }
.result-word-extra s { opacity: .6; }
.result-word .icon-btn { width: 30px; height: 30px; border-radius: 8px; color: var(--muted); }
.result-word .icon-btn:hover { color: var(--accent); }
.result-history-tease { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.result-history-tease b { font-size: 13px; }
.result-history-tease span { color: var(--muted); font-size: 11.5px; }

/* ---------- library ---------- */
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.search-box { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 14px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; flex: 1; max-width: 420px; }
.search-box .icon { width: 16px; height: 16px; color: var(--muted-2); }
.search-box input { border: 0; outline: none; background: transparent; flex: 1; font-size: 13px; min-width: 0; }
.search-box:focus-within { border-color: var(--accent); }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip { height: 32px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.filter-chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pack-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pack-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; }
.pack-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.pack-top { display: flex; align-items: flex-start; gap: 13px; }
.pack-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.pack-icon .icon { width: 22px; height: 22px; }
.tone-sage { background: var(--sage-soft); color: var(--sage); }
.tone-clay { background: var(--accent-soft); color: var(--accent); }
.tone-rose { background: var(--rose-soft); color: var(--rose); }
.tone-gold { background: var(--gold-soft); color: var(--gold); }
.tone-sky { background: var(--sky-soft); color: var(--sky); }
.tone-violet { background: var(--violet-soft); color: var(--violet); }
.pack-title { flex: 1; min-width: 0; }
.pack-title h3 { font-size: 17px; }
.pack-title small { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); }
.pack-level { font-size: 10px; font-weight: 700; letter-spacing: .08em; padding: 4px 8px; border-radius: 6px; background: var(--paper-2); color: var(--muted); flex: none; }
.pack-desc { color: var(--muted); font-size: 12px; line-height: 1.65; margin: 12px 0 14px; }
.pack-words { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 16px; }
.pack-word { font-family: var(--serif); font-size: 13px; padding: 3px 8px; border-radius: 6px; background: var(--paper-2); color: var(--ink-2); }
.pack-word mark { background: var(--gold-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.pack-actions { display: flex; align-items: center; gap: 7px; margin-top: auto; }
.pack-actions .btn { height: 36px; font-size: 12px; padding: 0 13px; border-radius: 9px; }
.pack-count { margin-left: auto; font-size: 10.5px; color: var(--muted-2); }
.pack-card.expanded .pack-words { max-height: none; }
.pack-card .pack-words.expanded { max-height: none; }
.library-cta { margin-top: 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 28px; border-radius: var(--radius); background: var(--ink); color: var(--paper); }
.library-cta h3 { font-size: 20px; margin: 5px 0 4px; }
.library-cta p { font-size: 12px; color: color-mix(in srgb, var(--paper) 60%, transparent); }
.library-cta .card-kicker { color: color-mix(in srgb, var(--paper) 50%, transparent); }

/* ---------- wrongbook ---------- */
.wrong-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.wrong-stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.wrong-stat b { display: block; font-family: var(--serif); font-size: 28px; line-height: 1.2; }
.wrong-stat span { font-size: 11px; color: var(--muted); }
.wrong-list { padding: 6px 10px; }
.wrong-row { display: flex; align-items: center; gap: 13px; padding: 12px 12px; border-radius: 12px; }
.wrong-row + .wrong-row { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.wrong-row:hover { background: color-mix(in srgb, var(--paper-2) 45%, transparent); }
.wrong-check { position: relative; width: 19px; height: 19px; flex: none; }
.wrong-check input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.wrong-check span { position: absolute; inset: 0; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--card-solid); pointer-events: none; }
.wrong-check input:checked + span { background: var(--accent); border-color: var(--accent); }
.wrong-check input:checked + span::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.wrong-word { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wrong-word b { font-family: var(--serif); font-size: 20px; font-weight: 400; }
.wrong-word span { font-size: 11.5px; color: var(--muted); }
.wrong-count { font-size: 10px; font-weight: 700; color: var(--bad); background: var(--bad-soft); border-radius: 6px; padding: 2px 7px; }
.wrong-meta { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.wrong-row .icon-btn { width: 30px; height: 30px; }
.wrong-footer { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.wrong-footer > span { margin-right: auto; font-size: 11.5px; color: var(--muted); }
.check-all { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.check-all input { accent-color: var(--accent); }
.empty-state { text-align: center; padding: 60px 24px 66px; }
.empty-icon { width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); color: var(--muted-2); }
.empty-icon .icon { width: 26px; height: 26px; }
.empty-state h3 { font-size: 17px; }
.empty-state p { color: var(--muted); font-size: 12.5px; margin: 6px 0 18px; }

/* ---------- history ---------- */
.history-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.history-stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 17px 18px; display: flex; align-items: center; gap: 13px; }
.history-stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.history-stat-icon .icon { width: 18px; height: 18px; }
.history-stat:nth-child(2) .history-stat-icon { background: var(--sage-soft); color: var(--sage); }
.history-stat:nth-child(3) .history-stat-icon { background: var(--sky-soft); color: var(--sky); }
.history-stat:nth-child(4) .history-stat-icon { background: var(--gold-soft); color: var(--gold); }
.history-stat b { display: block; font-family: var(--serif); font-size: 23px; line-height: 1.2; }
.history-stat span { font-size: 10.5px; color: var(--muted); }
.chart-panel { margin-bottom: 16px; }
.week-chart { display: flex; align-items: stretch; gap: 10px; height: 190px; padding: 22px 26px 18px; }
.day-bar { flex: 1; display: grid; grid-template-rows: 18px minmax(0, 1fr) 16px; align-items: end; justify-items: center; gap: 5px; height: 100%; }
.bar-fill { width: 100%; max-width: 46px; min-height: 4px; border-radius: 7px 7px 3px 3px; background: linear-gradient(to top, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--gold))); opacity: .85; transition: height .5s cubic-bezier(.2,.7,.2,1); align-self: end; }
.day-bar.today .bar-fill { opacity: 1; box-shadow: 0 0 0 2px var(--accent-soft); }
.bar-count { font-family: var(--mono); font-size: 10px; color: var(--muted); align-self: end; }
.bar-label { font-size: 10px; color: var(--muted-2); align-self: end; }
.session-panel { overflow: hidden; }
.session-list { padding: 6px 10px 12px; }
.session-row { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 12px; }
.session-row + .session-row { border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.session-score { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: 12px; flex: none; font-variant-numeric: tabular-nums; }
.session-score.mid { background: var(--gold-soft); color: var(--gold); }
.session-score.low { background: var(--bad-soft); color: var(--bad); }
.session-body { flex: 1; min-width: 0; }
.session-body b { display: block; font-size: 12.5px; }
.session-body small { color: var(--muted-2); font-size: 10.5px; }
.session-actions { display: flex; gap: 6px; }
.session-actions .tool-btn { height: 30px; font-size: 11px; }

/* ---------- footer ---------- */
.site-footer {
  max-width: 1200px; margin: 0 auto; padding: 26px clamp(20px, 4vw, 48px) 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line); color: var(--muted);
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.footer-meta { display: flex; gap: 16px; font-size: 10.5px; }
.footer-meta span { display: inline-flex; align-items: center; gap: 5px; }
.footer-meta .icon { width: 13px; height: 13px; }

/* ---------- processing overlay ---------- */
.processing-overlay { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--ink) 38%, transparent); backdrop-filter: blur(9px); }
.processing-overlay[hidden] { display: none; }
.processing-card {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 30px;
  width: min(780px, 100%); padding: 30px; border-radius: 26px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: popIn .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(10px); } }
.processing-visual { position: relative; }
.proc-photo { position: relative; height: 350px; border-radius: 14px; overflow: hidden; background: var(--paper-2); border: 1px solid var(--line); }
.proc-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.proc-scan { position: absolute; left: 0; right: 0; top: 0; height: 80px; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--accent) 22%, transparent)); border-bottom: 2px solid var(--accent); animation: procScan 2.4s ease-in-out infinite; }
@keyframes procScan { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(265px); } }
.proc-ring { position: absolute; right: -26px; bottom: -22px; width: 92px; height: 92px; border-radius: 50%; background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; place-items: center; }
.proc-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.proc-ring circle { fill: none; stroke-width: 6; }
.proc-ring-bg { stroke: var(--line); }
.proc-ring-fg { stroke: var(--accent); stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .3s; }
.proc-ring b { font-family: var(--mono); font-size: 13px; position: relative; }
.processing-copy { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.processing-copy h2 { font-size: 26px; letter-spacing: -.01em; }
.processing-copy > p:not(.eyebrow):not(.proc-note) { color: var(--muted); font-size: 13px; margin-top: 6px; }
.proc-progress { height: 4px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 18px 0; }
.proc-progress span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .3s; }
.proc-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; }
.proc-steps li { display: grid; grid-template-columns: 16px 1fr; gap: 2px 10px; align-items: center; font-size: 12px; color: var(--muted-2); }
.proc-steps li i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); grid-row: span 2; display: block; position: relative; }
.proc-steps li small { font-size: 10.5px; color: var(--muted-2); grid-column: 2; }
.proc-steps li.active { color: var(--ink); }
.proc-steps li.active i { border-color: var(--accent); }
.proc-steps li.active i::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); animation: pulseDot 1.4s infinite; }
.proc-steps li.done { color: var(--muted); }
.proc-steps li.done i { background: var(--ok); border-color: var(--ok); }
.proc-steps li.done i::after { content: ""; position: absolute; left: 4px; top: 1.5px; width: 3.5px; height: 7px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.proc-note { display: flex; gap: 7px; align-items: flex-start; margin-top: 18px; font-size: 10.5px; color: var(--muted-2); }
.proc-note .icon { width: 14px; height: 14px; flex: none; }

/* ---------- modals ---------- */
dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 26px;
  border: 1px solid var(--line); border-radius: 24px; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow-lg); overflow: auto;
}
dialog.modal::backdrop { background: color-mix(in srgb, var(--ink) 42%, transparent); backdrop-filter: blur(6px); }
dialog.modal-wide { width: min(700px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.modal-head h2 { font-size: 24px; }
.modal-desc { color: var(--muted); font-size: 12.5px; margin: 10px 0 12px; }
.modal-head .eyebrow { margin-bottom: 4px; }
.modal-close { margin: -4px -8px 0 0; }
textarea#pasteInput {
  width: 100%; min-height: 190px; resize: vertical; border: 1px solid var(--line); border-radius: 13px;
  background: var(--card-solid); padding: 13px 15px; outline: none; font-family: var(--mono); font-size: 13px; line-height: 1.8;
}
textarea#pasteInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.paste-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted-2); font-size: 10.5px; margin-top: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.settings-sections { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.settings-section { padding: 16px 0; border-top: 1px solid var(--line); }
.settings-section:first-child { border-top: 0; }
.settings-section h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 13px; }
.settings-section h3 .icon { width: 16px; height: 16px; color: var(--muted); }
.settings-section .setting-item { margin-bottom: 14px; }
.settings-section .setting-item:last-child { margin-bottom: 0; }
.settings-note { color: var(--muted); font-size: 11.5px; line-height: 1.7; margin-bottom: 12px; }
.data-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.shortcut-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.shortcut-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
dialog.lightbox { width: min(820px, calc(100vw - 32px)); }
dialog.lightbox img { max-height: 72vh; width: auto; max-width: 100%; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); }

/* ---------- toast / confetti ---------- */
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px); z-index: 200;
  max-width: min(520px, calc(100vw - 40px)); padding: 11px 16px; border-radius: 11px;
  background: var(--ink); color: var(--paper); font-size: 12.5px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: var(--ok); color: #fff; }
.toast.error { background: var(--bad); color: #fff; }
#confettiCanvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 150; }
[hidden] { display: none !important; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .hero-copy h1 { font-size: clamp(42px, 5.4vw, 62px); }
  .art-photo { width: 280px; height: 380px; }
  .art-photo img { object-position: top; }
  .hero-art { min-height: 470px; }
  .chip-1 { right: 0; }
  .chip-2 { right: 4%; }
  .art-bubble { right: 0; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .recent-list { grid-template-columns: repeat(2, 1fr); }
  .history-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; padding-top: 16px; }
  .hero-art { display: none; }
  .hero-copy { max-width: 680px; }
  .import-grid { grid-template-columns: 1fr; }
  .side-stack { flex-direction: row; }
  .side-stack > .side-card { flex: 1; }
  .review-layout { grid-template-columns: 1fr; }
  .review-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .review-aside > .image-card { flex: 1 1 260px; }
  .review-aside > .side-card { flex: 1 1 200px; }
  .dictation-layout { grid-template-columns: 1fr; }
  .dictation-side { position: static; display: grid; grid-template-columns: 1.3fr 1fr; }
  .dictation-side .tip-card { display: none; }
  .result-hero { flex-direction: column; align-items: flex-start; gap: 26px; }
  .score-ring { width: 168px; height: 168px; }
  .ring-text b { font-size: 42px; }
  .pack-grid { grid-template-columns: 1fr; }
  .wrong-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  body { padding-bottom: 74px; }
  .topbar { position: static; height: 64px; padding: 0 16px; gap: 12px; }
  .brand-text small { display: none; }
  .logo-mark { width: 36px; height: 36px; font-size: 20px; }
  .brand-text b { font-size: 16px; }
  .topbar-actions .icon-btn { width: 36px; height: 36px; }
  .main-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    height: 66px; margin: 0; padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--card-solid) 94%, transparent);
    border-top: 1px solid var(--line); backdrop-filter: blur(18px);
    display: flex; justify-content: space-around; gap: 0;
  }
  .nav-btn { flex: 1; flex-direction: column; gap: 3px; height: 52px; padding: 0; font-size: 9.5px; border-radius: 12px; }
  .nav-btn .icon { width: 19px; height: 19px; }
  .nav-btn.active { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
  .nav-btn.active::after { display: none; }
  .nav-badge { position: absolute; top: 5px; right: calc(50% - 20px); min-width: 15px; height: 15px; font-size: 9px; }
  .view { padding: 22px 16px 50px; }
  .hero { min-height: 0; padding: 12px 0 34px; }
  .hero-copy h1 { font-size: clamp(38px, 11vw, 52px); }
  .lede { font-size: 14px; margin-top: 16px; }
  .hero-actions { margin-top: 22px; }
  .hero-actions .btn { flex: 1; }
  .hero-meta { gap: 8px 14px; margin-top: 20px; }
  .upload-card { padding: 32px 20px; min-height: 260px; }
  .upload-card h2 { font-size: 21px; }
  .upload-desc { font-size: 12.5px; }
  .side-stack { flex-direction: column; }
  .features { margin-top: 50px; }
  .feature-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .feature-card { padding: 18px 16px; }
  .feature-card p { font-size: 11.5px; }
  .recent-list { grid-template-columns: 1fr; }
  .view-head { flex-direction: column; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
  .view-head h1 { font-size: 28px; }
  .review-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .review-aside > .image-card { grid-column: 1 / -1; }
  .review-aside > .stats-card { grid-column: 1 / -1; }
  .review-aside > .mini-tip { display: none; }
  .panel-head { padding: 15px 16px; flex-wrap: wrap; }
  .word-chips { padding: 16px; }
  .add-word-row { padding: 12px 16px 16px; }
  .setting-grid { padding: 16px; grid-template-columns: 1fr; gap: 14px; }
  .review-footer { padding: 16px; flex-direction: column; align-items: stretch; gap: 12px; }
  .review-footer .btn { width: 100%; }
  .dictation-top { gap: 12px; flex-wrap: wrap; }
  .dictation-top .btn { font-size: 11px; padding: 0 10px; }
  .progress-wrap { order: 3; flex-basis: 100%; }
  .word-card { padding: 20px 18px 24px; border-radius: 22px; }
  .speak-btn { width: 92px; height: 92px; margin-top: 24px; }
  .speak-btn .icon { width: 32px; height: 32px; }
  .answer-field input { font-size: 26px; }
  .answer-actions { gap: 5px; }
  .action-btn { padding: 0 8px; font-size: 10.5px; }
  .action-btn kbd { display: none; }
  .answer-submit { margin-left: 0; }
  .dictation-side { grid-template-columns: 1fr; }
  .key-hints { display: none; }
  .result-stats { grid-template-columns: repeat(2, 1fr); }
  .result-actions .btn { flex: 1 1 auto; }
  .result-word-main b { font-size: 17px; }
  .wrong-stats { grid-template-columns: 1fr 1fr; }
  .wrong-stats > :last-child { grid-column: span 2; }
  .wrong-row { flex-wrap: wrap; }
  .wrong-meta { width: 100%; padding-left: 45px; }
  .history-summary { grid-template-columns: 1fr 1fr; }
  .week-chart { padding: 18px 14px; gap: 6px; height: 170px; }  .session-row { flex-wrap: wrap; }
  .session-actions { width: 100%; padding-left: 60px; }
  .library-toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
  .library-cta { flex-direction: column; align-items: flex-start; padding: 22px; }
  .site-footer { flex-direction: column; align-items: flex-start; padding: 22px 16px 30px; }
  .footer-meta { flex-wrap: wrap; gap: 10px; }
  .processing-card { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .proc-photo { height: 220px; }
  .proc-ring { right: 10px; bottom: -20px; }
  .processing-copy h2 { font-size: 22px; }
  .proc-steps { display: none; }
  .shortcut-list { grid-template-columns: 1fr; }
  dialog.modal { padding: 20px; border-radius: 20px; }
  .modal-head h2 { font-size: 21px; }
  .toast { bottom: 84px; }
}
@media (max-width: 420px) {
  .feature-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .upload-actions { flex-direction: column; width: 100%; }
  .upload-actions .btn { width: 100%; }
  .result-actions { flex-direction: column; }
  .result-actions .btn { width: 100%; }
  .wrong-stats { grid-template-columns: 1fr; }
  .wrong-stats > :last-child { grid-column: auto; }
  .history-summary { grid-template-columns: 1fr; }
  .segmented button { padding: 6px 9px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important;
}
