/* ==========================================================================
   公众号监控 · server edition
   A quiet editorial console: paper, ink, one vermilion accent.
   ========================================================================== */

:root {
  --paper: #f3efe6;
  --paper-2: #ebe5d8;
  --paper-3: #e2dacb;
  --card: #faf7f0;
  --ink: #1d1b17;
  --ink-2: #4f4a41;
  --muted: #857d70;
  --rule: #d8d0c0;
  --rule-strong: #b9ae99;
  --accent: #b4402a;
  --accent-soft: rgba(180, 64, 42, .10);
  --green: #2f6a4e;
  --green-soft: rgba(47, 106, 78, .12);
  --amber: #8f6418;
  --log-bg: #211f1a;
  --log-ink: #e7dfd0;
  --log-dim: #9d9484;
  --shadow: 0 1px 0 rgba(29, 27, 23, .05), 0 18px 40px -28px rgba(29, 27, 23, .45);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", "Liberation Mono", ui-monospace, monospace;
  --radius: 5px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151410;
    --paper-2: #1c1a15;
    --paper-3: #24211b;
    --card: #1a1814;
    --ink: #ece5d7;
    --ink-2: #c4bba9;
    --muted: #8f8574;
    --rule: #322f28;
    --rule-strong: #4b463b;
    --accent: #e06a4b;
    --accent-soft: rgba(224, 106, 75, .14);
    --green: #6fb08c;
    --green-soft: rgba(111, 176, 140, .14);
    --amber: #d0a25c;
    --log-bg: #0e0d0b;
    --log-ink: #ddd5c6;
    --log-dim: #8a8171;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -28px rgba(0, 0, 0, .9);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(1100px 520px at 92% -12%, var(--accent-soft), transparent 62%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(120, 105, 80, .045) 27px 28px),
    var(--paper);
  background-attachment: fixed;
}

code {
  font-family: var(--mono);
  font-size: .92em;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0 4px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; }

::selection { background: var(--accent); color: var(--paper); }

/* ------------------------------------------------------------------ boot */

.boot {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background: var(--paper);
}
.boot-seal {
  width: 54px; height: 54px; display: grid; place-items: center;
  background: var(--accent); color: var(--paper);
  font-family: var(--serif); font-size: 28px;
  border-radius: 6px; animation: breathe 1.6s ease-in-out infinite;
}
.boot-text { font-family: var(--mono); font-size: 12px; letter-spacing: .18em; color: var(--muted); }

/* ------------------------------------------------------------------ login */

.login-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 28px;
}
.login-card {
  width: min(430px, 100%);
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 34px 30px;
  animation: rise .6s cubic-bezier(.2, .7, .2, 1) both;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.login-brand strong { display: block; font-family: var(--serif); font-size: 17px; }
.login-brand small { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; color: var(--muted); margin-top: 2px; }
.login-title { font-size: 30px; letter-spacing: -.02em; margin-bottom: 10px; }
.login-lede { color: var(--ink-2); font-size: 13px; line-height: 1.75; margin: 0 0 24px; }
.login-foot { margin: 20px 0 0; text-align: center; font-size: 11.5px; color: var(--muted); font-family: var(--mono); letter-spacing: .04em; }

.seal {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--paper);
  font-family: var(--serif); font-size: 21px;
  border-radius: 5px;
  transform: rotate(-2deg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}

/* ------------------------------------------------------------------ forms */

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; margin-bottom: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.field input {
  width: 100%; padding: 10px 12px;
  font: inherit; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input::placeholder { color: var(--muted); opacity: .75; }

.check { display: flex; align-items: flex-start; gap: 9px; margin: 10px 0; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { margin: 3px 0 0; accent-color: var(--accent); }

.form-error {
  margin: 0 0 14px; padding: 9px 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  font-size: 12.5px;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .08s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #f8f3e9;
}
.btn-primary:hover { background: var(--accent); filter: brightness(1.08); border-color: var(--accent); }
.btn-quiet { border-color: var(--rule); color: var(--ink-2); }
.btn-block { width: 100%; padding: 11px 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 12px; }

.link-btn {
  padding: 0; border: 0; background: none;
  font: inherit; font-size: 12px; color: var(--accent);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

.icon-btn {
  flex: none; width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--rule); border-radius: 50%;
  background: transparent; color: var(--ink-2);
  font-size: 13px; cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--paper-3); color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ shell */

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

.rail {
  position: sticky; top: 0; align-self: start;
  height: 100vh;
  display: flex; flex-direction: column; gap: 30px;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--rule);
  background:
    linear-gradient(180deg, var(--paper-2), transparent 55%),
    var(--paper);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand-text strong { display: block; font-family: var(--serif); font-size: 16px; letter-spacing: .02em; }
.brand-text small { display: block; font-family: var(--mono); font-size: 8.5px; letter-spacing: .16em; color: var(--muted); margin-top: 3px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: baseline; gap: 12px;
  width: 100%; padding: 9px 12px;
  border: 0; border-left: 2px solid transparent;
  background: none; text-align: left;
  font: inherit; font-size: 13.5px; color: var(--ink-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { background: var(--paper-2); color: var(--ink); }
.nav-item.is-active {
  border-left-color: var(--accent);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
}
.nav-no { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: .05em; }
.nav-item.is-active .nav-no { color: var(--accent); }

.rail-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 6px; }
.rail-foot .link-btn { color: var(--muted); font-size: 11.5px; }
.rail-foot .link-btn:hover { color: var(--ink); }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
  color: var(--ink-2);
  cursor: default;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.chip.is-on { color: var(--green); border-color: var(--green-soft); background: var(--green-soft); }
.chip.is-on .dot { background: var(--green); animation: pulse 2.4s ease-in-out infinite; }
.chip.is-bad { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }
.chip.is-bad .dot { background: var(--accent); }
.chip-login { cursor: pointer; }
.chip-login:hover { border-color: var(--ink-2); }
.chip-busy { color: var(--amber); border-color: var(--rule); }

.spinner {
  width: 10px; height: 10px; flex: none;
  border: 1.5px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ------------------------------------------------------------------ main */

.main {
  min-width: 0;
  padding: 34px clamp(20px, 4.2vw, 62px) 90px;
  max-width: 1240px;
}

.masthead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}
.eyebrow {
  margin: 0 0 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted);
}
.view-title { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.02em; line-height: 1.15; }
.masthead-right { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ reveal */

.reveal { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
.view > .reveal:nth-child(1) { animation-delay: .02s; }
.view > .reveal:nth-child(2) { animation-delay: .07s; }
.view > .reveal:nth-child(3) { animation-delay: .12s; }
.view > .reveal:nth-child(4) { animation-delay: .17s; }

/* ------------------------------------------------------------------ hero */

.hero { padding: 8px 0 30px; max-width: 760px; }
.hero-title {
  font-size: clamp(30px, 4.6vw, 52px);
  line-height: 1.14; letter-spacing: -.025em;
  margin: 4px 0 14px;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-lede { margin: 0; max-width: 560px; color: var(--ink-2); font-size: 14px; line-height: 1.85; }

/* ------------------------------------------------------------------ stats */

.stats-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--ink);
  background: var(--card);
  margin-bottom: 26px;
}
.stat {
  padding: 20px 20px 18px;
  border-left: 1px solid var(--rule);
  min-width: 0;
}
.stat:first-child { border-left: 0; }
.stat-label { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em; color: var(--muted); }
.stat-value {
  display: block; margin: 10px 0 4px;
  font-family: var(--serif); font-size: 40px; font-weight: 600;
  line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat-value-sm { font-size: 24px; line-height: 1.15; }
.stat-note { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-accent { background: var(--accent-soft); }
.stat-accent .stat-value { color: var(--accent); }

/* ------------------------------------------------------------------ panels */

.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  min-width: 0;
}
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  margin-bottom: 16px;
}
.panel-title { font-size: 18px; letter-spacing: -.01em; }
.panel-hint { font-family: var(--mono); font-size: 9px; letter-spacing: .18em; color: var(--muted); }
.panel-note { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.7; }

.two-col {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 18px; margin-bottom: 26px;
}

/* ------------------------------------------------------------------ log */

.log-mini, .log-full {
  font-family: var(--mono); font-size: 11.5px; line-height: 1.75;
  background: var(--log-bg); color: var(--log-ink);
  border-radius: 3px;
  padding: 14px 16px;
  overflow: auto;
}
.log-mini { height: 196px; }
.log-full { height: min(62vh, 620px); }
.log-line { display: flex; gap: 10px; padding: 1px 0; }
.log-time { color: var(--log-dim); flex: none; }
.log-msg { white-space: pre-wrap; word-break: break-word; color: var(--log-ink); }
.log-line.is-warn .log-msg { color: #e6b878; }
.log-line.is-err .log-msg { color: #ef8d72; }
.log-empty { color: var(--log-dim); }

/* ------------------------------------------------------------------ latest */

.latest-list { display: flex; flex-direction: column; }
.latest-item {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 16px; align-items: baseline;
  padding: 14px 2px;
  border-top: 1px solid var(--rule);
  cursor: pointer;
  transition: background .15s;
}
.latest-item:first-child { border-top: 0; }
.latest-item:hover { background: var(--paper-2); }
.latest-time { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.latest-title { font-family: var(--serif); font-size: 16px; line-height: 1.45; margin: 0; letter-spacing: -.005em; }
.latest-account { font-family: var(--mono); font-size: 10px; color: var(--accent); letter-spacing: .04em; white-space: nowrap; }

/* ------------------------------------------------------------------ view actions */

.view-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.view-hint { font-size: 12px; color: var(--muted); }

.search {
  position: relative; flex: 1 1 240px; min-width: 180px; max-width: 420px;
}
.search input {
  width: 100%; padding: 9px 12px 9px 34px;
  font: inherit; font-size: 13px; color: var(--ink);
  background: var(--card);
  border: 1px solid var(--rule-strong); border-radius: 3px;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round;
}
.select {
  padding: 9px 12px; font: inherit; font-size: 13px; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule-strong); border-radius: 3px;
  max-width: 220px;
}

/* ------------------------------------------------------------------ table */

.table-wrap { overflow-x: auto; margin: -6px -4px; padding: 0 4px; }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th {
  text-align: left; padding: 8px 10px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: .14em; color: var(--muted);
  border-bottom: 1px solid var(--rule-strong);
  white-space: nowrap;
}
.table td {
  padding: 12px 10px; border-bottom: 1px solid var(--rule);
  vertical-align: middle; font-size: 13px;
}
.table tbody tr:hover { background: var(--paper-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.col-switch { width: 58px; }
.col-time { width: 112px; white-space: nowrap; }
.col-num { width: 64px; text-align: right; }
.col-actions { width: 44px; text-align: right; }
.acc-name { font-family: var(--serif); font-size: 15px; }
.acc-sub { display: block; font-family: var(--mono); font-size: 9.5px; color: var(--muted); margin-top: 2px; }
.acc-latest { color: var(--ink-2); }
.acc-latest a { color: var(--ink); }
.acc-time { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }
.acc-count { font-family: var(--mono); font-size: 11px; color: var(--ink-2); }

.switch { position: relative; display: inline-flex; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  width: 34px; height: 19px; border-radius: 999px;
  background: var(--paper-3); border: 1px solid var(--rule-strong);
  transition: background .18s, border-color .18s;
  position: relative;
}
.switch-track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--rule-strong);
  transition: transform .18s, background .18s;
}
.switch input:checked + .switch-track { background: var(--green); border-color: var(--green); }
.switch input:checked + .switch-track::after { transform: translateX(15px); background: #fff; border-color: #fff; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------------------ article list */

.article-list { border-top: 1px solid var(--rule-strong); }
.article-item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) 104px;
  gap: 14px; align-items: start;
  padding: 18px 6px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: background .15s;
}
.article-item:hover { background: var(--card); }
.article-index { font-family: var(--mono); font-size: 10px; color: var(--muted); padding-top: 4px; }
.article-title { font-family: var(--serif); font-size: 18px; line-height: 1.45; margin: 0 0 5px; letter-spacing: -.005em; }
.article-excerpt {
  margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-side { text-align: right; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.article-side .acc { color: var(--accent); display: block; margin-top: 4px; }

.load-more-wrap { display: flex; justify-content: center; padding: 26px 0 0; }

.empty {
  padding: 54px 20px; text-align: center;
  color: var(--muted); font-size: 13px;
}
.empty strong { display: block; font-family: var(--serif); font-size: 18px; color: var(--ink-2); margin-bottom: 6px; }

/* ------------------------------------------------------------------ settings */

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-grid .panel:first-child { grid-row: span 2; }
.settings-actions { grid-column: 1 / -1; }
.settings-actions .panel-head { margin-bottom: 12px; }
.settings-password { margin-top: 18px; max-width: 640px; }
.settings-password .btn-row { margin-top: 16px; margin-bottom: 0; }

/* ------------------------------------------------------------------ reader */

.drawer-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(20, 18, 14, .36);
  backdrop-filter: blur(2px);
  animation: fade .25s ease both;
}
.reader {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(780px, 100%);
  display: flex; flex-direction: column;
  background: var(--card);
  border-left: 1px solid var(--rule);
  box-shadow: -30px 0 60px -40px rgba(0, 0, 0, .5);
  animation: slide-in .35s cubic-bezier(.2, .7, .2, 1) both;
}
.reader-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 26px clamp(20px, 4vw, 40px) 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}
.reader-meta { min-width: 0; }
.reader-title { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; letter-spacing: -.015em; margin: 4px 0 8px; }
.reader-sub { font-family: var(--mono); font-size: 10.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dot-sep { color: var(--rule-strong); }
.reader-sub a { color: var(--accent); }
.reader-body-slot { overflow: auto; }

.prose {
  padding: 30px clamp(20px, 4vw, 40px) 90px;
  overflow-y: auto;
  font-size: 16px; line-height: 1.95; color: var(--ink);
  max-width: 72ch;
}
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--serif); line-height: 1.4; margin: 1.6em 0 .7em; letter-spacing: -.01em; }
.prose h2 { font-size: 23px; }
.prose h3 { font-size: 19px; }
.prose p { margin: 0 0 1.05em; }
.prose img { max-width: 100%; height: auto; display: block; margin: 1.4em auto; border-radius: 2px; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose strong { font-weight: 650; }
.prose blockquote {
  margin: 1.3em 0; padding: 2px 0 2px 18px;
  border-left: 2px solid var(--accent);
  color: var(--ink-2);
}
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .35em 0; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.prose code {
  font-size: .88em; padding: 1px 5px;
  background: var(--paper-2); border: 1px solid var(--rule);
}
.prose pre {
  background: var(--log-bg); color: var(--log-ink);
  padding: 16px 18px; border-radius: 3px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }

/* ------------------------------------------------------------------ modal */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 55;
  display: grid; place-items: center;
  padding: 22px;
  background: rgba(20, 18, 14, .4);
  backdrop-filter: blur(3px);
  animation: fade .2s ease both;
}
.modal {
  width: min(520px, 100%);
  max-height: 88vh; overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 28px 22px;
  animation: rise .3s cubic-bezier(.2, .7, .2, 1) both;
}
.modal-title { font-size: 22px; letter-spacing: -.015em; margin-bottom: 10px; }
.modal-body { color: var(--ink-2); font-size: 13.5px; line-height: 1.8; }
.modal-body p { margin: 0 0 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.modal-qr { display: grid; place-items: center; gap: 14px; padding: 12px 0 4px; }
.modal-qr img {
  width: 220px; height: 220px; image-rendering: pixelated;
  border: 8px solid #fff; border-radius: 4px; background: #fff;
  box-shadow: 0 8px 24px -14px rgba(0, 0, 0, .5);
}
.modal-qr .qr-status { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: center; }
.qr-placeholder {
  width: 220px; height: 220px; border: 1px dashed var(--rule-strong);
  display: grid; place-items: center; color: var(--muted); font-size: 12px;
}

/* ------------------------------------------------------------------ toast */

.toast-root {
  position: fixed; right: 22px; bottom: 22px; z-index: 70;
  display: flex; flex-direction: column; gap: 9px;
  max-width: min(360px, calc(100vw - 44px));
}
.toast {
  padding: 12px 16px;
  background: var(--ink); color: var(--paper);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  font-size: 12.5px; line-height: 1.6;
  box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .6);
  animation: toast-in .28s cubic-bezier(.2, .7, .2, 1) both;
  transition: opacity .22s ease, transform .22s ease;
}
.toast.is-ok { border-left-color: var(--green); }
.toast.is-err { border-left-color: #e0563b; }
.toast.is-out { opacity: 0; transform: translateY(6px); }

body.reading { overflow: hidden; }

/* ------------------------------------------------------------------ animation */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in {
  from { transform: translateX(36px); opacity: .3; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-in {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--green-soft); }
  50% { box-shadow: 0 0 0 4px transparent; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1020px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; border-top: 1px solid var(--rule); }
  .stat:nth-child(4) { border-top: 1px solid var(--rule); }
  .two-col { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid .panel:first-child { grid-row: auto; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: sticky; top: 0; z-index: 30;
    height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 10px 14px;
    padding: 12px 16px;
    border-right: 0; border-bottom: 1px solid var(--rule);
    background: var(--paper);
  }
  .brand .seal { width: 30px; height: 30px; font-size: 16px; }
  .brand-text strong { font-size: 14px; }
  .brand-text small { display: none; }
  .nav {
    order: 3; width: 100%;
    flex-direction: row; gap: 2px;
    overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item {
    width: auto; flex: none;
    padding: 6px 10px;
    border-left: 0; border-bottom: 2px solid transparent;
    font-size: 12.5px;
  }
  .nav-item.is-active { border-left-color: transparent; border-bottom-color: var(--accent); background: none; }
  .nav-no { display: none; }
  .rail-foot { margin-left: auto; margin-top: 0; padding: 0; }
  .main { padding: 24px 16px 70px; }
  .masthead { align-items: flex-start; flex-direction: column; gap: 10px; }
  .masthead-right { padding-bottom: 0; }
  .article-item { grid-template-columns: 28px minmax(0, 1fr); }
  .article-side { grid-column: 2; text-align: left; }
  .article-side .acc { display: inline; margin-left: 8px; }
  .latest-item { grid-template-columns: 52px minmax(0, 1fr); }
  .latest-account { grid-column: 2; }
  .reader { border-left: 0; }
  .modal { padding: 22px 20px 18px; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 16px 14px 14px; }
  .stat-value { font-size: 32px; }
  .stat-value-sm { font-size: 20px; }
  .hero-title { font-size: 30px; }
  .view-actions .search { flex: 1 1 100%; max-width: none; }
  .reader-head { padding: 18px 16px 14px; }
  .prose { padding: 22px 16px 70px; font-size: 15.5px; }
  .toast-root { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}
