:root {
  --ink: #18241e;
  --ink-soft: #39453e;
  --forest: #173f35;
  --forest-deep: #0f2f27;
  --forest-soft: #255645;
  --paper: #f3f0e7;
  --paper-2: #ece7db;
  --card: #fffdf8;
  --card-soft: #faf7ef;
  --line: #e3ddcf;
  --line-strong: #d3cabb;
  --muted: #7c7c70;
  --muted-2: #a09e92;
  --amber: #c98b3e;
  --amber-soft: #f3e4cb;
  --amber-deep: #9c6526;
  --green: #2f6c56;
  --green-soft: #dce9df;
  --red: #b05242;
  --red-soft: #f4dfd9;
  --blue-soft: #dde8ea;
  --shadow-sm: 0 1px 2px rgba(24, 36, 30, 0.04), 0 6px 18px rgba(24, 36, 30, 0.035);
  --shadow-md: 0 14px 40px rgba(24, 36, 30, 0.09);
  --shadow-lg: 0 28px 80px rgba(15, 47, 39, 0.2);
  --radius: 20px;
  --radius-sm: 13px;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
[hidden] { display: none !important; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--green); }
h1, h2, h3, h4, p { margin: 0; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
::selection { background: #e9d3ad; color: var(--ink); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d7d1c4; border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #bfb7a7; border: 2px solid transparent; background-clip: content-box; }

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  padding: 26px 17px 17px;
  color: #eae7da;
  background:
    radial-gradient(circle at 15% 8%, rgba(201, 139, 62, .16), transparent 26%),
    radial-gradient(circle at 90% 75%, rgba(106, 157, 133, .12), transparent 32%),
    linear-gradient(168deg, #19483b 0%, var(--forest) 44%, var(--forest-deep) 100%);
  overflow: hidden;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .3;
  background-image: radial-gradient(rgba(255, 255, 255, .15) .6px, transparent .6px);
  background-size: 14px 14px;
  mask-image: linear-gradient(to bottom, #000, transparent 55%);
}
.sidebar::after {
  content: "Aa";
  position: absolute;
  right: -18px;
  bottom: 92px;
  font-family: var(--serif);
  font-size: 130px;
  line-height: 1;
  color: rgba(255, 255, 255, .035);
  pointer-events: none;
  letter-spacing: -8px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 27px; position: relative; z-index: 1; }
.brand-mark {
  position: relative;
  width: 44px; height: 48px;
  display: grid; place-items: center;
  background: #f5eedf;
  border-radius: 8px 8px 10px 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
.brand-mark::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--amber); border-radius: 8px 0 0 10px;
}
.brand-mark span { font-family: var(--serif); font-size: 29px; font-weight: 700; color: var(--forest); transform: translateY(-2px); }
.brand-mark i {
  position: absolute; right: 7px; top: 7px; width: 6px; height: 12px;
  background: var(--amber); border-radius: 0 0 3px 3px;
}
.brand-mark i::after { content: ""; position: absolute; bottom: -3px; left: 0; border-left: 3px solid var(--amber); border-right: 3px solid var(--amber); border-bottom: 3px solid transparent; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 22px; letter-spacing: 4px; font-weight: 600; color: #f6f2e6; }
.brand-text span { margin-top: 5px; font-size: 8px; letter-spacing: 3px; color: rgba(234, 231, 218, .48); font-weight: 600; }

.nav { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.nav-item {
  position: relative;
  height: 44px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 13px;
  border-radius: 11px;
  color: rgba(238, 235, 224, .72);
  font-size: 13.5px;
  letter-spacing: .2px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  text-align: left;
}
.nav-item svg { width: 18px; height: 18px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .065); color: #fffdf5; }
.nav-item.active {
  color: var(--forest-deep);
  background: #f1ebdd;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
  font-weight: 600;
}
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto;
  min-width: 21px; height: 19px;
  padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: 10px;
  background: rgba(201, 139, 62, .25);
  color: #f2c98d;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
}
.nav-badge.session-badge { min-width: 0; padding: 0 6px; font-size: 8.5px; letter-spacing: .3px; }
.nav-item.active .nav-badge { background: var(--amber-soft); color: var(--amber-deep); }
.sidebar-spacer { flex: 1; min-height: 20px; }
.sidebar-goal {
  position: relative; z-index: 1;
  margin: 0 3px 14px;
  padding: 14px 14px 13px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 14px;
  background: rgba(255, 255, 255, .055);
  backdrop-filter: blur(8px);
}
.goal-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: rgba(240, 237, 226, .62); }
.goal-top strong { color: #f4e9d3; font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-track { height: 5px; margin: 10px 0 8px; background: rgba(255, 255, 255, .12); border-radius: 5px; overflow: hidden; }
.mini-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d69b4d, #f2ca8a); border-radius: inherit; transition: width .5s ease; }
.sidebar-goal p { font-size: 10.5px; color: rgba(240, 237, 226, .45); line-height: 1.5; }
.nav-settings { margin-bottom: 2px; }
.sidebar-foot { position: relative; z-index: 1; display: flex; justify-content: space-between; padding: 12px 7px 0; border-top: 1px solid rgba(255, 255, 255, .08); color: rgba(240, 237, 226, .3); font-size: 9.5px; letter-spacing: .6px; }

/* ---------- Workspace & Topbar ---------- */
.workspace { min-width: 0; height: 100vh; display: flex; flex-direction: column; background: var(--paper); position: relative; }
.workspace::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(24, 36, 30, .035) .55px, transparent .55px);
  background-size: 18px 18px;
  mask-image: linear-gradient(120deg, #000, transparent 55%);
}
.topbar {
  position: relative; z-index: 4;
  min-height: 88px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 34px 12px;
  border-bottom: 1px solid rgba(211, 202, 187, .55);
  background: rgba(243, 240, 231, .86);
  backdrop-filter: blur(12px);
}
.page-heading { display: flex; flex-direction: column; gap: 2px; }
.eyebrow { font-size: 9px; font-weight: 700; letter-spacing: 2.4px; color: var(--muted-2); }
.page-heading h1 { font-size: 25px; line-height: 1.25; letter-spacing: .5px; font-weight: 600; color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.search-trigger {
  height: 39px; width: 232px;
  display: flex; align-items: center; gap: 9px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 248, .75);
  color: var(--muted);
  font-size: 11.5px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search-trigger:hover { border-color: var(--line-strong); background: var(--card); box-shadow: var(--shadow-sm); }
.search-trigger svg { width: 16px; height: 16px; }
.search-trigger span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.search-trigger kbd { margin-left: auto; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; font-family: var(--sans); font-size: 9px; color: var(--muted-2); background: var(--paper); }
.level-picker { position: relative; }
.level-trigger {
  height: 39px; display: flex; align-items: center; gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.level-trigger svg { width: 14px; height: 14px; color: var(--muted); transition: transform .2s; }
.level-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.level-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.level-pop {
  position: absolute; top: calc(100% + 9px); right: 0; z-index: 30;
  width: 270px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-md);
  animation: popIn .16s ease;
}
.pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.pop-head strong { font-size: 12.5px; }
.pop-head span { font-size: 10px; color: var(--muted-2); }
.level-option {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 9px; border-radius: 9px; text-align: left;
  transition: background .15s;
}
.level-option:hover { background: var(--card-soft); }
.level-option .box {
  width: 17px; height: 17px; border: 1.5px solid var(--line-strong); border-radius: 5px;
  display: grid; place-items: center; color: #fff; flex: 0 0 auto;
}
.level-option.checked .box { background: var(--forest); border-color: var(--forest); }
.level-option .box svg { width: 11px; height: 11px; stroke-width: 3; opacity: 0; }
.level-option.checked .box svg { opacity: 1; }
.level-option b { font-size: 12.5px; font-weight: 600; }
.level-option small { margin-left: auto; font-size: 10px; color: var(--muted-2); }
.pop-all { width: 100%; height: 34px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 9px; color: var(--green); font-size: 11px; font-weight: 600; text-align: left; }
.pop-all:hover { color: var(--amber-deep); }

.view-wrap { position: relative; z-index: 1; flex: 1; overflow-y: auto; overflow-x: hidden; }
.view { max-width: 1230px; margin: 0 auto; padding: 28px 34px 46px; animation: viewIn .38s cubic-bezier(.2, .7, .3, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Shared ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 12.5px; font-weight: 600; letter-spacing: .1px;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--forest); color: #f8f4e8; box-shadow: 0 7px 18px rgba(23, 63, 53, .19); }
.btn-primary:hover { background: var(--forest-soft); box-shadow: 0 9px 24px rgba(23, 63, 53, .23); }
.btn-amber { background: var(--amber); color: #fffaf0; box-shadow: 0 7px 18px rgba(201, 139, 62, .22); }
.btn-amber:hover { background: #b97b30; }
.btn-soft { background: var(--card-soft); border-color: var(--line); color: var(--ink-soft); }
.btn-soft:hover { background: #f4efe4; border-color: var(--line-strong); }
.btn-ghost { color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(24, 36, 30, .05); }
.btn-danger { color: var(--red); background: var(--red-soft); }
.btn-danger:hover { background: #efd1c9; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 11px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 13.5px; border-radius: 11px; }
.btn-icon {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--muted);
  transition: .18s;
}
.btn-icon:hover { color: var(--ink); border-color: var(--line-strong); background: var(--card-soft); }
.btn-icon.active { color: #d99a24; background: #fbf0d8; border-color: #e4c493; }
.btn-icon.active svg { fill: currentColor; }
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon.pron-text { font-size: 8.5px; font-weight: 700; letter-spacing: .4px; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 31px; padding: 0 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 11px; font-weight: 600;
  transition: .18s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--forest); border-color: var(--forest); color: #f7f3e7; }
.chip.amber.active { background: var(--amber-soft); border-color: #e3c292; color: var(--amber-deep); }
.chip svg { width: 13px; height: 13px; }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: 5px; font-size: 9px; font-weight: 700; letter-spacing: .5px;
  background: #eef0e8; color: #667065;
  white-space: nowrap;
}
.tag.cet4 { background: #e3eee6; color: #386b50; }
.tag.cet6 { background: #e4ebf0; color: #3d6278; }
.tag.ky { background: #f2e7d6; color: #8a602d; }
.tag.custom { background: #ece5f0; color: #745b80; }
.tag.hot { background: #f5dfcf; color: #9a5325; }
.tag.note { background: #f1e8d2; color: #8b672c; }
.tag.good { background: var(--green-soft); color: var(--green); }
.tag.bad { background: var(--red-soft); color: var(--red); }
.stars { display: inline-flex; gap: 1px; color: var(--amber); }
.stars svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.stars .dim { color: #ded7c8; }
.muted { color: var(--muted); }
.tiny { font-size: 10.5px; }
.serif { font-family: var(--serif); }
.mono { font-variant-numeric: tabular-nums; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.section-head h2 { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.section-head p { color: var(--muted); font-size: 11px; margin-top: 3px; }
.section-head .head-link { font-size: 11px; color: var(--green); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.section-head .head-link svg { width: 13px; height: 13px; }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 240px; padding: 36px 20px; text-align: center; color: var(--muted);
}
.empty .empty-mark {
  width: 62px; height: 62px; display: grid; place-items: center;
  margin-bottom: 15px; border-radius: 50%;
  background: var(--paper-2); color: var(--muted-2);
  font-family: var(--serif); font-size: 27px;
}
.empty h3 { font-size: 14px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.empty p { font-size: 11px; max-width: 300px; }
.empty .btn { margin-top: 16px; }

/* ---------- Home ---------- */
.hero {
  position: relative;
  min-height: 290px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 26px;
  padding: 34px 38px;
  overflow: hidden;
  border-radius: 25px;
  color: #f5f0e3;
  background:
    radial-gradient(circle at 82% 20%, rgba(207, 156, 84, .19), transparent 28%),
    radial-gradient(circle at 16% 100%, rgba(101, 148, 124, .2), transparent 35%),
    linear-gradient(128deg, #1c4a3d, #153b31 55%, #102f27);
  box-shadow: 0 22px 50px rgba(18, 52, 43, .2);
}
.hero::before {
  content: "abandon";
  position: absolute; right: 28px; bottom: -30px;
  font-family: var(--serif); font-size: 114px; font-style: italic;
  color: rgba(255, 255, 255, .035); letter-spacing: -5px; pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .12) .6px, transparent .6px);
  background-size: 17px 17px;
  mask-image: linear-gradient(90deg, #000, transparent 60%);
  opacity: .28;
}
.hero-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; }
.hero-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 9.5px; letter-spacing: 2px; font-weight: 600; color: rgba(242, 234, 216, .58); text-transform: uppercase; }
.hero-eyebrow i { width: 5px; height: 5px; border-radius: 50%; background: #e0aa61; box-shadow: 0 0 0 4px rgba(224, 170, 97, .13); }
.hero h2 { margin: 17px 0 11px; font-size: 35px; line-height: 1.32; font-weight: 600; letter-spacing: 1px; }
.hero h2 em { font-family: var(--serif); font-style: italic; font-weight: 400; color: #e8bd7d; letter-spacing: .5px; }
.hero p { max-width: 470px; color: rgba(242, 238, 226, .58); font-size: 11.5px; line-height: 1.8; }
.hero-actions { display: flex; align-items: center; gap: 10px; margin-top: 23px; }
.hero .btn-primary { background: #f1e8d8; color: var(--forest-deep); box-shadow: 0 8px 22px rgba(0, 0, 0, .2); }
.hero .btn-primary:hover { background: #fff9ea; }
.hero .btn-ghost { color: rgba(245, 240, 227, .66); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); width: 100%; }
.hero-meta span { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: rgba(242, 238, 226, .46); }
.hero-meta svg { width: 13px; height: 13px; }
.hero-meta b { color: #e9c183; font-weight: 600; }
.hero-side { position: relative; z-index: 2; display: flex; align-items: center; justify-content: center; }
.ring-wrap { position: relative; width: 188px; height: 188px; display: grid; place-items: center; }
.ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(#dba85f calc(var(--p, 0) * 1%), rgba(255, 255, 255, .12) 0);
  -webkit-mask: radial-gradient(circle, transparent 61%, #000 62%);
  mask: radial-gradient(circle, transparent 61%, #000 62%);
  transition: background .5s;
}
.ring-center { text-align: center; line-height: 1.1; }
.ring-center strong { display: block; font-family: var(--serif); font-size: 49px; font-weight: 500; color: #f8f1e2; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.ring-center span { display: block; margin-top: 3px; font-size: 9px; color: rgba(242, 238, 226, .45); letter-spacing: 1.5px; }
.ring-center em { display: block; margin-top: 9px; font-style: normal; font-size: 10px; color: #e2b571; }
.hero-side-note { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); font-size: 9px; color: rgba(242, 238, 226, .37); white-space: nowrap; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-top: 15px; }
.stat-card { display: flex; align-items: center; gap: 13px; padding: 16px 17px; background: var(--card); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-sm); }
.stat-ico { width: 37px; height: 37px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.stat-ico svg { width: 17px; height: 17px; }
.stat-ico.green { background: var(--green-soft); color: var(--green); }
.stat-ico.amber { background: var(--amber-soft); color: var(--amber-deep); }
.stat-ico.red { background: var(--red-soft); color: var(--red); }
.stat-ico.blue { background: var(--blue-soft); color: #3f6c73; }
.stat-copy { min-width: 0; }
.stat-copy strong { display: block; font-size: 19px; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-copy span { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; margin-top: 26px; }
.home-grid.lower { grid-template-columns: 1fr 1fr; }
.path-panel { padding: 22px 23px; }
.path-list { display: flex; flex-direction: column; gap: 9px; }
.path-item {
  display: grid; grid-template-columns: 39px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 12px; border: 1px solid transparent; border-radius: 12px;
  transition: .18s; cursor: pointer;
}
.path-item:hover { background: var(--card-soft); border-color: var(--line); }
.path-ico {
  width: 39px; height: 39px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 15px;
  background: var(--paper-2); color: var(--ink-soft);
}
.path-item:nth-child(1) .path-ico { background: #e2ede5; color: #376b51; }
.path-item:nth-child(2) .path-ico { background: #e3ebef; color: #41687e; }
.path-item:nth-child(3) .path-ico { background: #f3e8d7; color: #8b612c; }
.path-main { min-width: 0; }
.path-title { display: flex; align-items: center; gap: 8px; }
.path-title b { font-size: 12.5px; font-weight: 600; }
.path-title small { color: var(--muted-2); font-size: 9.5px; }
.path-track { height: 4px; margin-top: 7px; background: var(--paper-2); border-radius: 4px; overflow: hidden; }
.path-track i { display: block; height: 100%; border-radius: 4px; background: var(--green); }
.path-item:nth-child(2) .path-track i { background: #577f91; }
.path-item:nth-child(3) .path-track i { background: var(--amber); }
.path-stat { text-align: right; }
.path-stat strong { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.path-stat span { display: block; color: var(--muted-2); font-size: 9px; }
.word-day { padding: 23px; position: relative; overflow: hidden; }
.word-day::after { content: "“"; position: absolute; right: 18px; top: 8px; font-family: var(--serif); font-size: 90px; line-height: 1; color: var(--paper-2); }
.word-day-top { display: flex; align-items: center; justify-content: space-between; }
.word-day-word { margin-top: 13px; display: flex; align-items: center; gap: 11px; }
.word-day-word h3 { font-family: var(--serif); font-size: 33px; font-weight: 500; letter-spacing: -.5px; line-height: 1.15; }
.word-day-phon { margin-top: 2px; font-size: 11px; color: var(--muted); letter-spacing: .3px; }
.word-day-trans { margin-top: 12px; font-size: 11.5px; line-height: 1.8; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.word-day-note { margin-top: 14px; padding: 10px 11px; border-radius: 9px; background: var(--amber-soft); color: #77501d; font-size: 10px; line-height: 1.7; }
.word-day-actions { position: relative; z-index: 2; display: flex; align-items: center; gap: 7px; margin-top: 15px; }
.recent-list { display: flex; flex-direction: column; }
.recent-row { display: flex; align-items: center; gap: 11px; padding: 10px 4px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.recent-row:last-child { border-bottom: 0; }
.recent-word { min-width: 100px; }
.recent-word b { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.recent-word span { display: block; color: var(--muted-2); font-size: 9px; }
.recent-mean { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); font-size: 10.5px; }
.recent-wrong { font-size: 9px; color: var(--red); background: var(--red-soft); padding: 2px 6px; border-radius: 5px; white-space: nowrap; }
.panel-pad { padding: 21px 23px; }

/* ---------- Study setup ---------- */
.setup-head { margin-bottom: 22px; }
.setup-head h2 { font-size: 28px; font-weight: 600; letter-spacing: .4px; }
.setup-head p { margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 19px; align-items: start; }
.setup-main { padding: 6px 25px; }
.setup-block { padding: 20px 0; border-bottom: 1px solid var(--line); }
.setup-block:last-child { border-bottom: 0; }
.setup-label { display: flex; align-items: baseline; gap: 10px; margin-bottom: 13px; }
.setup-label em { font-family: var(--serif); font-size: 11px; font-style: italic; color: var(--amber); }
.setup-label strong { font-size: 13px; font-weight: 600; }
.setup-label span { color: var(--muted); font-size: 10px; margin-left: auto; }
.level-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.level-card {
  position: relative; padding: 13px 13px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card-soft);
  transition: .18s;
}
.level-card:hover { border-color: var(--line-strong); background: var(--card); }
.level-card.active { border-color: var(--forest); background: #edf3ed; box-shadow: inset 0 0 0 1px var(--forest); }
.level-card-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.level-card b { font-size: 12.5px; font-weight: 600; }
.level-card small { color: var(--muted); font-size: 9.5px; }
.level-card p { margin-top: 6px; color: var(--muted); font-size: 9.5px; }
.level-card .check-dot {
  width: 15px; height: 15px; border: 1px solid var(--line-strong); border-radius: 50%;
  display: grid; place-items: center; color: #fff;
}
.level-card .check-dot svg { width: 9px; height: 9px; opacity: 0; stroke-width: 3; }
.level-card.active .check-dot { background: var(--forest); border-color: var(--forest); }
.level-card.active .check-dot svg { opacity: 1; }
.direction-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.choice-card {
  padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card-soft); transition: .18s; position: relative;
}
.choice-card:hover { border-color: var(--line-strong); background: var(--card); }
.choice-card.active { border-color: var(--forest); background: #edf3ed; box-shadow: inset 0 0 0 1px var(--forest); }
.choice-card strong { display: block; font-size: 12px; font-weight: 600; }
.choice-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.choice-card .choice-ico { width: 25px; height: 25px; margin-bottom: 9px; border-radius: 7px; background: var(--paper-2); display: grid; place-items: center; color: var(--ink-soft); }
.choice-card .choice-ico svg { width: 14px; height: 14px; }
.choice-card.active .choice-ico { background: var(--forest); color: #fff; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-card { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; text-align: left; background: var(--card-soft); transition: .18s; }
.mode-card:hover { border-color: var(--line-strong); }
.mode-card.active { border-color: var(--amber); background: #f8eddc; }
.mode-card b { display: block; font-size: 11.5px; font-weight: 600; }
.mode-card span { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.review-scope-row { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 10px; }
.review-scope-row > span { font-weight: 600; color: var(--ink-soft); }
.size-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.size-btn { min-width: 57px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--card-soft); font-size: 11.5px; transition: .18s; }
.size-btn.active { border-color: var(--forest); background: var(--forest); color: #fff; }
.custom-size { display: flex; align-items: center; gap: 5px; height: 34px; margin-left: 4px; padding: 0 8px; border: 1px dashed var(--line-strong); border-radius: 8px; color: var(--muted); font-size: 9.5px; }
.custom-size input { width: 39px; height: 23px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); text-align: center; font-size: 11px; outline: none; color: var(--ink); }
.custom-size input:focus { border-color: var(--forest); }
.toggle-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 12px; background: var(--line-strong); transition: background .2s; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.switch.on { background: var(--forest); }
.switch.on::after { transform: translateX(16px); }
.toggle-copy b { display: block; font-size: 11px; font-weight: 600; }
.toggle-copy span { display: block; font-size: 9.5px; color: var(--muted); }
.setup-summary { position: sticky; top: 20px; padding: 23px; overflow: hidden; }
.setup-summary::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--forest), #7ea28c, var(--amber)); }
.summary-kicker { font-size: 9px; letter-spacing: 1.6px; font-weight: 700; color: var(--muted-2); }
.summary-count { display: flex; align-items: baseline; gap: 7px; margin: 8px 0 1px; }
.summary-count strong { font-family: var(--serif); font-size: 48px; font-weight: 500; line-height: 1; letter-spacing: -2px; color: var(--forest); }
.summary-count span { color: var(--muted); font-size: 10px; }
.summary-desc { color: var(--muted); font-size: 10px; line-height: 1.7; min-height: 34px; }
.summary-list { margin: 15px 0 17px; padding: 12px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; }
.summary-item { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); }
.summary-item b { color: var(--ink-soft); font-weight: 600; }
.summary-tip { display: flex; gap: 8px; padding: 10px; margin-bottom: 14px; background: var(--amber-soft); border-radius: 9px; color: #7d5928; font-size: 9.5px; line-height: 1.6; }
.summary-tip svg { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; }
.setup-summary .btn { width: 100%; }

/* ---------- Quiz session ---------- */
.session { max-width: 1070px; margin: 0 auto; }
.session-top { display: flex; align-items: center; gap: 10px; margin-bottom: 21px; flex-wrap: wrap; }
.session-track-wrap { min-width: 130px; }
.session-back, .session-step, .session-score { white-space: nowrap; }
.session-left { display: flex; align-items: center; gap: 12px; }
.session-back, .session-step { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 10.5px; }
.session-back:hover, .session-step:hover { color: var(--ink); }
.session-back svg, .session-step svg { width: 14px; height: 14px; }
.session-step { height: 29px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); }
.session-step:disabled { opacity: .35; }
.session-step:last-child { margin-left: 0; }
.session-track-wrap { flex: 1; display: flex; align-items: center; gap: 12px; }
.session-track { flex: 1; height: 5px; border-radius: 5px; background: var(--paper-2); overflow: hidden; }
.session-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--forest), #6d9a7e); border-radius: inherit; transition: width .4s; }
.session-count { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.session-count b { color: var(--ink); font-weight: 600; }
.session-score { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--green); background: var(--green-soft); padding: 5px 9px; border-radius: 7px; }
.quiz-grid { display: grid; grid-template-columns: minmax(0, 1fr) 318px; gap: 18px; align-items: start; }
.quiz-card { min-height: 485px; padding: 29px 33px 25px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.quiz-card::after { content: ""; position: absolute; right: -55px; top: -55px; width: 170px; height: 170px; border: 1px solid var(--line); border-radius: 50%; opacity: .55; }
.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 2; }
.quiz-tags { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.quiz-topic { font-size: 9.5px; letter-spacing: 1.4px; color: var(--muted-2); font-weight: 700; }
.quiz-prompt { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 20px 0 13px; position: relative; z-index: 2; }
.prompt-instruction { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; margin-bottom: 12px; }
.prompt-instruction svg { width: 13px; height: 13px; color: var(--amber); }
.prompt-word { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; }
.prompt-word h2 { font-family: var(--serif); font-size: clamp(42px, 5vw, 66px); line-height: 1.08; font-weight: 500; letter-spacing: -1.5px; color: var(--ink); word-break: break-word; }
.prompt-zh { font-size: clamp(24px, 2.7vw, 33px); font-weight: 600; line-height: 1.55; letter-spacing: .5px; max-width: 640px; }
.speak-btn { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-2); color: var(--green); transition: .18s; flex: 0 0 auto; }
.speak-btn:hover { background: var(--green-soft); transform: scale(1.05); }
.speak-btn svg { width: 16px; height: 16px; }
.prompt-phon { margin-top: 10px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; letter-spacing: .4px; }
.prompt-phon span { padding-right: 12px; border-right: 1px solid var(--line); }
.prompt-phon span:last-child { border-right: 0; padding-right: 0; }
.answer-zone { position: relative; z-index: 2; }
.answer-input {
  width: 100%; min-height: 82px; resize: vertical;
  padding: 14px 15px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--card-soft); font-size: 14px; line-height: 1.7;
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.answer-input:focus { border-color: var(--forest); background: #fff; box-shadow: 0 0 0 3px rgba(47, 108, 86, .09); }
.answer-input::placeholder { color: var(--muted-2); font-size: 11.5px; }
.answer-input.english { font-family: var(--serif); font-size: 20px; letter-spacing: .4px; }
.answer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.kbd-hints { display: flex; align-items: center; gap: 10px; color: var(--muted-2); font-size: 9px; }
.kbd-hints kbd { display: inline-block; padding: 2px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--card); font-family: var(--sans); font-size: 8px; color: var(--muted); }
.answer-actions { display: flex; gap: 7px; }
.verdict { display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px; border-radius: 11px; margin-bottom: 15px; position: relative; z-index: 2; }
.verdict.ok { background: #e9f2e9; border: 1px solid #cfe1d2; color: #2d6244; }
.verdict.no { background: #f9e9e5; border: 1px solid #ebd0c8; color: #8e4032; }
.verdict.partial { background: #fbf0dc; border: 1px solid #eed9b4; color: #825b22; }
.verdict.neutral { background: #eef2f0; border: 1px solid #d8e0db; color: #4d6257; }
.reveal-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--line); }
.verdict-ico { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; background: rgba(255, 255, 255, .55); }
.verdict-ico svg { width: 15px; height: 15px; stroke-width: 2.2; }
.verdict b { display: block; font-size: 12px; font-weight: 600; }
.verdict p { font-size: 9.5px; opacity: .78; margin-top: 2px; }
.verdict .override { margin-left: auto; display: flex; gap: 5px; flex: 0 0 auto; }
.verdict .override button { height: 25px; padding: 0 8px; border-radius: 6px; border: 1px solid currentColor; font-size: 9px; opacity: .8; }
.verdict .override button:hover { opacity: 1; background: rgba(255,255,255,.35); }
.answer-detail { position: relative; z-index: 2; }
.answer-label { font-size: 9px; letter-spacing: 1.2px; font-weight: 700; color: var(--muted-2); margin-bottom: 7px; }
.answer-meanings { display: flex; flex-direction: column; gap: 4px; }
.answer-meanings p { font-size: 12.5px; line-height: 1.7; color: var(--ink-soft); }
.answer-meanings p::before { content: "·"; color: var(--amber); font-weight: 700; margin-right: 6px; }
.my-answer { margin-top: 13px; padding: 9px 11px; border-radius: 7px; background: var(--card-soft); border: 1px dashed var(--line); color: var(--muted); font-size: 10.5px; }
.my-answer b { color: var(--ink-soft); font-weight: 600; }
.quiz-aside { display: flex; flex-direction: column; gap: 12px; }
.aside-card { padding: 18px 19px; }
.aside-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; margin-bottom: 10px; }
.aside-title svg { width: 14px; height: 14px; color: var(--amber); }
.aside-empty { color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.aside-word { font-family: var(--serif); font-size: 19px; font-weight: 600; }
.aside-sub { color: var(--muted); font-size: 9.5px; margin-top: 2px; }
.aside-line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 10px; color: var(--muted); }
.aside-line:last-child { border-bottom: 0; }
.aside-line b { color: var(--ink-soft); font-weight: 600; }
.knowledge-list { display: flex; flex-direction: column; gap: 9px; }
.knowledge-item { padding: 10px 11px; border-radius: 9px; background: var(--card-soft); border-left: 2px solid var(--amber); }
.knowledge-item em { display: inline-block; font-style: normal; font-size: 8px; font-weight: 700; color: var(--amber-deep); letter-spacing: .5px; margin-bottom: 2px; }
.knowledge-item p { font-size: 10px; line-height: 1.7; color: var(--ink-soft); white-space: pre-wrap; }
.knowledge-item.user-note { background: #f2f7f0; border-left-color: var(--green); }
.knowledge-item.user-note em { color: var(--green); }
.note-edit { margin-top: 5px; font-size: 8.5px; color: var(--green); text-decoration: underline; }
.note-add { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 27px; margin-top: 9px; border: 1px dashed var(--line-strong); border-radius: 7px; color: var(--muted); font-size: 9px; }
.note-add:hover { color: var(--green); border-color: var(--green); background: var(--green-soft); }
.note-add svg { width: 12px; height: 12px; }
.note-actions { display: flex; gap: 9px; margin-top: 5px; }
.note-actions button { font-size: 8.5px; color: var(--muted); text-decoration: underline; }
.note-actions button:hover { color: var(--ink); }
.note-editor { padding: 27px 28px 22px; }
.note-editor-kicker { font-size: 8.5px; letter-spacing: 1.4px; color: var(--muted-2); font-weight: 700; }
.note-editor h3 { margin: 5px 0 4px; font-size: 20px; font-weight: 600; }
.note-editor > p { margin-bottom: 16px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.note-editor .form-field { margin-bottom: 12px; }
.note-editor textarea { min-height: 150px; font-size: 11.5px; line-height: 1.75; }
.note-editor-foot { display: flex; align-items: center; gap: 7px; margin-top: 5px; }
.note-editor-foot .push { flex: 1; }
.date-picker { padding: 27px 28px 22px; }
.date-picker h3 { margin: 5px 0 4px; font-size: 20px; font-weight: 600; }
.date-picker > p { margin-bottom: 14px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.date-picker > p b { color: var(--green); font-weight: 600; }
.date-picker-tools { display: flex; align-items: center; gap: 5px; padding: 10px 0 9px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.date-picker-tools .chip { height: 26px; font-size: 9px; }
.date-picker-tools > span { margin-left: auto; color: var(--muted); font-size: 9.5px; }
.date-picker-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; padding: 8px 0; }
.date-pick-row { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 7px; cursor: pointer; }
.date-pick-row:hover { background: var(--card-soft); }
.date-pick-row input { accent-color: var(--forest); width: 14px; height: 14px; }
.date-pick-date { font-size: 10.5px; font-weight: 600; color: var(--ink-soft); min-width: 100px; }
.date-pick-meta { margin-left: auto; color: var(--muted); font-size: 9px; }
.date-picker-foot { display: flex; align-items: center; gap: 7px; padding-top: 14px; border-top: 1px solid var(--line); }
.date-picker-foot .push { flex: 1; }
.session-next { display: flex; gap: 7px; }
.session-next .btn-primary { flex: 1; }
.session-done { max-width: 700px; margin: 10px auto; text-align: center; padding: 44px 38px; }
.done-mark { width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-family: var(--serif); font-size: 30px; }
.session-done h2 { font-size: 25px; font-weight: 600; }
.session-done > p { color: var(--muted); font-size: 11.5px; margin-top: 5px; }
.done-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0; }
.done-stat { padding: 14px 10px; border-radius: 12px; background: var(--card-soft); border: 1px solid var(--line); }
.done-stat strong { display: block; font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; }
.done-stat span { font-size: 9.5px; color: var(--muted); }
.done-wrong { text-align: left; margin: 0 0 22px; }
.done-wrong h3 { font-size: 11px; font-weight: 600; margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.done-wrong h3 svg { width: 13px; height: 13px; color: var(--red); }
.done-wrong-list { display: flex; flex-wrap: wrap; gap: 6px; }
.done-wrong-list span { padding: 5px 9px; border-radius: 6px; background: var(--red-soft); color: #8d4436; font-family: var(--serif); font-size: 12px; }
.done-actions { display: flex; justify-content: center; gap: 8px; }

/* ---------- Word rows / lists ---------- */
.view-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 17px; }
.view-toolbar .spacer { flex: 1; }
.filter-search { position: relative; flex: 1; min-width: 190px; max-width: 330px; }
.filter-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-2); }
.filter-search input { width: 100%; height: 35px; padding: 0 12px 0 33px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); outline: none; font-size: 11px; }
.filter-search input:focus { border-color: var(--forest); }
.list-summary { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 10.5px; color: var(--muted); }
.list-summary b { color: var(--ink); }
.word-list { display: flex; flex-direction: column; gap: 7px; }
.word-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  transition: .18s; cursor: pointer;
}
.word-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.word-main { min-width: 0; flex: 0 0 215px; }
.word-main h3 { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.2; letter-spacing: -.2px; }
.word-main .phon { color: var(--muted-2); font-size: 9.5px; margin-top: 2px; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.word-tags { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.word-mean { flex: 1; min-width: 0; color: var(--muted); font-size: 10.8px; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.word-side { display: flex; align-items: center; gap: 7px; margin-left: auto; flex: 0 0 auto; }
.mini-stat { text-align: right; margin-right: 3px; }
.mini-stat b { display: block; font-size: 10px; color: var(--ink-soft); font-weight: 600; }
.mini-stat span { display: block; font-size: 8.5px; color: var(--muted-2); }
.row-chevron { color: var(--muted-2); }
.row-chevron svg { width: 15px; height: 15px; }
.star-btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--muted-2); transition: .18s; }
.star-btn:hover { background: var(--amber-soft); color: var(--amber-deep); }
.star-btn.on { color: #e0a32b; background: #fbf0d8; }
.star-btn.on svg { fill: currentColor; }
.star-btn.list-btn.on { color: var(--green); background: var(--green-soft); }
.star-btn.flag-btn.on { color: #c04f3d; background: var(--red-soft); }
.star-btn svg { width: 16px; height: 16px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 22px; }
.page-btn { min-width: 29px; height: 29px; padding: 0 7px; border-radius: 7px; border: 1px solid transparent; font-size: 10px; color: var(--muted); }
.page-btn:hover { background: var(--paper-2); }
.page-btn.active { background: var(--forest); color: #fff; }
.page-btn:disabled { opacity: .35; }
.list-note { display: flex; gap: 7px; padding: 9px 11px; margin-bottom: 14px; border-radius: 8px; background: var(--card-soft); border: 1px dashed var(--line); color: var(--muted); font-size: 9.5px; }
.list-note svg { width: 13px; height: 13px; flex: 0 0 auto; color: var(--amber); margin-top: 1px; }

/* ---------- Import ---------- */
.import-head { margin-bottom: 20px; }
.import-head h2 { font-size: 27px; font-weight: 600; }
.import-head p { color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.import-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 11px; background: var(--paper-2); width: fit-content; margin-bottom: 20px; }
.import-tab { height: 33px; padding: 0 16px; border-radius: 8px; font-size: 11px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.import-tab svg { width: 14px; height: 14px; }
.import-tab.active { background: var(--card); color: var(--ink); box-shadow: 0 2px 7px rgba(24,36,30,.08); }
.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.form-panel { padding: 24px 26px; }
.form-section-title { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; color: var(--ink-soft); margin: 4px 0 13px; }
.form-section-title span { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-2); color: var(--muted); font-size: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 9.5px; color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.form-field label em { font-style: normal; color: var(--red); margin-left: 2px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--card-soft);
  padding: 9px 11px; outline: none; font-size: 11.5px; transition: .18s;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--forest); background: #fff; box-shadow: 0 0 0 3px rgba(47,108,86,.07); }
.form-field textarea { min-height: 82px; resize: vertical; line-height: 1.65; }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--muted-2); font-size: 10.5px; }
.form-actions { display: flex; align-items: center; gap: 9px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.form-actions .push { flex: 1; }
.form-hint { color: var(--muted-2); font-size: 9px; }
.import-side { display: flex; flex-direction: column; gap: 12px; }
.side-note { padding: 18px; }
.side-note h4 { font-size: 11px; font-weight: 600; margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.side-note h4 svg { width: 14px; height: 14px; color: var(--amber); }
.side-note p, .side-note li { color: var(--muted); font-size: 9.5px; line-height: 1.75; }
.side-note ul { margin: 5px 0 0; padding-left: 14px; }
.side-note li { margin: 3px 0; }
.side-note code { background: var(--paper-2); border-radius: 3px; padding: 1px 4px; font-size: 8.5px; color: var(--ink-soft); }
.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: 14px;
  min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center; background: var(--card-soft); transition: .2s; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--forest); background: #f3f7f1; }
.dropzone-ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); margin-bottom: 11px; }
.dropzone-ico svg { width: 21px; height: 21px; }
.dropzone b { font-size: 12px; font-weight: 600; }
.dropzone span { color: var(--muted); font-size: 9.5px; margin-top: 3px; line-height: 1.6; }
.dropzone .btn { margin-top: 11px; }
.photo-preview { position: relative; border-radius: 13px; overflow: hidden; border: 1px solid var(--line); background: #171b18; max-height: 330px; display: flex; justify-content: center; }
.photo-preview img { max-width: 100%; max-height: 330px; object-fit: contain; display: block; }
.photo-tools { display: flex; gap: 8px; margin-top: 11px; align-items: center; flex-wrap: wrap; }
.ocr-status { margin-top: 12px; padding: 11px 13px; border-radius: 9px; background: var(--paper-2); border: 1px dashed var(--line-strong); }
.ocr-status-top { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--muted); margin-bottom: 7px; }
.ocr-status-top b { color: var(--ink-soft); }
.ocr-progress { height: 4px; background: #ddd6c8; border-radius: 4px; overflow: hidden; }
.ocr-progress i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--green), #7da58d); transition: width .25s; }
.ocr-status p { font-size: 9px; color: var(--muted); margin-top: 6px; }
.ocr-result { margin-top: 13px; }
.ocr-result textarea { width: 100%; min-height: 105px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card-soft); resize: vertical; font-size: 10.5px; line-height: 1.7; outline: none; }
.ocr-result textarea:focus { border-color: var(--forest); background: #fff; }
.import-preview { margin-top: 22px; }
.import-preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.import-preview-head h3 { font-size: 12px; font-weight: 600; }
.import-preview-head span { color: var(--muted); font-size: 9.5px; }
.preview-table { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.preview-row { display: grid; grid-template-columns: 34px 1.1fr 1.5fr 92px 32px; gap: 7px; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--line); background: var(--card); }
.preview-row:last-child { border-bottom: 0; }
.preview-row.head { background: var(--card-soft); padding: 6px 10px; font-size: 8.5px; letter-spacing: .4px; color: var(--muted); font-weight: 600; }
.preview-row input, .preview-row select { width: 100%; height: 29px; border: 1px solid transparent; border-radius: 5px; background: transparent; padding: 0 5px; font-size: 10px; outline: none; }
.preview-row input:focus, .preview-row select:focus { border-color: var(--line-strong); background: #fff; }
.preview-row .num { color: var(--muted-2); font-size: 9px; text-align: center; }
.preview-row .del { width: 25px; height: 25px; border-radius: 5px; display: grid; place-items: center; color: var(--muted-2); }
.preview-row .del:hover { background: var(--red-soft); color: var(--red); }
.preview-row .del svg { width: 13px; height: 13px; }
.preview-row select { color: var(--muted); }
.preview-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; }
.import-success { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 10.5px; margin-top: 13px; }
.import-success svg { width: 17px; height: 17px; }

/* ---------- Study history ---------- */
.history-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.history-side { padding: 16px 13px; }
.history-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 10px; border-bottom: 1px solid var(--line); }
.history-side-head span { font-size: 9px; letter-spacing: 1.2px; color: var(--muted-2); font-weight: 700; }
.history-side-head b { font-size: 9.5px; color: var(--muted); font-weight: 500; }
.history-day-list { display: flex; flex-direction: column; gap: 3px; max-height: 570px; overflow-y: auto; padding-top: 8px; }
.history-day { display: flex; flex-direction: column; gap: 2px; padding: 9px 9px 8px; border-radius: 8px; text-align: left; border: 1px solid transparent; }
.history-day:hover { background: var(--card-soft); }
.history-day.active { background: var(--green-soft); border-color: #cfe0d3; }
.history-day-date { font-size: 11px; font-weight: 600; color: var(--ink-soft); }
.history-day-meta { font-size: 8.5px; color: var(--muted); }
.history-day.active .history-day-date { color: var(--green); }
.history-main { padding: 22px 23px; min-height: 430px; }
.history-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.history-head h3 { margin-top: 4px; font-size: 24px; font-weight: 600; letter-spacing: .3px; }
.history-head p { margin-top: 3px; font-size: 10px; color: var(--muted); }
.history-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 17px; }
.history-stat { padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--card-soft); }
.history-stat strong { display: block; font-size: 18px; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; }
.history-stat span { display: block; margin-top: 2px; font-size: 8.5px; color: var(--muted); }
.history-main .word-list { gap: 6px; }
.history-main .empty { min-height: 210px; }

/* Floating in-progress session dock */
.session-dock {
  position: fixed; z-index: 45; left: 264px; bottom: 20px;
  width: 366px; min-height: 60px;
  display: flex; align-items: center; gap: 9px;
  padding: 10px 11px 10px 14px;
  border-radius: 14px;
  color: #f4efe3;
  background: linear-gradient(135deg, #1b493c, #11372d);
  box-shadow: 0 16px 38px rgba(15, 47, 39, .26);
  border: 1px solid rgba(255,255,255,.1);
  animation: dockIn .25s ease;
}
@keyframes dockIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.dock-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #e0aa61; box-shadow: 0 0 0 4px rgba(224,170,97,.14); }
.dock-copy { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.dock-copy b { font-size: 10.5px; font-weight: 600; color: #f6f1e4; }
.dock-copy span { font-size: 9px; color: rgba(246,241,228,.55); }
.dock-resume { height: 31px; padding: 0 10px; display: flex; align-items: center; gap: 4px; border-radius: 7px; background: #efe6d5; color: var(--forest-deep); font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.dock-resume:hover { background: #fff8e9; }
.dock-resume svg { width: 13px; height: 13px; }
.dock-exit { width: 26px; height: 26px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; color: rgba(246,241,228,.46); }
.dock-exit:hover { color: #fff; background: rgba(255,255,255,.1); }
.dock-exit svg { width: 14px; height: 14px; }

/* ---------- Settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-panel { padding: 22px 24px; }
.settings-panel h3 { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.settings-panel > p { color: var(--muted); font-size: 9.5px; margin-bottom: 15px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.setting-row:last-child { border-bottom: 0; }
.setting-row b { display: block; font-size: 11px; font-weight: 600; }
.setting-row span { display: block; color: var(--muted); font-size: 9.5px; margin-top: 2px; }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 7px; background: var(--paper-2); }
.seg button { height: 26px; padding: 0 9px; border-radius: 5px; font-size: 9.5px; color: var(--muted); }
.seg button.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); font-weight: 600; }
.num-input { width: 58px; height: 31px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; background: var(--card-soft); font-size: 11px; outline: none; text-align: center; }
.font-size-control { display: flex; align-items: center; gap: 7px; min-width: 210px; justify-content: flex-end; }
.font-size-control input[type="range"] { width: 105px; accent-color: var(--forest); cursor: pointer; }
.font-size-control b { min-width: 31px; text-align: right; font-size: 10px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.font-size-control .btn { height: 24px; padding: 0 7px; font-size: 9px; }
.data-path { margin: 8px 0 13px; padding: 8px 10px; border-radius: 7px; background: var(--paper-2); color: var(--muted); font-family: Consolas, monospace; font-size: 8.5px; word-break: break-all; }
.settings-btns { display: flex; flex-wrap: wrap; gap: 7px; }
.about-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 13px; }
.about-brand .brand-mark { width: 37px; height: 41px; box-shadow: none; background: var(--paper-2); }
.about-brand .brand-mark span { font-size: 23px; }
.about-brand b { display: block; font-size: 15px; letter-spacing: 2px; }
.about-brand span { display: block; color: var(--muted); font-size: 8.5px; letter-spacing: 1.2px; }
.about p { font-size: 9.5px; color: var(--muted); line-height: 1.75; }
.source-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.source-list div { padding: 7px 9px; border-radius: 6px; background: var(--card-soft); color: var(--muted); font-size: 8.5px; border-left: 2px solid var(--line-strong); }
.danger-zone { border-color: #ebd3cc; }
.danger-zone h3 { color: var(--red); }
.backup-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.backup-panel-head > div > p { margin-bottom: 0; }
.backup-path-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 4px; }
.backup-path { flex: 1; min-width: 230px; padding: 8px 10px; border-radius: 7px; background: var(--paper-2); color: var(--muted); font-family: Consolas, monospace; font-size: 8.5px; word-break: break-all; }
.backup-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.backup-setting-row .setting-row { flex: 1; }
.backup-keep { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.backup-keep .num-input { width: 52px; }
.backup-last { padding: 9px 0 0; color: var(--muted); font-size: 9px; }
.backup-last .muted { margin-left: 5px; font-family: Consolas, monospace; }
.backup-list-head { display: flex; align-items: center; gap: 9px; margin: 16px 0 7px; padding-top: 13px; border-top: 1px solid var(--line); }
.backup-list-head b { font-size: 11px; font-weight: 600; }
.backup-list-head > span { font-size: 9px; color: var(--muted); }
.backup-list-head .head-link { margin-left: auto; }
.backup-list { display: flex; flex-direction: column; gap: 3px; }
.backup-item { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 7px; background: var(--card-soft); border: 1px solid transparent; }
.backup-item:hover { border-color: var(--line); }
.backup-item-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.backup-item-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Consolas, monospace; font-size: 9.5px; font-weight: 500; color: var(--ink-soft); }
.backup-item-main span { color: var(--muted-2); font-size: 8.5px; }
.backup-item .btn { color: var(--green); }
.backup-empty { padding: 18px 12px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 9.5px; text-align: center; background: var(--card-soft); }

/* ---------- Drawer / modal ---------- */
.drawer-layer, .modal-layer { position: fixed; inset: 0; z-index: 80; }
.drawer-scrim, .modal-scrim { position: absolute; inset: 0; background: rgba(16, 35, 29, .38); backdrop-filter: blur(2px); animation: fadeIn .2s; }
.drawer {
  position: absolute; right: 0; top: 0; bottom: 0; width: 470px; max-width: 92vw;
  background: var(--card); box-shadow: -18px 0 60px rgba(15, 47, 39, .18);
  overflow-y: auto; animation: slideIn .26s cubic-bezier(.2,.7,.3,1);
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-layer { display: grid; place-items: center; padding: 30px; }
.modal {
  position: relative; width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto;
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg);
  animation: modalIn .24s cubic-bezier(.2,.7,.3,1);
}
.modal.wide { max-width: 820px; }
.modal-close { position: absolute; right: 15px; top: 15px; width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: var(--card-soft); z-index: 3; }
.modal-close:hover { background: var(--paper-2); color: var(--ink); }
.modal-close svg { width: 15px; height: 15px; }
.drawer-head { position: sticky; top: 0; z-index: 3; background: rgba(255,253,248,.94); backdrop-filter: blur(10px); padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.drawer-head span { font-size: 9px; letter-spacing: 1.4px; color: var(--muted-2); font-weight: 700; }
.drawer-content { padding: 24px 26px 34px; }
.detail-word { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.detail-word h2 { font-family: var(--serif); font-size: 48px; font-weight: 500; line-height: 1.1; letter-spacing: -1.2px; word-break: break-word; }
.detail-phon { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.detail-phon span { font-size: 11px; color: var(--muted); }
.detail-tags { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.detail-actions { display: flex; gap: 6px; margin-top: 15px; flex-wrap: wrap; }
.detail-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-section h4 { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--muted); margin-bottom: 9px; }
.detail-section h4 svg { width: 13px; height: 13px; color: var(--amber); }
.detail-trans { display: flex; flex-direction: column; gap: 6px; }
.detail-trans p { font-size: 12.5px; line-height: 1.75; color: var(--ink-soft); }
.detail-trans p::before { content: "·"; color: var(--amber); margin-right: 7px; font-weight: 700; }
.detail-knowledge { display: flex; flex-direction: column; gap: 8px; }
.detail-knowledge .knowledge-item { background: #fbf6eb; border-left-color: var(--amber); padding: 11px 12px; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.detail-stat { text-align: center; padding: 10px 6px; border-radius: 9px; background: var(--card-soft); border: 1px solid var(--line); }
.detail-stat strong { display: block; font-size: 17px; font-weight: 600; }
.detail-stat span { font-size: 8.5px; color: var(--muted); }
.mastery-track { height: 5px; margin-top: 9px; border-radius: 5px; background: var(--paper-2); overflow: hidden; }
.mastery-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), var(--green)); }
.detail-progress-note { display: flex; justify-content: space-between; margin-top: 5px; font-size: 8.5px; color: var(--muted); }

/* Quick search modal */
.quick-search { padding: 22px; }
.quick-search-input { display: flex; align-items: center; gap: 10px; padding: 0 4px 14px; border-bottom: 1px solid var(--line); }
.quick-search-input svg { width: 20px; height: 20px; color: var(--muted-2); }
.quick-search-input input { flex: 1; border: 0; outline: none; background: transparent; font-size: 19px; letter-spacing: .2px; }
.quick-search-input input::placeholder { color: var(--muted-2); font-size: 14px; }
.quick-results { max-height: 430px; overflow-y: auto; margin-top: 8px; }
.quick-result { display: flex; align-items: center; gap: 11px; padding: 10px 8px; border-radius: 8px; cursor: pointer; }
.quick-result:hover, .quick-result.active { background: var(--card-soft); }
.quick-result b { font-family: var(--serif); font-size: 17px; min-width: 110px; font-weight: 600; }
.quick-result span { color: var(--muted); font-size: 10px; flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.quick-result .tag { flex: 0 0 auto; }
.quick-empty { padding: 30px; text-align: center; color: var(--muted); font-size: 11px; }
.quick-foot { display: flex; gap: 13px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 8.5px; }
.quick-foot kbd { padding: 1px 4px; border: 1px solid var(--line); border-radius: 3px; font-family: var(--sans); }

/* Camera modal */
.camera-modal { padding: 24px; }
.camera-modal h2 { font-size: 17px; font-weight: 600; margin-bottom: 3px; }
.camera-modal > p { color: var(--muted); font-size: 10px; margin-bottom: 15px; }
.camera-frame { position: relative; border-radius: 13px; overflow: hidden; background: #111915; aspect-ratio: 4/3; display: grid; place-items: center; }
.camera-frame video { width: 100%; height: 100%; object-fit: cover; }
.camera-frame .cam-placeholder { color: rgba(255,255,255,.5); font-size: 10px; text-align: center; padding: 20px; }
.camera-guide { position: absolute; inset: 10%; border: 1.5px dashed rgba(255,255,255,.4); border-radius: 9px; pointer-events: none; }
.camera-actions { display: flex; justify-content: center; gap: 9px; margin-top: 15px; }
.shutter { width: 52px; height: 52px; border-radius: 50%; background: #fff; border: 5px solid var(--paper-2); box-shadow: 0 5px 16px rgba(0,0,0,.2); }
.shutter:hover { transform: scale(1.04); }
.shutter:disabled { background: #ccc; }

/* Toast */
.toast-stack { position: fixed; right: 24px; bottom: 90px; z-index: 120; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  min-width: 240px; max-width: 360px; display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--forest-deep); color: #f4f0e3; font-size: 10.5px; line-height: 1.5;
  box-shadow: 0 10px 30px rgba(15,47,39,.28); animation: toastIn .25s ease;
}
.toast svg { width: 15px; height: 15px; color: #e3b36d; flex: 0 0 auto; }
.toast.error { background: #77392e; }
.toast.error svg { color: #f0b9a9; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* Confetti-ish completion dots */
.done-mark::before, .done-mark::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); opacity: .5; }
.done-mark { position: relative; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .sidebar { padding-left: 13px; padding-right: 13px; }
  .topbar { padding-left: 26px; padding-right: 26px; }
  .view { padding-left: 26px; padding-right: 26px; }
  .hero { padding: 30px; }
  .hero h2 { font-size: 31px; }
  .setup-grid { grid-template-columns: minmax(0, 1fr) 270px; }
  .quiz-grid { grid-template-columns: minmax(0, 1fr) 288px; }
  .search-trigger { width: 190px; }
  .mode-grid { grid-template-columns: repeat(3, 1fr); }
  .session-dock { left: 236px; }
}
@media (max-width: 1030px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .level-cards { grid-template-columns: repeat(2, 1fr); }
  .brand { padding: 0 0 24px; justify-content: center; }
  .brand-text, .nav-item span, .sidebar-goal, .sidebar-foot, .nav-badge { display: none; }
  .nav-item { justify-content: center; padding: 0; height: 46px; }
  .nav-item svg { width: 20px; height: 20px; }
  .sidebar { padding: 24px 10px 14px; align-items: stretch; }
  .nav-settings { margin-top: 6px; }
  .hero { grid-template-columns: 1fr; }
  .hero-side { display: none; }
  .home-grid, .home-grid.lower { grid-template-columns: 1fr; }
  .setup-grid, .import-grid, .quiz-grid, .settings-grid { grid-template-columns: 1fr; }
  .setup-summary { position: static; }
  .quiz-aside { display: grid; grid-template-columns: 1fr 1fr; }
  .search-trigger { width: 150px; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .history-layout { grid-template-columns: 1fr; }
  .history-day-list { max-height: 220px; }
  .session-dock { left: 92px; width: 330px; }
  .history-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-height: 760px) {
  .hero { min-height: 248px; padding-top: 27px; padding-bottom: 27px; }
  .hero h2 { font-size: 30px; margin: 13px 0 8px; }
  .ring-wrap { width: 160px; height: 160px; }
  .ring-center strong { font-size: 42px; }
  .sidebar-goal { padding: 11px 12px 10px; }
}

/* ---------- Web / mobile ---------- */
body.web-mode .desktop-only,
body.web-mode .backup-panel,
body.web-mode .import-tab[data-value="photo"] { display: none !important; }

@media (max-width: 680px) {
  .app-shell { display: block; height: 100dvh; overflow: hidden; }
  .workspace { height: calc(100dvh - 64px - env(safe-area-inset-bottom)); }
  .sidebar {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    width: 100%; height: calc(64px + env(safe-area-inset-bottom));
    padding: 0 2px env(safe-area-inset-bottom);
    flex-direction: row; align-items: stretch;
    border-top: 1px solid rgba(255, 255, 255, .1);
    background: #173a2c;
    box-shadow: 0 -8px 24px rgba(15, 35, 26, .16);
  }
  .brand, .sidebar-spacer, .sidebar-goal, .sidebar-foot { display: none !important; }
  .nav {
    flex: 1; flex-direction: row; gap: 0; align-items: stretch;
    width: 100%; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item, .nav-settings {
    flex: 0 0 48px; width: 48px; height: 62px; min-height: 62px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 5px 0 3px; margin: 0; border-radius: 0;
    text-align: center; font-size: 8px; letter-spacing: 0;
  }
  .nav-item span { display: block !important; font-size: 8px; white-space: nowrap; }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-item.active { background: rgba(241, 235, 221, .12); color: #fffdf5; box-shadow: none; }
  .nav-badge { display: none !important; }

  .topbar {
    min-height: 58px; padding: calc(8px + env(safe-area-inset-top)) 13px 8px;
    gap: 8px;
  }
  .page-heading h1 { font-size: 19px; }
  .eyebrow { font-size: 7.5px; letter-spacing: 1.8px; }
  .top-actions { gap: 5px; }
  .search-trigger { width: 36px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .level-trigger { height: 34px; padding: 0 8px; font-size: 10px; gap: 4px; }

  .view { padding: 16px 13px calc(84px + env(safe-area-inset-bottom)); }
  .view-wrap { overflow-x: hidden; }
  .section-head { flex-direction: column; align-items: flex-start !important; gap: 10px; }
  .section-head h2 { font-size: 23px !important; }
  .section-head p { font-size: 10px; line-height: 1.7; }
  .section-head > div:last-child { width: 100%; justify-content: flex-start !important; }
  .panel { border-radius: 13px; }

  .hero { grid-template-columns: 1fr; min-height: 0; padding: 23px 18px; }
  .hero h2 { font-size: 29px; margin: 12px 0 8px; }
  .hero p { font-size: 10.5px; }
  .hero-actions { gap: 8px; margin-top: 16px; flex-wrap: wrap; }
  .hero-meta { gap: 10px; margin-top: 14px; padding-top: 12px; }
  .hero-side { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .stat-card { padding: 13px; }
  .home-grid, .home-grid.lower, .setup-grid, .import-grid, .quiz-grid, .settings-grid, .history-layout { grid-template-columns: 1fr !important; }
  .quiz-card { min-height: 0; padding: 20px 16px 18px; }
  .prompt-word h2 { font-size: 42px; }
  .prompt-zh { font-size: 25px; }
  .quiz-aside { display: flex; flex-direction: column; gap: 12px; }
  .answer-foot { flex-wrap: wrap; gap: 8px; }
  .kbd-hints { display: none; }
  .answer-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .answer-actions .btn { width: 100%; min-width: 0; height: 36px; justify-content: center; }
  .session-left { flex-wrap: wrap; gap: 6px; }
  .session-track-wrap { flex: 1 1 120px; }
  .session-top { gap: 7px; }
  .session-score { order: 4; }
  .session-top > .session-step { order: 5; }
  .session-dock { left: 8px; right: 8px; bottom: calc(72px + env(safe-area-inset-bottom)); width: auto; }
  .session-top { flex-wrap: wrap; }
  .setup-summary { position: static; }
  .mode-grid, .level-cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .history-day-list { max-height: 240px; }
  .history-stats { grid-template-columns: repeat(2, 1fr); }

  .word-row { flex-wrap: wrap; padding: 12px 13px; gap: 7px; }
  .word-main { flex: 1 0 100%; }
  .word-mean { flex: 1 0 100%; }
  .word-side { width: 100%; justify-content: flex-end; }
  .mini-stat { margin-right: auto; }

  .modal { width: calc(100% - 22px); max-height: 88dvh; overflow-y: auto; }
  .note-editor, .date-picker { padding: 22px 17px 18px; }
  .date-picker-foot { flex-wrap: wrap; }
  .date-picker-foot .push { display: none; }
  .date-picker-foot .btn-primary { margin-left: auto; }
  .note-editor-foot { flex-wrap: wrap; }
  .note-editor-foot .push { display: none; }
  .note-editor-foot .btn-primary { margin-left: auto; }
}
