:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --paper: #fffefa;
  --panel: #fffefa;
  --surface: #f8f7f3;
  --line: #dedfd9;
  --line-soft: #ebece7;
  --text: #242827;
  --muted: #7b8581;
  --muted-2: #9aa29d;
  --blue: #20627b;
  --blue-soft: #edf4f5;
  --green: #5d7665;
  --green-soft: #edf3ed;
  --amber: #9b6a37;
  --amber-soft: #fbf2e5;
  --brick: #aa5946;
  --brick-soft: #fbefeb;
  --shadow: 0 6px 24px rgba(70, 77, 70, 0.08);
}

[hidden] {
  display: none !important;
}

* { box-sizing: border-box; }

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

h1, h2, h3, p, figure { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
.item:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(170, 89, 70, 0.46);
  outline-offset: 2px;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(18px, 7vw, 110px) 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.top-actions { display: flex; align-items: center; gap: 12px; }
.data-health { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 4px 6px; color: var(--green); background: transparent; font-size: 10px; white-space: nowrap; }
.data-health::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(93, 118, 101, .11); }
.data-health.warning { color: var(--amber); }
.data-health:hover { background: var(--green-soft); }
.shortcut-hint { color: var(--muted-2); font-size: 10px; white-space: nowrap; }

.brand-block { min-width: 0; }
.brand-line { display: flex; align-items: baseline; gap: 12px; }
.brand-line h1 { font-family: Georgia, "Songti SC", serif; font-size: 23px; letter-spacing: 0.04em; }
.brand-en { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; }
.topbar p {
  max-width: min(900px, 72vw);
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#refreshBtn {
  flex: 0 0 auto;
  border: 1px solid #b7c9c1;
  border-radius: 20px;
  padding: 7px 13px;
  color: var(--green);
  background: transparent;
  font-size: 12px;
}

#refreshBtn:hover { border-color: var(--green); background: var(--green-soft); }

.account-btn {
  flex: 0 0 auto;
  min-width: 58px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 7px 13px;
  color: var(--text);
  background: var(--paper);
  font-size: 12px;
}
.account-btn:hover, .account-btn.signed-in { border-color: var(--brick); color: var(--brick); background: var(--brick-soft); }

.section-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vw, 34px);
  min-height: 50px;
  overflow-x: auto;
  padding: 0 clamp(18px, 7vw, 110px);
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.section-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 50px;
  flex: 0 0 auto;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 2px 0 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  white-space: nowrap;
}

.section-tab strong { color: var(--muted-2); font-size: 11px; font-weight: 500; }
.section-tab:hover { color: var(--text); }
.section-tab.active { color: var(--brick); border-bottom-color: var(--brick); font-weight: 700; }
.section-tab.active strong { color: var(--brick); }
.section-tab[data-section="domestic"].active { color: var(--green); border-bottom-color: var(--green); }
.section-tab[data-section="domestic"].active strong { color: var(--green); }
.section-tab[data-section="calls"].active { color: var(--amber); border-bottom-color: var(--amber); }
.section-tab[data-section="calls"].active strong { color: var(--amber); }

.status-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 42px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}

.source-freshness {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 12px 22px 0;
  gap: 10px;
}

.freshness-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(255, 254, 250, 0.7);
  text-align: left;
}
.freshness-card:hover { border-color: #b8c4bf; background: var(--paper); }
.freshness-card span { font-size: 12px; font-weight: 700; }
.freshness-card strong { color: var(--brick); font-size: 14px; }
.freshness-card small { grid-column: 1 / -1; color: var(--muted); font-size: 10px; }

.metric { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; }
.metric span { color: var(--muted); font-size: 11px; }
.metric strong { color: var(--text); font-size: 13px; font-weight: 700; }

.reading-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 760px) minmax(145px, 180px);
  gap: 36px;
  width: min(1280px, 100%);
  height: calc(100vh - 238px);
  min-height: 560px;
  margin: 0 auto;
  padding: 34px 22px 42px;
}

.panel, .reader-panel, .utility-panel { min-height: 0; overflow: hidden; background: transparent; border: 0; box-shadow: none; }
.feed-panel { display: flex; flex-direction: column; min-width: 0; }
.reader-panel { overflow: auto; }

.utility-panel {
  display: flex;
  flex-direction: column;
  gap: 26px;
  overflow: auto;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.utility-block { min-height: 0; overflow: hidden; border: 0; padding: 0; background: transparent; }
.panel-head { padding: 0 0 13px; border-bottom: 1px solid var(--line); background: transparent; }
.panel-head.compact { padding: 0 0 10px; border-bottom: 0; }
.panel-head h2 { font-size: 15px; font-weight: 750; }
.panel-head p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }

.controls { display: grid; grid-template-columns: 1fr; gap: 7px; padding: 14px 0 12px; border-bottom: 1px solid var(--line); }
.controls input, .controls select {
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 9px;
  color: var(--text);
  background: var(--paper);
  font-size: 12px;
}
.controls input::placeholder { color: var(--muted-2); }

.view-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.view-mode { border: 0; border-radius: 4px; padding: 6px 3px; color: var(--muted); background: transparent; font-size: 11px; }
.view-mode strong { margin-left: 3px; color: var(--muted-2); font-size: 9px; font-weight: 500; }
.view-mode:hover { color: var(--text); background: rgba(255,255,255,0.6); }
.view-mode.active { color: var(--brick); background: var(--brick-soft); font-weight: 700; }
.view-mode.active strong { color: var(--brick); }

.coverage-bar { display: grid; gap: 4px; padding: 10px 0 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.45; }
.coverage-bar strong { margin-right: 5px; color: var(--text); font-weight: 650; }

.item-list, .theme-board, .compact-list { overflow: auto; padding: 0; }

.load-more {
  flex: 0 0 auto;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(255,255,255,0.55);
  font-size: 11px;
  cursor: pointer;
}
.load-more:hover { border-color: var(--brick); color: var(--brick); background: var(--brick-soft); }
.load-more[hidden] { display: none; }

.item {
  position: relative;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 13px 0 14px;
  cursor: pointer;
  background: transparent;
  transition: background 120ms ease, padding 120ms ease;
}

.item:hover { background: rgba(255,255,255,0.52); }
.item.active { margin-left: -9px; padding-left: 9px; border-left: 3px solid var(--brick); background: var(--brick-soft); }
.item.read:not(.active) { opacity: 0.58; }
.item.unread::before { content: ""; position: absolute; left: -9px; top: 21px; width: 5px; height: 5px; border-radius: 50%; background: var(--brick); }
.item-daily.active { border-left-color: var(--green); }
.item-calls.active { border-left-color: var(--amber); }
.item-overseas.active { border-left-color: #6a58a7; }
.item h3 { display: -webkit-box; overflow: hidden; font-size: 14px; line-height: 1.5; font-weight: 700; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.item-title-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; align-items: start; }
.item-side-actions { display: flex; align-items: center; gap: 5px; }
.item-star { border: 0; padding: 0 2px; color: var(--muted-2); background: transparent; font-size: 17px; line-height: 1.2; }
.item-star:hover, .item-star.active, .reader-star.active { color: var(--amber); }
.member-lock {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid #dfc3b9;
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--brick);
  background: var(--brick-soft);
  font-size: 9px;
  font-weight: 700;
}
.item.locked .summary { color: var(--muted-2); }
.item.locked h3::after { content: ""; }
.related-count { color: var(--blue); }

.meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.meta span { display: inline-flex; align-items: center; }
.meta span + span::before { content: "·"; margin-right: 5px; color: var(--muted-2); }

.tag-row, .media-meta, .signal-box { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tag, .file-badge, .signal-box span { display: inline-flex; align-items: center; min-height: 19px; border-radius: 4px; padding: 2px 5px; font-size: 10px; white-space: nowrap; }
.tag { color: var(--green); background: var(--green-soft); }
.file-badge, .signal-box span { color: var(--blue); background: var(--blue-soft); }
.summary { display: -webkit-box; overflow: hidden; margin-top: 7px; color: #677573; font-size: 12px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.reader-panel #detailBody { padding: 0; }
.article-only {
  min-height: 100%;
  padding: 4px 0 48px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

#detailBody { background: var(--paper); }
.reader-toolbar { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--line); background: rgba(255, 254, 250, 0.94); backdrop-filter: blur(8px); }
.reader-toolbar button { border: 0; padding: 5px 8px; color: var(--muted); background: transparent; font-size: 11px; }
.reader-toolbar > button[data-reader-nav="prev"] { text-align: left; }
.reader-toolbar > button[data-reader-nav="next"] { text-align: right; }
.reader-toolbar button:hover { color: var(--brick); background: var(--brick-soft); }
.reader-toolbar .next-unread { border-left: 1px solid var(--line); color: var(--brick); }
.mobile-reader-back { display: none; }
.gate-back { margin-bottom: 22px; }
.reader-center-actions { display: flex; align-items: center; justify-content: center; gap: 8px; }
.visibility-control { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.visibility-control select { height: 27px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; color: var(--text); background: var(--paper); font-size: 10px; }
.article-head { display: block; padding: 34px 52px 18px; border-bottom: 1px solid var(--line); }
.article-head h2 { font-family: Georgia, "Songti SC", serif; font-size: 29px; line-height: 1.42; font-weight: 700; }
.article-head p { margin-top: 10px; color: var(--muted); font-size: 12px; }
.source-link { display: inline-block; margin-top: 14px; color: var(--brick); font-size: 12px; text-decoration: none; }
.source-link:hover { text-decoration: underline; }
.signal-box { margin: 22px 52px 0; }
.raw { max-width: 660px; margin: 0 52px; padding-top: 22px; color: #35413e; font-family: Georgia, "Songti SC", serif; font-size: 16px; line-height: 2; overflow-wrap: anywhere; white-space: pre-wrap; }
.raw p { margin: 0 0 12px; }

.article-media { display: grid; gap: 14px; margin: 22px 52px 0; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.image-preview { display: block; min-height: 120px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.image-preview img { display: block; width: 100%; height: 160px; object-fit: cover; }
.file-grid { display: grid; gap: 10px; }
.file-card { border: 1px solid var(--line); padding: 12px; background: var(--surface); }
.file-card.audio, .file-card.video { border-color: #c8ddd6; background: var(--green-soft); }
.file-head { display: flex; align-items: flex-start; gap: 8px; }
.file-head strong, .file-meta, .file-actions { overflow-wrap: anywhere; }
.file-head strong { line-height: 1.45; }
.file-kind { flex: 0 0 auto; border-radius: 4px; padding: 2px 6px; color: var(--green); background: #dcece4; font-size: 11px; }
.file-meta { margin-top: 6px; color: var(--muted); font-size: 11px; }
.audio-player, .video-player { width: 100%; margin-top: 11px; }
.video-player { max-height: 340px; background: #202528; }
.pdf-preview { width: 100%; min-height: min(72vh, 720px); margin-top: 11px; border: 1px solid var(--line); background: white; }
.pdf-image-preview { margin-top: 11px; }
.pdf-page-stack { display: grid; gap: 14px; }
.pdf-page { overflow: hidden; border: 1px solid var(--line); background: white; }
.pdf-page img { display: block; width: 100%; height: auto; }
.pdf-more-wrap { display: grid; justify-items: center; gap: 8px; margin-top: 12px; }
.pdf-more { min-height: 38px; padding: 0 16px; border: 1px solid var(--line); background: white; color: var(--ink); cursor: pointer; }
.pdf-more:hover { border-color: var(--green); color: var(--green); }
.pdf-more:disabled { cursor: wait; opacity: .65; }
.file-image-preview { min-height: 0; margin-top: 11px; }
.file-image-preview img { width: 100%; height: auto; max-height: 70vh; object-fit: contain; }
.file-actions { margin-top: 9px; font-size: 12px; }
.file-actions a { color: var(--brick); }

.theme-board { display: grid; gap: 9px; }
.theme-card, .compact-card, .company-chip { width: 100%; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; padding: 8px 0; color: var(--text); background: transparent; text-align: left; }
.theme-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.theme-card span { font-size: 12px; font-weight: 700; }.theme-card strong { color: var(--brick); font-size: 14px; }.theme-card small { grid-column: 1/-1; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.theme-card:hover, .compact-card:hover, .company-chip:hover { background: rgba(255,255,255,0.6); }
.compact-list { padding: 0; }.compact-card { display: grid; gap: 4px; }.compact-card span { color: var(--amber); font-size: 11px; }.compact-card strong { display: -webkit-box; overflow: hidden; font-size: 11px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }.compact-card small { color: var(--muted); font-size: 10px; }
.company-board { display: flex; align-content: flex-start; flex-wrap: wrap; gap: 7px; overflow: auto; }.company-chip { width: auto; display: inline-flex; align-items: center; gap: 5px; padding: 5px 0; }.company-chip span { font-size: 11px; }.company-chip strong { color: var(--brick); font-size: 10px; }

.empty { padding: 28px 0; color: var(--muted); }.compact-empty { padding: 16px 0; }.empty h2 { margin-bottom: 8px; color: var(--text); font-family: Georgia, "Songti SC", serif; font-size: 24px; }.muted { color: var(--muted); }.small-note { font-size: 12px; line-height: 1.55; }

.membership-gate, .request-error {
  display: grid;
  justify-items: start;
  gap: 12px;
  min-height: 360px;
  align-content: center;
  margin: 0;
  padding: 48px 54px;
  background: var(--paper);
}
.membership-gate::before { content: "会员阅读"; color: var(--brick); font-family: Georgia, "Songti SC", serif; font-size: 13px; }
.membership-gate h2, .request-error h2 { font-family: Georgia, "Songti SC", serif; font-size: 28px; line-height: 1.35; }
.membership-gate p, .request-error p { max-width: 520px; color: var(--muted); font-size: 14px; line-height: 1.75; }

.member-dialog {
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(32, 38, 35, 0.24);
}
.member-dialog::backdrop { background: rgba(30, 36, 33, 0.42); backdrop-filter: blur(2px); }
.admin-dialog { width: min(760px, calc(100vw - 28px)); }
.dialog-card { position: relative; display: grid; gap: 17px; padding: 30px; }
.dialog-close { position: absolute; top: 13px; right: 13px; width: 30px; height: 30px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 22px; line-height: 1; }
.dialog-close:hover { color: var(--brick); background: var(--brick-soft); }
.dialog-heading { padding-right: 30px; }
.dialog-heading h2 { font-family: Georgia, "Songti SC", serif; font-size: 24px; }
.dialog-heading p { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.dialog-card > label, .create-user-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.dialog-card input, .dialog-card select { width: 100%; height: 39px; border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; color: var(--text); background: white; font-size: 13px; }
.primary-action, .secondary-action, .danger, .user-row-actions button { border-radius: 5px; padding: 9px 13px; font-size: 12px; }
.primary-action { border: 1px solid var(--brick); color: white; background: var(--brick); }
.primary-action:hover { background: #8e4636; }
.secondary-action { border: 1px solid var(--line); color: var(--text); background: var(--paper); }
.secondary-action:hover { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.danger { border: 1px solid #dfc3b9; color: var(--brick); background: var(--brick-soft); }
.form-error { border-left: 3px solid var(--brick); padding: 8px 10px; color: var(--brick); background: var(--brick-soft); font-size: 12px; line-height: 1.5; }
.account-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.request-error-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }

.health-dialog { width: min(620px, calc(100vw - 28px)); }
.health-card { gap: 20px; }
.health-overall { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-left: 4px solid var(--green); padding: 13px 15px; background: var(--green-soft); }
.health-overall.degraded { border-left-color: var(--amber); background: var(--amber-soft); }
.health-overall.error { border-left-color: var(--brick); background: var(--brick-soft); }
.health-overall strong { font-family: Georgia, "Songti SC", serif; font-size: 18px; }
.health-overall span { color: var(--muted); font-size: 10px; }
.health-section-title { margin-bottom: 8px; font-size: 12px; }
.health-list { display: grid; border-top: 1px solid var(--line); }
.health-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line-soft); padding: 11px 2px; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.health-row.degraded .health-dot, .health-row.local .health-dot { background: var(--amber); }
.health-row.error .health-dot { background: var(--brick); }
.health-row strong { display: block; font-size: 12px; }
.health-row p { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.health-state { color: var(--muted); font-size: 10px; }

.admin-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.admin-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; color: var(--muted); background: transparent; font-size: 12px; }
.admin-tabs button.active { border-bottom-color: var(--brick); color: var(--brick); font-weight: 700; }
.admin-hint { margin: 10px 0 2px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.article-admin-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.article-admin-toolbar .secondary-action { height: 39px; }
.article-admin-list { display: grid; max-height: 440px; overflow: auto; }
.article-admin-row { display: grid; grid-template-columns: minmax(0, 1fr) 106px; gap: 12px; align-items: center; border-bottom: 1px solid var(--line-soft); padding: 12px 0; }
.article-admin-row strong { display: block; overflow: hidden; font-size: 12px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.article-admin-row p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.content-layer { display: inline-block; margin-right: 5px; border-radius: 3px; padding: 2px 5px; }
.content-layer.raw { color: var(--amber); background: var(--amber-soft); }
.content-layer.published { color: var(--green); background: var(--green-soft); }
.article-admin-row select { height: 34px; font-size: 11px; }

.create-user-form { display: grid; grid-template-columns: 1.5fr 1.15fr .8fr .65fr auto; gap: 8px; align-items: end; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 17px 0; }
.create-user-form .primary-action { height: 39px; }
.user-list { display: grid; gap: 0; max-height: 380px; overflow: auto; }
.user-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line-soft); padding: 12px 0; }
.user-row.inactive { opacity: .52; }
.user-row strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.user-row p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.user-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.user-row-actions button { border: 1px solid var(--line); padding: 6px 8px; color: var(--muted); background: transparent; }
.user-row-actions button:hover { color: var(--brick); border-color: #dfc3b9; background: var(--brick-soft); }

@media (max-width: 620px) {
  .create-user-form { grid-template-columns: 1fr 1fr; }
  .create-user-form .primary-action { grid-column: 1 / -1; }
  .article-admin-row { grid-template-columns: minmax(0, 1fr) 96px; }
}

@media (max-width: 1040px) {
  .reading-workspace { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 24px; }
  .utility-panel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
}

@media (max-width: 720px) {
  .topbar { align-items: flex-start; flex-direction: column; gap: 10px; padding: 14px 18px; }
  .topbar p { max-width: 100%; white-space: normal; }
  .top-actions { width: 100%; justify-content: space-between; }
  #refreshBtn { align-self: flex-start; }
  .section-tabs { justify-content: flex-start; gap: 22px; padding: 0 18px; }
  .status-strip { justify-content: flex-start; gap: 12px 18px; flex-wrap: wrap; }
  .source-freshness { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 18px 0; }
  .reading-workspace { display: flex; flex-direction: column; height: auto; min-height: 0; padding: 20px 18px 30px; }
  .feed-panel { min-height: 420px; }
  .reader-panel { min-height: 520px; }
  .utility-panel { display: none; }
  .article-head { padding: 25px 22px 16px; }
  .article-head h2 { font-size: 24px; }
  .raw { margin: 0 22px; font-size: 16px; }
  .signal-box, .article-media { margin-left: 22px; margin-right: 22px; }
  .membership-gate, .request-error { min-height: 320px; padding: 36px 24px; }
  .create-user-form { grid-template-columns: 1fr 1fr; }
  .create-user-form label:first-child, .create-user-form .primary-action { grid-column: 1 / -1; }
  .user-row { grid-template-columns: 1fr; }
  .user-row-actions { justify-content: flex-start; }

  body.mobile-reader-open { overflow: hidden; background: var(--paper); }
  body.mobile-reader-open > .topbar,
  body.mobile-reader-open > .section-tabs,
  body.mobile-reader-open > .status-strip,
  body.mobile-reader-open > .source-freshness { display: none; }
  body.mobile-reader-open .reading-workspace { height: 100dvh; padding: 0; }
  body.mobile-reader-open .feed-panel { display: none; }
  body.mobile-reader-open .reader-panel { position: fixed; inset: 0; z-index: 30; min-height: 0; overflow: auto; background: var(--paper); }
  body.mobile-reader-open .article-only { min-height: 100dvh; box-shadow: none; }
  .reader-toolbar { grid-template-columns: auto 1fr auto; padding: 8px 10px; }
  .reader-toolbar .mobile-reader-back,
  .membership-gate .mobile-reader-back { display: inline-flex; }
  .reader-toolbar .mobile-reader-back { grid-column: 1; }
  .reader-toolbar > button[data-reader-nav="prev"] { display: none; }
  .reader-toolbar .reader-center-actions { grid-column: 2; }
  .reader-toolbar > button[data-reader-nav="next"] { display: none; }
  .reader-toolbar .next-unread { grid-column: 3; border-left: 0; }
}

/* 2026-07-18 reading-first layout: the feed selects, the canvas reads, tools stay on demand. */
@media (min-width: 721px) {
  html,
  body {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  .topbar {
    min-height: 64px;
    padding: 10px max(22px, calc((100vw - 1280px) / 2 + 22px));
  }

  .brand-line h1 {
    font-size: 23px;
  }

  .brand-block p {
    max-width: 620px;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .section-tabs {
    min-height: 44px;
    padding-inline: max(22px, calc((100vw - 1280px) / 2 + 22px));
  }

  .section-tab {
    min-height: 44px;
    padding: 0 15px;
  }

  .status-strip {
    min-height: 34px;
    padding-inline: max(22px, calc((100vw - 1280px) / 2 + 22px));
  }

  .metric {
    gap: 6px;
    padding: 0 11px;
  }

  .source-freshness {
    min-height: 56px;
    gap: 1px;
    padding: 0 max(22px, calc((100vw - 1280px) / 2 + 22px));
    background: var(--line);
    border-bottom: 1px solid var(--line);
  }

  .freshness-card {
    min-width: 0;
    min-height: 55px;
    padding: 8px 13px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--paper);
  }

  .freshness-card:hover {
    transform: none;
    background: var(--paper-warm);
  }

  .freshness-card strong {
    font-size: 16px;
  }

  .reading-workspace {
    display: grid;
    grid-template-columns: minmax(300px, 336px) minmax(0, 1fr);
    gap: 0;
    width: min(1280px, 100%);
    height: calc(100dvh - 198px);
    min-height: 480px;
    margin: 0 auto;
    padding: 0 22px;
  }

  .feed-panel,
  .reader-panel {
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .feed-panel {
    border: 0;
    border-right: 1px solid var(--line);
    background: var(--paper-soft);
  }

  .feed-panel > .panel-head {
    padding: 16px 16px 10px;
  }

  .feed-panel > .panel-head p {
    display: none;
  }

  .feed-panel > .panel-head {
    padding: 14px 0 8px;
  }

  .controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    padding: 0 0 8px;
  }

  .controls input {
    grid-column: 1 / -1;
  }

  .controls input,
  .controls select {
    min-width: 0;
    height: 36px;
  }

  .view-modes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 0;
  }

  .view-modes button {
    min-width: 0;
    padding-inline: 4px;
    white-space: nowrap;
  }

  .coverage-bar {
    margin-top: 8px;
    padding-block: 9px;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 16px 10px;
  }

  .controls input {
    grid-column: 1 / -1;
  }

  .controls input,
  .controls select {
    min-width: 0;
    height: 36px;
  }

  .view-modes {
    padding-inline: 16px;
  }

  .coverage-bar {
    margin: 10px 16px 0;
    padding: 9px 0;
  }

  .item-list {
    padding: 6px 10px 24px;
    scrollbar-gutter: stable;
  }

  .item {
    padding: 13px 12px 12px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: transparent;
  }

  .item:hover {
    background: var(--paper);
  }

  .item.active {
    border-color: var(--line);
    box-shadow: inset 3px 0 0 var(--accent);
    background: var(--paper);
  }

  .item h3 {
    font-size: 15px;
    line-height: 1.45;
  }

  .item .summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .reader-panel {
    border: 0;
    background: var(--paper);
    scrollbar-gutter: stable;
  }

  .reader-panel .empty {
    display: grid;
    align-content: center;
    justify-items: center;
    min-height: 100%;
    padding: 48px;
    text-align: center;
  }

  #detailBody {
    width: 100%;
    min-height: 100%;
    padding: 0 clamp(28px, 5vw, 76px) 72px;
  }

  .article-head,
  .article-media,
  .article-raw,
  .reader-toolbar,
  .member-gate {
    width: min(760px, 100%);
    margin-inline: auto;
  }

  .article-head {
    padding-top: 34px;
  }

  .article-raw {
    font-size: 17px;
    line-height: 1.95;
  }

  .article-raw p,
  .article-raw li {
    max-width: 72ch;
  }

  .utility-toggle {
    border-color: var(--line-strong);
    background: var(--paper-soft);
  }

  .utility-panel {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 80;
    display: block;
    width: min(380px, 90vw);
    height: 100dvh;
    padding: 0 22px 36px;
    overflow-y: auto;
    border: 0;
    border-left: 1px solid var(--line-strong);
    background: var(--paper);
    box-shadow: -18px 0 50px rgba(42, 37, 30, 0.14);
    transform: translateX(102%);
    transition: transform 180ms ease;
  }

  .utility-open .utility-panel {
    transform: translateX(0);
  }

  .utility-drawer-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    margin: 0 -22px 8px;
    padding: 13px 22px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--paper) 94%, transparent);
    backdrop-filter: blur(10px);
  }

  .utility-drawer-head span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
  }

  .utility-drawer-head h2 {
    margin: 2px 0 0;
    font-size: 19px;
  }

  .utility-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    font-size: 23px;
    line-height: 1;
  }

  .utility-scrim {
    position: fixed;
    inset: 0;
    z-index: 70;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(31, 28, 24, 0.24);
  }

  .utility-scrim[hidden] {
    display: none;
  }

  .utility-block {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
  }

  .utility-block:last-child {
    border-bottom: 0;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .shortcut-hint,
  .data-health {
    display: none;
  }

  .reading-workspace {
    grid-template-columns: minmax(276px, 310px) minmax(0, 1fr);
    padding-inline: 14px;
  }

  #detailBody {
    padding-inline: 30px;
  }
}

@media (max-width: 720px) {
  .utility-toggle {
    display: none;
  }

  .utility-drawer-head,
  .utility-scrim {
    display: none;
  }

  .source-freshness {
    display: flex;
    min-height: 64px;
    padding: 8px 14px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .source-freshness::-webkit-scrollbar {
    display: none;
  }

  .freshness-card {
    flex: 0 0 148px;
    min-width: 148px;
    min-height: 48px;
    padding: 8px 10px;
    scroll-snap-align: start;
  }

  .status-strip {
    flex-wrap: nowrap;
    gap: 0;
    min-height: 42px;
    padding: 0 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .status-strip::-webkit-scrollbar {
    display: none;
  }

  .metric {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 11px;
  }

  .feed-panel > .panel-head p {
    display: none;
  }

  .item {
    border-radius: 0;
    border-width: 0 0 1px;
  }

  .item.active {
    box-shadow: inset 3px 0 0 var(--accent);
  }

  .article-raw {
    font-size: 17px;
    line-height: 1.9;
  }
}

@media (max-width: 430px) {
  .shortcut-hint { display: none; }
  .source-freshness { display: flex; grid-template-columns: none; }
  .view-modes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
