/* =============================================================================
   v2 · Apple-like, strictly monochrome, system dark.
   Hierarchy = type size / weight / spacing / 1px hairlines. No hue, no glow.
   Only three motions: view switch (.14s), hover colour (120ms),
   countdown digit (.18s). Everything else is static.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  color-scheme: dark;

  --bg: #050505;
  --panel: rgba(17,17,17,.82);
  --panel-2: #1a1a1a;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.18);

  --ink: #f5f5f5;
  --ink-2: #a1a1a1;
  --ink-3: #6e6e6e;
  --focus: #fff;

  --radius-card: 20px;
  --radius-ctl: 10px;
  --radius-pill: 999px;

  --pad-page: clamp(24px, 2.2vw, 40px);
  --gap: 24px;
  --sidebar-w: 236px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "PingFang SC", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei",
          system-ui, sans-serif;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 19px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding-bottom: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
svg { display: block; flex: 0 0 auto; }
[hidden] { display: none !important; }

::selection { background: rgba(255,255,255,.20); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* numbers are always tabular so clocks, counters and lists never jitter */
.clock-time, .clock-sub, .cd-row-days, .cd-row-date, .count, .num,
.rank-idx, .rank-num, .rank-hit, .entry-meta, .date-title,
.luck-picked, .luck-picked-meta { font-variant-numeric: tabular-nums; }

* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.28); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- 3. Wallpaper + shell ---------- */
.wallpaper { position: fixed; inset: 0; z-index: 0; background: #0b0b0b center / cover no-repeat; filter: brightness(.9) saturate(.95); opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.wallpaper.on { opacity: 1; }

.app { position: relative; z-index: 1; min-height: 100dvh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: var(--gap); padding: var(--pad-page); align-items: start; }
.app.side-collapsed { grid-template-columns: 76px minmax(0, 1fr); }

/* ---------- 4. Sidebar ---------- */
.sidebar {
  position: sticky;
  top: var(--pad-page);
  height: calc(100dvh - 2 * var(--pad-page));
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 60px -32px #000;
  overflow: hidden;
}

.side-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: #000; }
.brand-mark svg { width: 20px; height: 20px; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-height: 0; overflow: auto; }

.side-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; height: 44px; padding: 0 12px;
  border-radius: var(--radius-ctl);
  color: var(--ink-2);
  text-align: left;
  transition: background-color .12s ease, color .12s ease;
}
.side-item svg { width: 19px; height: 19px; }
.side-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.side-item.active { background: rgba(255,255,255,.10); color: #fff; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side-collapse { width: 100%; justify-content: flex-start; gap: 9px; color: var(--ink-3); }
.side-collapse:hover { color: var(--ink); }

.app.side-collapsed .side-item span,
.app.side-collapsed .brand-text,
.app.side-collapsed .side-collapse span { display: none; }
.app.side-collapsed .side-brand { justify-content: center; }
.app.side-collapsed .side-item { justify-content: center; padding: 0; }
.app.side-collapsed .side-collapse { justify-content: center; padding: 0; }

/* ---------- 5. Content + topbar ---------- */
.content {
  min-width: 0;
  display: flex; flex-direction: column;
  min-height: calc(100dvh - 2 * var(--pad-page));
  padding: clamp(16px, 2vw, 26px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 60px -32px #000;
}

.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.topbar-title { min-width: 0; font-size: clamp(22px, 1.5vw, 24px); font-weight: 600; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }

/* ---------- 6. Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  background: rgba(255,255,255,.05);
  color: var(--ink);
  font-size: 13.5px; white-space: nowrap;
  transition: background-color .12s ease, color .12s ease;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: rgba(255,255,255,.09); }
.btn[disabled], .btn:disabled { opacity: .45; pointer-events: none; }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.btn-primary { background: #fff; border-color: #fff; color: #050505; font-weight: 600; }
.btn-primary:hover { background: #eeeeee; border-color: #eeeeee; }

.icon-btn {
  display: inline-grid; place-items: center;
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-ctl);
  background: rgba(255,255,255,.04);
  color: var(--ink-2);
  transition: background-color .12s ease, color .12s ease;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: rgba(255,255,255,.09); color: var(--ink); }
.icon-btn[disabled] { opacity: .4; pointer-events: none; }

.chip,.date-jump {
  display: inline-flex; align-items: center;
  height: 26px; padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.04);
  color: var(--ink-2);
  font-size: 12px;
  transition: background-color .12s ease, color .12s ease;
}
.date-jump { padding: 0 8px; font: inherit; font-size: 12px; }
.chip:hover, .date-jump:hover { background: rgba(255,255,255,.08); color: var(--ink); }

.mini-btn {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  color: var(--ink-2);
  transition: background-color .12s ease, color .12s ease;
}
.mini-btn svg { width: 14px; height: 14px; }
.mini-btn:hover { background: rgba(255,255,255,.10); color: var(--ink); }

/* ---------- 7. Card primitives ---------- */
.card { min-width: 0; padding: clamp(18px, 2vw, 26px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: 0 24px 60px -36px #000; }

.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head .btn { height: 30px; padding: 0 11px; font-size: 13.5px; gap: 6px; }
.head-icon { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.06); color: var(--ink-2); }
.head-icon svg { width: 17px; height: 17px; }
.head-icon.danger { color: var(--ink); background: rgba(255,255,255,.10); }

.head-title { min-width: 0; flex: 1 1 auto; }
.head-title h2, .head-title h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.head-sub { margin-top: 2px; font-size: 14px; color: var(--ink-3); }
.list-foot { margin-top: 12px; font-size: 13px; color: var(--ink-3); }

.reading-empty, .duty-empty, .announce-empty, .cd-empty { color: var(--ink-3); font-size: 13.5px; }

.head-title h2, .entry-text, .reading-text, .announce-block,
.cd-row-title { overflow-wrap: anywhere; }

/* ---------- 8. Views ---------- */
.view { padding: 6px 0 40px; }
.view[hidden] { display: none; }
.view:not([hidden]) { animation: view-in .14s ease-out both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 9. Home: layout / hero ---------- */
.home-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .95fr); gap: var(--gap); align-items: start; }
.home-main, .home-side { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.home-main .reading-card { flex: 1 1 auto; }

.hero {
  position: relative;
  display: flex; flex-direction: column; gap: 16px;
  min-height: 250px;
  padding: clamp(20px, 2.4vw, 30px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.hero-clock { position: static; }
.clock-time { font-size: clamp(44px, 5vw, 64px); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.clock-sub { margin-top: 8px; font-size: 15px; color: var(--ink-3); }

.hero-tools { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; }

.hero-quote { margin-top: auto; }
.hero-text { margin: 0; font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; line-height: 1.4; letter-spacing: -.01em; overflow-wrap: anywhere; }
.hero-by { margin-top: 10px; font-size: 14px; color: var(--ink-3); }

.hero-cd {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.hero-cd-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  width: 100%; padding: 9px 0;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  color: var(--ink); text-align: left; cursor: pointer; font: inherit;
  transition: color .12s ease;
}
.hero-cd-row:last-child { border-bottom: 0; }
.hero-cd-row:hover { color: #fff; }
.hero-cd-title {
  min-width: 0; font-size: 16px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hero-cd-days { flex: 0 0 auto; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hero-cd-empty { margin: 8px 0 4px; font-size: 14px; color: var(--ink-3); }

/* ---------- 10. Reading / 早读 ---------- */
.reading-card { display: flex; flex-direction: column; }
.reading-list { display: grid; gap: 8px; flex: 1 1 auto; align-content: start; }
.reading-list.is-empty { align-content: center; justify-items: center; }

.reading-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  transition: background-color .12s ease;
}
.reading-item:hover, .reading-item:focus-within { background: rgba(255,255,255,.06); }

.reading-subject { padding: 1px 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: rgba(255,255,255,.07); color: var(--ink-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.reading-text { white-space: pre-wrap; font-size: 17px; line-height: 1.65; }

.reading-ops { display: flex; gap: 4px; opacity: 0; }
.reading-item:hover .reading-ops,
.reading-item:focus-within .reading-ops { opacity: 1; }
.reading-ops .icon-btn { width: 28px; height: 28px; border-radius: 8px; }
.reading-ops .icon-btn svg { width: 14px; height: 14px; }

/* ---------- 11. Announce / 公告 ---------- */
.announce-card .announce-body { display: grid; gap: 10px; }
.announce-block {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  font-size: 17px; line-height: 1.7;
  white-space: pre-wrap;
}

/* ---------- 12. Duty / 值日 ---------- */
.duty-list { display: grid; gap: 6px; }
.duty-task { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.duty-task:last-child { border-bottom: 0; }
.task-area { font-size: 16.5px; font-weight: 600; }
.task-members { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.task-member { padding: 0 9px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: rgba(255,255,255,.05); color: var(--ink-2); font-size: 13px; font-style: normal; }

/* ---------- 13. Luck / 抽学号 ---------- */
.luck-block { margin-bottom: 12px; }
.luck-label { display: block; margin-bottom: 8px; font-size: 13.5px; color: var(--ink-3); }

.num-list, .num-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.num {
  display: grid; place-items: center;
  min-width: 38px; height: 34px; padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(255,255,255,.06);
  color: var(--ink);
  font-size: 14px; font-weight: 600;
}

.luck-result { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 12px; border: 1px dashed var(--line-strong); border-radius: 14px; }
.luck-picked { font-size: clamp(32px, 3.4vw, 44px); font-weight: 600; letter-spacing: -.03em; line-height: 1; color: var(--ink); }
.luck-picked.hit { color: #050505; background: #fff; border-radius: 8px; padding: 0 .16em; }
.luck-picked-meta { font-size: 13.5px; color: var(--ink-2); }
.luck-picked-meta b { color: var(--ink); font-weight: 600; }
.luck-draw { width: 100%; height: 46px; font-size: 15px; }
.luck-hint { padding: 10px; font-size: 13px; color: var(--ink-3); }

.rank-list { display: grid; gap: 4px; max-height: min(56vh, 420px); overflow: auto; padding-right: 4px; }
.rank-row { display: grid; grid-template-columns: 30px 68px minmax(0, 1fr) 54px; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid transparent; border-radius: 10px; }
.rank-row.top { border-color: var(--line-strong); background: rgba(255,255,255,.06); }
.rank-idx { font-size: 13px; color: var(--ink-3); }
.rank-num { font-size: 15px; font-weight: 600; }
.rank-bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 4px; background: #fff; }
.rank-hit { text-align: right; font-size: 13px; color: var(--ink-2); }

/* ---------- 14. Datebar / density ---------- */
.datebar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: var(--gap);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
}
.datecenter { min-width: 0; text-align: center; }
.date-title { font-size: clamp(22px, 1.7vw, 28px); font-weight: 600; letter-spacing: -.02em; }
.date-title.is-today { color: #fff; }
.date-title.is-today::after { content: ' / 今天'; font-size: .42em; letter-spacing: .1em; vertical-align: middle; color: var(--ink-3); }
.date-extra { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.weekday { font-size: 13.5px; color: var(--ink-3); }

.density-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: var(--gap); }
.density-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--ink-3); }
.density-label svg { width: 14px; height: 14px; }
.density-btn {
  height: 28px; padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.03);
  color: var(--ink-3);
  font-size: 12.5px;
  transition: background-color .12s ease, color .12s ease;
}
.density-btn:hover { background: rgba(255,255,255,.08); color: var(--ink); }
.density-btn[aria-pressed="true"] { background: #fff; border-color: #fff; color: #050505; font-weight: 600; }

/* ---------- 15. Board / homework ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); grid-auto-flow: dense; gap: 16px; container-type: inline-size; --dscale: 1; }
.board.masonry { display: block; position: relative; }
.board.masonry > .card { position: absolute; margin: 0; }
.board.density-compact { --dscale: .78; }

.board-none { grid-column: 1 / -1; padding: 44px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-card); color: var(--ink-3); font-size: 16px; text-align: center; }

.board .card-head h3 { display: flex; align-items: center; gap: 9px; font-size: calc(clamp(18px, .8vw + 13px, 21px) * var(--dscale)); font-weight: 600; letter-spacing: -.01em; }

.count {
  margin-left: auto;
  min-width: 24px; height: 24px; padding: 0 7px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  color: var(--ink-2);
  font-size: 12px; font-weight: 600;
}

.entry-list { display: grid; }
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start; gap: 8px;
  padding: calc(14px * var(--dscale)) 0;
  border-top: 1px solid var(--line);
  transition: background-color .12s ease;
}
.entry:first-child { border-top: 0; }
.entry:hover, .entry:focus-within { background: rgba(255,255,255,.025); }
.entry-body { min-width: 0; }
.entry-text { white-space: pre-wrap; font-size: calc(clamp(18px, .65vw + 13px, 22px) * var(--dscale)); line-height: 1.65; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 5px; font-size: calc(13px * var(--dscale)); color: var(--ink-3); }
.entry-chip { display: inline-flex; align-items: center; padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); font-size: calc(11.5px * var(--dscale)); line-height: 1.7; color: var(--ink-2); }
.entry-chip.is-span { border-color: transparent; background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.entry-chip.is-muted { border-color: var(--line); color: var(--ink-3); }
.entry-ops { display: flex; gap: 4px; opacity: 0; }
.entry:hover .entry-ops, .entry:focus-within .entry-ops { opacity: 1; }
.entry-ops .icon-btn { width: 28px; height: 28px; border-radius: 8px; }
.entry-ops .icon-btn svg { width: 14px; height: 14px; }
.entry-ops .op-del:hover { background: rgba(255,255,255,.14); color: #fff; }

@container (min-width: 700px) {
  .board .bento-w { grid-column: span 2; }
  .board .bento-2x2 { grid-column: span 2; }
}
.board .bento-hero { grid-column: 1 / -1; min-height: clamp(240px, 32vh, 420px); }

/* ---------- 17. Countdown ---------- */
.countdown-view { width: 100%; max-width: 760px; margin: 0 auto; }
.cd-card { display: flex; flex-direction: column; gap: 10px; }

.cd-form {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, .9fr) auto;
  align-items: center; gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.cd-form[hidden] { display: none; }
.cd-input { width: 100%; min-width: 0; padding: 10px 13px; background: #0b0b0b; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-ctl); font: inherit; font-size: 15px; }
.cd-input:focus { outline: 2px solid rgba(255,255,255,.25); outline-offset: 0; border-color: #fff; }
.cd-form-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.cd-del { margin-right: auto; color: var(--ink-2); }
.cd-del:hover { color: #fff; }

.cd-list { display: flex; flex-direction: column; }
.cd-row {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  width: 100%; padding: 14px 10px;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background-color .12s ease;
}
.cd-row + .cd-row { box-shadow: inset 0 1px 0 var(--line); }
.cd-row:hover { background: rgba(255,255,255,.04); }
.cd-row.is-editing { background: rgba(255,255,255,.07); }
.cd-row.is-past { opacity: .45; }

.cd-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cd-row-title { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-row-date { font-size: 13px; color: var(--ink-3); }

.cd-row-days { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.cd-row-days em, .cd-row-days i { font-style: normal; font-size: 13.5px; color: var(--ink-3); }
.cd-row-days b { font-size: clamp(28px, 3vw, 34px); font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.cd-row-days b.is-word { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--ink-2); }
.cd-row-days b.num-in { animation: num-in .18s ease-out both; }
@keyframes num-in {
  from { opacity: .4; transform: translateY(-3px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 18. FAB ---------- */
.fab {
  position: fixed;
  right: clamp(16px, 2vw, 28px);
  bottom: clamp(16px, 2vw, 28px);
  z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 20px;
  border: 1px solid #fff;
  border-radius: var(--radius-pill);
  background: #fff;
  color: #050505;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 20px 44px -20px #000;
  transition: background-color .12s ease;
}
.fab svg { width: 18px; height: 18px; }
.fab:hover { background: #eeeeee; }
.fab[hidden] { display: none; }
.fab-label { white-space: nowrap; }

/* ---------- 19. Dialogs ---------- */
dialog { margin: auto; padding: 0; width: 100%; max-width: min(94vw, 560px); border: 0; background: transparent; color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.6); }

.dlg-body { max-height: 86dvh; padding: clamp(18px, 2vw, 26px); background: #121212; border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 40px 90px -40px #000; overflow: auto; }
.dlg-title { margin-bottom: 16px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }

.field { display: block; margin-bottom: 16px; }
.field-label { display: block; margin-bottom: 7px; font-size: 14px; color: var(--ink-2); }
.field-help { margin-top: 7px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.field-help code { padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.06); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .95em; }

input[type="text"],input[type="number"],input[type="url"],textarea,select { width: 100%; padding: 11px 13px; background: #0b0b0b; color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-ctl); font: inherit; font-size: 16px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.65; }
input:focus,textarea:focus,select:focus { outline: 2px solid rgba(255,255,255,.25); outline-offset: 0; border-color: #fff; }
::placeholder { color: var(--ink-3); }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.subject-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.subj-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,.04);
  color: var(--ink-2);
  font-size: 13px;
  transition: background-color .12s ease, color .12s ease;
}
.subj-chip:hover { background: rgba(255,255,255,.09); color: var(--ink); }
.subj-chip .chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.subj-chip[aria-pressed="true"] { background: #fff; border-color: #fff; color: #050505; font-weight: 600; }
.subj-chip[aria-pressed="true"] .chip-dot { background: #050505; }

.subject-rows { display: grid; gap: 6px; margin-bottom: 10px; }
.subject-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.03);
}
.row-name { padding: 6px 9px; }
.row-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }

.drawer { margin: 0 0 0 auto; width: min(94vw, 460px); max-width: min(94vw, 460px); height: 100dvh; max-height: 100dvh; }
.drawer .dlg-body { display: flex; flex-direction: column; height: 100%; max-height: 100dvh; border-right: 0; border-radius: 18px 0 0 18px; }
.drawer .form-actions { margin-top: auto; padding-top: 16px; }

/* ---------- 20. Toast ---------- */
/* popover 会给 UA 默认样式 inset:0 + margin:auto，必须显式复位，
   否则 top/right 残留 0，整个 wrap 被撑成半个屏幕的大盒子 */
.toast-wrap {
  position: fixed; inset: auto; left: 50%; bottom: 28px; margin: 0;
  z-index: 60;
  display: grid; gap: 8px; justify-items: center;
  width: max-content; max-width: min(92vw, 520px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--panel-2);
  color: var(--ink);
  font-size: 14.5px; text-align: center;
  box-shadow: 0 24px 60px -30px #000;
}
/* both kinds stay monochrome: only the border weight differs */
.toast.ok { border-color: var(--line-strong); color: var(--ink-2); }
.toast.err { border-color: #fff; color: var(--ink); font-weight: 600; }
.toast.out { opacity: 0; }

/* ---------- 20.5 新闻 / 日报 ---------- */
.feed-view { max-width: 900px; }
.feed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.feed-head h2 { margin: 0 0 4px; font-size: 1.35rem; letter-spacing: -.01em; }
.feed-sub { margin: 0; font-size: 13px; color: var(--ink-3); }
.feed-body { display: grid; gap: 16px; }
.feed-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.feed-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 10px; border-radius: 10px; }
.feed-item:hover { background: rgba(255,255,255,.04); }
.feed-idx {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 24px; height: 24px; margin-top: 1px;
  border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255,255,255,.05);
  color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums;
}
.feed-item:first-child .feed-idx { background: #fff; border-color: #fff; color: #050505; font-weight: 600; }
.feed-main { min-width: 0; }
.feed-title { display: block; font-size: 14.5px; line-height: 1.6; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.feed-title:hover { text-decoration: underline; }
.feed-desc { margin: 3px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-3); overflow-wrap: anywhere; }
.feed-meta { margin: 4px 0 0; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.feed-empty { margin: 18px 2px; font-size: 14px; color: var(--ink-3); }

@media (max-width: 900px) {
  .feed-head { flex-direction: column; align-items: stretch; }
}

/* ---------- 21. Responsive shell ---------- */
.tabbar { display: none; }

@media (max-width: 1100px) {
  .home-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .app.side-collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .content { min-height: calc(100dvh - 96px); padding: 14px; padding-bottom: calc(72px + env(safe-area-inset-bottom)); border-radius: 16px; }
  .entry-ops, .reading-ops { opacity: 1; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: flex;
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: #080808;
    border-top: 1px solid var(--line);
  }
  .tab { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; background: transparent; border: 0; color: var(--ink-3); font-size: 12px; transition: color .12s ease; }
  .tab svg { width: 22px; height: 22px; }
  .tab.active { color: #fff; }

  .fab { right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .toast-wrap { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

@media (max-width: 640px) {
  .topbar { gap: 8px; }
  .topbar-title { font-size: 20px; }
  .avatar { display: none; }
  #undoBtn span { display: none; }
  #undoBtn { padding: 0 12px; }

  .hero { min-height: 220px; }
  .hero-tools { top: 12px; right: 12px; }
  .hero-tools .btn { width: 34px; padding: 0; }
  .hero-tools .btn span { display: none; }

  .rank-row { grid-template-columns: 24px 58px minmax(0, 1fr) 46px; gap: 7px; }

  .cd-form { grid-template-columns: 1fr; }
  .cd-form-actions { justify-content: flex-end; flex-wrap: wrap; }

  .drawer { margin: auto 0 0; width: 100%; max-width: 100%; height: auto; max-height: 92dvh; }
  .drawer .dlg-body { max-height: 92dvh; border-right: 1px solid var(--line-strong); border-radius: 18px 18px 0 0; }
}

@media (max-width: 380px) {
  .topbar { gap: 6px; }
  .topbar-actions { gap: 6px; }
  .chip, .date-jump { font-size: 12.5px; }
}

/* ---------- 22. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .view:not([hidden]) { animation: none; }
  .wallpaper { transition: none; }
}

/* ---------- 23. 管理后台 ---------- */
.admin-view { max-width: 1080px; }
.admin-body { display: grid; gap: 12px; }
.admin-hint { margin: 4px 0; color: var(--ink-2); font-size: 14.5px; }

.admin-tabs { display: none; }
.fb-badge {
  display: inline-grid; place-items: center;
  min-width: 17px; height: 17px; margin-left: auto; padding: 0 4px;
  border-radius: var(--radius-pill); background: #fff; color: #050505;
  font-size: 11.5px; font-weight: 700;
}
.side-item { position: relative; }
.admin-pane[hidden] { display: none; }

/* Agent */
.agent { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.agent-side { display: flex; flex-direction: column; gap: 8px; }
.agent-new { width: 100%; }
.agent-chats { display: grid; gap: 4px; max-height: 48vh; overflow: auto; }
.agent-chat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink-2); font: inherit; text-align: left; cursor: pointer;
}
.agent-chat:hover { background: rgba(255,255,255,.05); color: var(--ink); }
.agent-chat.active { background: rgba(255,255,255,.09); border-color: var(--line); color: var(--ink); }
.agent-chat-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-chat-meta { font-size: 11.5px; color: var(--ink-3); }
.agent-chat-empty { margin: 10px 0; font-size: 13px; color: var(--ink-3); }

.agent-main { display: flex; flex-direction: column; gap: 10px; }
.agent-log {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 300px; max-height: 52vh; overflow: auto; padding: 2px;
}
.agent-empty { padding: 40px 10px; text-align: center; color: var(--ink-3); font-size: 14px; }
.agent-empty p { margin: 0; }
.agent-empty-sub { margin-top: 8px !important; font-size: 12.5px; opacity: .8; }
.agent-msg {
  max-width: 88%; padding: 10px 14px;
  border-radius: 14px; font-size: 15px; line-height: 1.68;
}
.agent-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-msg.user { align-self: flex-end; background: #fff; color: #0b0b0b; border-bottom-right-radius: 6px; }
.agent-msg.assistant { align-self: flex-start; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.agent-msg.thinking { color: var(--ink-3); font-size: 14px; }
.agent-tools { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.agent-tool {
  padding: 2px 8px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: rgba(255,255,255,.03); font-size: 11.5px; color: var(--ink-3);
}
.agent-form { display: flex; gap: 8px; align-items: flex-end; }
.agent-form textarea { flex: 1; min-height: 44px; max-height: 140px; resize: vertical; }
.agent-form .icon-btn { flex: 0 0 auto; }
.agent-preview { display: flex; align-items: center; gap: 10px; }
.agent-preview[hidden] { display: none; }
.agent-preview img { max-height: 90px; max-width: 160px; border: 1px solid var(--line); border-radius: 10px; object-fit: cover; }
.agent-shot { display: block; max-width: 260px; max-height: 220px; margin-bottom: 6px; border-radius: 10px; }

/* 反馈：后台看板 */
.fb-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.fb-stats { display: flex; flex-wrap: wrap; gap: 14px; }
.fb-stat { font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fb-actions { display: flex; gap: 8px; }
.fb-hint { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }
.fb-list { display: grid; gap: 8px; margin-top: 12px; }
.fb-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); }
.fb-item.read { opacity: .55; }
.fb-item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.fb-kind-tag {
  padding: 1px 9px; border-radius: var(--radius-pill);
  background: #fff; color: #050505; font-size: 11.5px; font-weight: 600;
}
.fb-who { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fb-text { margin: 0; font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.fb-empty { margin: 20px 0; color: var(--ink-3); font-size: 14px; }

/* 作业持续时间 / 是否上交（添加作业弹层） */
.entry-extra { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.entry-span-field { width: 132px; margin-bottom: 0; }
.field-check {
  display: inline-flex; align-items: center; gap: 9px;
  height: 44px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-ctl);
  color: var(--ink-2); font-size: 15px; cursor: pointer;
  transition: border-color .12s ease, color .12s ease;
}
.field-check:hover { border-color: var(--ink-3); color: var(--ink); }
.field-check input { width: 18px; height: 18px; accent-color: #fff; cursor: pointer; }
.entry-extra + .field-help { margin-top: 10px; }
.fb-kinds { display: flex; gap: 8px; margin-bottom: 4px; }
.fb-kind.active { background: #fff; border-color: #fff; color: #050505; }
@media (max-width: 900px) {
  .agent { grid-template-columns: minmax(0, 1fr); }
  .agent-chats { max-height: 120px; }
}

/* 待办 */
.todo-view { max-width: 760px; }
.todo-form { display: flex; flex-direction: column; gap: 10px; }
.todo-form textarea { min-height: 60px; resize: vertical; }
.todo-form-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.todo-due { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-3); }
.todo-due input { height: 36px; padding: 0 8px; }
.todo-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.todo-preview[hidden] { display: none; }
.todo-thumb { position: relative; }
.todo-thumb img { display: block; width: 84px; height: 84px; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; }
.todo-thumb .mini-btn { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; }
.todo-stats { display: flex; flex-wrap: wrap; gap: 16px; margin: 18px 0 0; }
.todo-list { display: grid; gap: 8px; margin-top: 12px; }
.todo-item { padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.03); }
.todo-item.done { opacity: .55; }
.todo-head { display: flex; align-items: flex-start; gap: 10px; }
.todo-check {
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
  display: grid; place-items: center;
  border: 1px solid var(--ink-3); border-radius: 7px;
  background: transparent; color: var(--ink); cursor: pointer;
}
.todo-check svg { width: 13px; height: 13px; }
.todo-item.done .todo-check { background: #fff; color: #050505; border-color: #fff; }
.todo-text { flex: 1; min-width: 0; margin: 0; font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.todo-item.done .todo-text { text-decoration: line-through; }
.todo-meta { flex: 0 0 auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.todo-meta.late { color: #d98a8a; }
.todo-del { width: 28px; height: 28px; flex: 0 0 auto; }
.todo-pics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.todo-pics img { display: block; width: 92px; height: 92px; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; }

/* 背单词 */
.study-view { max-width: 720px; }
.study-head { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 14px; }
.study-progress { margin-left: auto; font-variant-numeric: tabular-nums; }
.study-box { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.study-card {
  width: 100%; min-height: 260px;
  display: grid; place-items: center;
  padding: 26px 22px;
  border: 1px solid var(--line); border-radius: 16px;
  background: rgba(255,255,255,.04);
  cursor: pointer; transition: background-color .15s ease;
}
.study-card:hover { background: rgba(255,255,255,.07); }
.study-face { text-align: center; }
.study-front { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.study-back { display: none; width: 100%; text-align: left; }
.study-card.flipped .study-front { display: none; }
.study-card.flipped .study-back { display: block; }
.study-word { font-size: 2.1rem; font-weight: 600; letter-spacing: -.01em; }
.study-ph { font-size: .95rem; color: var(--ink-3); }
.study-tip { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }
.study-senses { margin: 0; padding-left: 1.1em; display: grid; gap: 5px; }
.study-senses li { font-size: 1rem; line-height: 1.7; }
.study-ex { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.study-ex .en { margin: 0; font-size: .98rem; }
.study-ex .zh { margin: 3px 0 0; font-size: .9rem; color: var(--ink-3); }
.study-speak { align-self: center; }
.study-grade { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.grade-btn {
  padding: 9px 20px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: rgba(255,255,255,.05); color: var(--ink-2);
  font: inherit; font-size: 14px; cursor: pointer;
}
.grade-btn:hover { background: rgba(255,255,255,.1); color: var(--ink); }
.grade-btn.again { border-color: #4a3030; }
.grade-btn.good { border-color: #2f4a38; }
.study-done { padding: 40px 10px; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; color: var(--ink-2); }
.study-done p { margin: 0; }
.study-sub { font-size: 13px; color: var(--ink-3); }
.dict-star { width: 34px; height: 34px; }
.dict-star.on { color: #fff; }
.dict-star.on svg { fill: currentColor; }

/* ---------- 英语助教（词典内） ---------- */
.en-panel { display: flex; flex-direction: column; gap: 10px; }
.en-back { align-self: flex-start; display: inline-flex; }
.en-question {
  margin: 0; padding: 3px 10px;
  border-left: 2px solid var(--ink-3);
  font-size: .86rem; color: var(--ink-2);
  overflow-wrap: anywhere;
}
.en-answer { display: flex; flex-direction: column; gap: 6px; }
.en-label {
  margin: 6px 0 0;
  font-size: .74rem; letter-spacing: .12em;
  color: var(--ink-3); text-transform: uppercase;
}
.en-p { margin: 0; font-size: .95rem; line-height: 1.75; color: var(--ink); overflow-wrap: anywhere; }
.en-list { margin: 2px 0 0; padding-left: 1.1em; display: grid; gap: 4px; }
.en-list li { font-size: .95rem; line-height: 1.7; color: var(--ink-2); }
.en-refuse {
  margin: 0; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.03);
  font-size: .92rem; color: var(--ink-2);
}

/* ---------- 词典 ---------- */
.dict-view { max-width: 1120px; }
.dict-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.dict-search { position: relative; flex: 1; display: flex; align-items: center; }
.dict-search svg {
  position: absolute; left: 14px; width: 18px; height: 18px;
  color: var(--ink-3); pointer-events: none;
}
.dict-search input {
  width: 100%; height: 48px; padding: 0 16px 0 42px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.04); color: var(--ink); font: inherit;
}
.dict-search input:focus { outline: none; border-color: var(--line-strong); background: rgba(255,255,255,.07); }
.dict-count { color: var(--ink-3); font-size: .8rem; white-space: nowrap; }
.dict-body { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.dict-list { display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 250px); overflow: auto; }
.dict-row {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px;
  width: 100%; padding: 10px 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-2); font: inherit; text-align: left; cursor: pointer;
}
.dict-row:hover { background: rgba(255,255,255,.06); color: var(--ink); }
.dict-row.active { background: rgba(255,255,255,.10); color: #fff; }
.dict-row-w { font-weight: 600; font-size: .95rem; }
.dict-row-p { color: var(--ink-3); font-size: .78rem; }
.dict-row-t { grid-column: 1 / -1; font-size: .78rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dict-detail {
  min-height: 220px; padding: 22px 24px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
}
.dict-empty { padding: 30px 6px; text-align: center; color: var(--ink-3); font-size: .9rem; }
.dict-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 14px; }
.dict-head h2 { margin: 0; font-size: 1.65rem; letter-spacing: -.01em; }
.dict-ph { padding: 0; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: .85rem; cursor: pointer; }
.dict-ph:hover { color: var(--ink); }
.dict-sound { width: 32px; height: 32px; }
.dict-senses { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; font-size: .93rem; }
.dict-sec { margin-top: 20px; }
.dict-sec h3 {
  margin: 0 0 8px; font-size: .72rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.dict-exs { display: grid; gap: 10px; }
.dict-ex { margin: 0; }
.dict-ex .en { margin: 0; font-size: .9rem; color: var(--ink); }
.dict-ex .zh { margin: 2px 0 0; font-size: .84rem; color: var(--ink-3); }
.dict-ai { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.dict-ai-tip { margin: 8px 0 0; font-size: .78rem; color: var(--ink-3); }
.dict-usage { margin: 0; padding-left: 1.1em; display: grid; gap: 5px; font-size: .9rem; }
.dict-confuse { margin: 0; font-size: .88rem; color: var(--ink-2); }
/* ---------- 词典：结构与深色默认样式 ---------- */
.dict-senses { padding-left: 0; list-style: none; gap: 8px; }
.dict-sense { display: flex; gap: 10px; align-items: baseline; line-height: 1.55; }
.dict-pos {
  flex: 0 0 auto; padding: 2px 7px; border-radius: 6px;
  background: rgba(255,255,255,.10); color: var(--ink-2);
  font-size: .68rem; letter-spacing: .02em;
}
.dict-badge {
  padding: 3px 8px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: var(--ink-3);
  font-size: .7rem; letter-spacing: .04em;
}
.dict-ph { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--ink-2); }
.dict-ph:hover { background: rgba(255,255,255,.10); color: var(--ink); }
.dict-sound { border-radius: 50%; background: rgba(255,255,255,.06); border: 0; }
.dict-sound:hover { background: rgba(255,255,255,.10); }
.dict-clear {
  position: absolute; right: 8px; width: 34px; height: 34px;
  display: none; place-items: center;
  border: 0; background: transparent; color: var(--ink-3);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.dict-clear.on { display: grid; }
.dict-clear:hover { color: var(--ink); }
.dict-tips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.dict-tip {
  padding: 6px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: rgba(255,255,255,.05);
  color: var(--ink-2); font: inherit; font-size: .85rem; cursor: pointer;
}
.dict-tip:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dict-empty p { margin: 0; }
.dict-back { display: none; }

@media (max-width: 900px) {
  .dict-body { grid-template-columns: 1fr; }
  .dict-list { max-height: 38vh; }
  .dict-detail { padding: 18px; }
  .dict-back { display: inline-flex; }
  .dict-view.has-word .dict-toolbar,
  .dict-view.has-word .dict-list { display: none; }
}
