/* ============================================================
   AI OS — editorial product UI
   暖纸(light) × 墨夜(dark) 双主题 · 纸面编辑部气质
   设计原则：排版驱动、单色强调、动效克制
   ============================================================ */

:root {
  /* light — 暖纸 */
  --paper: #faf8f2;
  --paper-2: #f2eee3;
  --card: #fffdf7;
  --ink: #17140e;
  --ink-2: #5b564c;
  --ink-3: #928b7c;
  --line: #e7e0cf;
  --line-strong: #d8cfba;
  --terra: #c96442;
  --terra-2: #a84e2e;
  --terra-soft: #f7e9df;
  --terra-ink: #3d1f14;
  --gold: #d9a441;
  --blue: #2f5fa8;
  --ok: #3e7d4f;
  --shadow: 0 1px 0 rgba(23, 20, 14, 0.04), 0 14px 44px rgba(23, 20, 14, 0.06);
  --shadow-lift: 0 2px 0 rgba(23, 20, 14, 0.03), 0 24px 60px rgba(23, 20, 14, 0.1);
  --glass: rgba(250, 248, 242, 0.82);
  --glass-strong: rgba(250, 248, 242, 0.94);
  --radius: 18px;
  --rail: 236px;
  --serif: "Instrument Serif", "Songti SC", "Noto Serif SC", Georgia, serif;
  --sans: "DM Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --max-read: 760px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  /* dark — 墨夜 */
  --paper: #100f0c;
  --paper-2: #181611;
  --card: #1b1913;
  --ink: #f0ead9;
  --ink-2: #b5ad9b;
  --ink-3: #7e7767;
  --line: #2a271f;
  --line-strong: #3a3529;
  --terra: #e0855c;
  --terra-2: #c96442;
  --terra-soft: rgba(224, 133, 92, 0.14);
  --terra-ink: #f6ddc9;
  --gold: #e0b45e;
  --blue: #7ba2e0;
  --ok: #6fbf87;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 16px 48px rgba(0, 0, 0, 0.42);
  --shadow-lift: 0 2px 0 rgba(0, 0, 0, 0.3), 0 28px 70px rgba(0, 0, 0, 0.55);
  --glass: rgba(16, 15, 12, 0.78);
  --glass-strong: rgba(16, 15, 12, 0.92);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.35s ease, color 0.35s ease;
}

::selection { background: var(--terra); color: #fff; }
:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; border-radius: 6px; }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--terra); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--ink-2);
  word-break: break-all;
}
.error { color: #c33; font-size: 13px; margin: 8px 0 0; }
.accent {
  text-decoration: underline;
  text-decoration-color: var(--terra);
  text-decoration-thickness: 0.085em;
  text-underline-offset: 0.16em;
}

/* —— 阅读进度条 —— */
#progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 90;
  background: var(--terra);
  transition: width 0.08s linear, opacity 0.3s;
  opacity: 0;
}
#progress.on { opacity: 1; }

/* —— Shell —— */
.shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: var(--rail) 1fr;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 26px;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  border-radius: 14px;
  text-align: left;
  transition: background 0.15s;
}
.rail-brand:hover { background: rgba(128, 110, 80, 0.1); }
.rail-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 11px;
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(23, 20, 14, 0.12);
}
.rail-brand-text { display: flex; flex-direction: column; gap: 2px; }
.rail-name {
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.rail-tag {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.14em;
}

.rail-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.rail-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  transition: background 0.16s, color 0.16s;
}
.rail-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.8; }
.rail-item:hover { background: rgba(128, 110, 80, 0.1); color: var(--ink); }
.rail-item.active {
  background: var(--terra-soft);
  color: var(--terra-ink);
}
.rail-item.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 20%;
  height: 60%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--terra);
}
.rail-item.active svg { opacity: 1; color: var(--terra); }

.rail-foot { margin-top: auto; display: grid; gap: 10px; }

.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
  text-decoration: none !important;
}
.btn-download:hover {
  border-color: var(--terra);
  color: var(--terra);
}
.btn-download svg { width: 16px; height: 16px; }

.rail-user {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 10px 12px;
  text-align: left;
  transition: border-color 0.15s;
}
.rail-user:hover { border-color: var(--line-strong); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--terra);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.rail-user-meta { display: flex; flex-direction: column; min-width: 0; }
.rail-user-meta strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-user-meta em {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
}

/* —— Stage —— */
.stage {
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 30px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.eyebrow {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.mobile-brand {
  display: none;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 20px;
  padding: 0;
}
.mobile-brand img { width: 32px; height: 32px; border-radius: 8px; }

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s;
}
.btn-icon:hover { color: var(--ink); border-color: var(--line-strong); }
.btn-icon svg { width: 18px; height: 18px; }
.btn-icon.spinning svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#btnTheme .icon-sun { display: none; }
[data-theme="dark"] #btnTheme .icon-sun { display: block; }
[data-theme="dark"] #btnTheme .icon-moon { display: none; }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  background: var(--terra);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s;
  text-decoration: none !important;
}
.btn-pill:hover { background: var(--terra-2); }

.main {
  flex: 1;
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 8px 30px 90px;
}

.view { display: none; }
.view.active { display: block; animation: viewIn 0.32s var(--ease-out); }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* —— Hero：报纸刊头式 · 双栏 —— */
.hero {
  margin: 26px 0 30px;
  padding: 28px 0 30px;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: end;
}
.hero-main,
.hero-side { min-width: 0; }
.hero-eyebrow {
  margin: 0 0 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terra);
}
.hero-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 5.4vw, 58px);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.hero-sub {
  margin: 0 0 24px;
  color: var(--ink-2);
  font-size: 15.5px;
  max-width: 34em;
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-end;
}
.hero-stat { display: flex; flex-direction: column; gap: 1px; }
.hero-stat b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.hero-stat span {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.hero-actions { margin-left: auto; display: flex; gap: 8px; }

/* —— 页头 —— */
.page-head { margin: 14px 0 24px; }
.page-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(34px, 4.4vw, 46px);
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.page-sub {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  max-width: 36em;
}

/* —— chips —— */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.status-line {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-line::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
}
.status-line.bad::before { background: #c33; }

/* —— feed cards —— */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feed-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px 19px;
  box-shadow: var(--shadow);
  transition: transform 0.2s var(--ease-out), border-color 0.2s, box-shadow 0.2s;
  display: grid;
  gap: 10px;
  position: relative;
  overflow: hidden;
  animation: cardIn 0.45s var(--ease-out) both;
  animation-delay: var(--d, 0ms);
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.feed-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--terra);
  opacity: 0;
  transition: opacity 0.2s;
}
.feed-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}
.feed-card:hover::before { opacity: 1; }
.feed-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.feed-card .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--terra);
  background: var(--terra-soft);
  padding: 4px 11px;
  border-radius: 999px;
}
.feed-card .time {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}
.feed-card h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 2.3vw, 25px);
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--ink);
  transition: color 0.15s;
}
.feed-card:hover h3 { color: var(--terra-ink); }
.feed-card .excerpt {
  margin: 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-card .foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}
.feed-card .read-hint {
  font-size: 12.5px;
  color: var(--terra);
  font-weight: 600;
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.18s var(--ease-out);
}
.feed-card:hover .read-hint {
  opacity: 1;
  transform: none;
}

/* —— article —— */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 6px 0 18px;
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.15s, transform 0.15s;
}
.back-link:hover { color: var(--terra); transform: translateX(-2px); }

.article { max-width: var(--max-read); }
.article .source-tag {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--terra);
  background: var(--terra-soft);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.article h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.16;
  letter-spacing: -0.03em;
}
.article .origin {
  color: var(--ink-3);
  font-size: 13.5px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.article .origin a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.article .origin a:hover { color: var(--terra); }

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 30px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--terra);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.btn:hover { background: var(--terra-2); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: transparent; border-color: var(--terra); color: var(--terra); }

.article h2.sec {
  margin: 30px 0 12px;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.article h2.sec::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.article .highlights {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.article .highlights li {
  position: relative;
  padding: 14px 16px 14px 40px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink-2);
  font-size: 14.5px;
}
.article .highlights li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 21px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terra);
}
.article .body {
  white-space: pre-wrap;
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--ink);
}
.article .body::first-letter {
  font-family: var(--serif);
  font-size: 1.6em;
  line-height: 1;
  color: var(--terra);
}
.comic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}
.comic-grid img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.podcast-box {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-top: 10px;
}
.podcast-box audio { width: 100%; margin-top: 12px; }

/* —— sources —— */
.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.source-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.18s var(--ease-out), border-color 0.18s, box-shadow 0.18s;
  animation: cardIn 0.45s var(--ease-out) both;
  animation-delay: var(--d, 0ms);
  position: relative;
  overflow: hidden;
}
.source-item::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--terra);
  opacity: 0;
  transition: opacity 0.2s;
}
.source-item:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.source-item:hover::after { opacity: 1; }
.source-item .cat {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 700;
  margin-bottom: 8px;
}
.source-item h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: -0.01em;
}
.source-item p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

/* —— panels —— */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.panel h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.panel p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.panel .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.serif-quote {
  font-family: var(--serif) !important;
  font-size: 30px !important;
  color: var(--ink) !important;
  margin: 4px 0 8px !important;
  letter-spacing: -0.02em;
}
.status-ok { color: var(--ok); font-size: 13.5px; margin-top: 6px !important; font-weight: 600; }
.status-bad { color: #c33; font-size: 13.5px; margin-top: 6px !important; font-weight: 600; }

/* —— theme switch in settings —— */
.theme-row { display: flex; gap: 8px; margin-top: 12px; }
.theme-opt {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.theme-opt:hover { border-color: var(--line-strong); }
.theme-opt.active { border-color: var(--terra); color: var(--terra); background: var(--terra-soft); }
.theme-swatch {
  width: 100%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.theme-swatch.light { background: linear-gradient(135deg, #faf8f2 55%, #c96442 55%, #d9a441); }
.theme-swatch.dark { background: linear-gradient(135deg, #14120e 55%, #e0855c 55%, #e0b45e); }

/* —— mobile tabbar —— */
.tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: calc(60px + env(safe-area-inset-bottom));
  padding: 6px 10px env(safe-area-inset-bottom);
  background: var(--glass-strong);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 12px;
  transition: color 0.15s, background 0.15s;
}
.tab.active { color: var(--terra); background: var(--terra-soft); }

/* —— modal —— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 13, 9, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}
.modal-sheet {
  position: relative;
  width: min(430px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px 26px 26px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
  animation: sheetIn 0.28s var(--ease-out);
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.modal-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 12px;
}
.modal-sheet h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: -0.02em;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
}
.field input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--card);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  border-color: var(--terra);
  box-shadow: 0 0 0 3px var(--terra-soft);
}
.row-btns { display: flex; gap: 10px; margin-top: 20px; }
.row-btns .btn { flex: 1; }

/* —— toast —— */
#toastWrap {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(480px, calc(100vw - 32px));
}
.toast {
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.26s var(--ease-out);
  max-width: 100%;
  text-align: center;
}
.toast.show { opacity: 1; transform: none; }
.toast.ok { background: #2f6b40; color: #fff; }
.toast.err { background: #93331f; color: #fff; }

/* —— empty / skeleton —— */
.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 44px 24px;
  text-align: center;
  color: var(--ink-3);
  background: var(--card);
}
.skel {
  height: 118px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--paper-2), var(--card), var(--paper-2));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  border: 1px solid var(--line);
}
.skel + .skel { margin-top: 14px; }
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* —— responsive —— */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .mobile-brand { display: inline-flex; }
  .eyebrow { display: none; }
  .topbar { padding: 12px 16px; }
  .main {
    width: 100%;
    padding: 4px 16px calc(92px + env(safe-area-inset-bottom));
  }
  .tabbar { display: grid; }
  .page-title { font-size: 32px; }
  .hero {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
    margin-top: 14px;
    padding: 20px 0 22px;
  }
  .hero-stats { gap: 20px; }
  .hero-actions { margin-left: 0; width: 100%; }
  .comic-grid { grid-template-columns: 1fr; }
  #toastWrap { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (min-width: 901px) {
  #btnAccountMobile { display: none; }
}

/* —— 减少动态偏好 —— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
