/* deploy-probe: 2026-08-06T00:54Z cloud-agent actions test */
:root {
  color-scheme: light;
  --ink: #262522;
  --muted: #746f68;
  --soft: #f7f1e8;
  --paper: #fffaf1;
  --paper-strong: #fff6e7;
  --line: rgba(53, 49, 43, 0.12);
  --shadow: rgba(41, 37, 31, 0.16);
  --shadow-strong: rgba(34, 31, 27, 0.28);
  --accent: #2f2f2d;
  --accent-soft: #e8dcc9;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 250, 241, 0.98), rgba(246, 238, 225, 0.78) 45%, rgba(238, 229, 214, 0.92) 100%),
    #f3eadc;
  padding:
    env(safe-area-inset-top, 0)
    env(safe-area-inset-right, 0)
    env(safe-area-inset-bottom, 0)
    env(safe-area-inset-left, 0);
}

button,
input,
textarea {
  font: inherit;
}

a { color: inherit; }

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
  min-height: 44px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.top-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.66);
  backdrop-filter: blur(18px);
  border-radius: var(--radius);
  min-height: 44px;
  box-sizing: border-box;
}

.tab-button,
.admin-link,
.secondary-action {
  border: 0;
  text-decoration: none;
  color: var(--muted);
  background: transparent;
  padding: 9px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  min-height: 34px;
  box-sizing: border-box;
  white-space: nowrap;
}

a.tab-button {
  text-decoration: none;
}

.site-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  flex: 0 0 auto;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.site-home-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.site-home-link:hover,
.site-home-link:focus-visible {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(69, 57, 43, 0.08);
  outline: none;
}

.tab-button.active,
a.tab-button.active,
.admin-link:hover,
.secondary-action:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 18px rgba(69, 57, 43, 0.08);
}

main {
  flex: 1;
  display: flex;
}

.view-panel {
  display: none;
  width: 100%;
}

.view-panel.active {
  display: block;
}

.hero-grid {
  min-height: calc(100vh - 128px);
  display: grid;
  align-items: center;
  gap: clamp(36px, 6vw, 72px);
  padding: 10px 0 58px;
}

/* 方案 B：左本期书文案，右封面 */
.hero-grid.hero-b {
  grid-template-columns: minmax(340px, 1.15fr) minmax(260px, 0.9fr);
  gap: clamp(28px, 4.5vw, 56px);
}

/* 避免先闪种子书：数据就绪后再显现 */
.hero-grid.hero-b:not(.is-ready) {
  opacity: 0;
  pointer-events: none;
}

.hero-grid.hero-b.is-ready {
  opacity: 1;
  transition: opacity 0.22s ease;
}

.hero-b .hero-copy {
  max-width: 560px;
  min-width: 0;
}

.hero-b .hero-copy .meta-label {
  margin-bottom: 10px;
}

.hero-b #featured-title {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 2.8vw, 2.55rem);
  line-height: 1.2;
  letter-spacing: 0;
  font-weight: 680;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-b #featured-author {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
}

.hero-b #featured-rec {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.85;
}

.hero-b .hero-actions {
  justify-content: flex-start;
  margin-top: 28px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #9a8972;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

.hero-intro {
  max-width: 460px;
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.primary-action,
.admin-submit,
.quiet-button {
  appearance: none;
  border: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  box-shadow: 0 16px 28px rgba(39, 39, 37, 0.18);
  cursor: pointer;
}

.primary-action.disabled {
  pointer-events: none;
  color: rgba(255, 255, 255, 0.64);
  background: rgba(47, 47, 45, 0.36);
  box-shadow: none;
}

.download-note {
  color: #8b8175;
  font-size: 0.92rem;
}

.book-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
}

.featured-book-card {
  position: relative;
  z-index: 2;
  width: min(360px, 82vw);
  text-align: center;
}

.book-object {
  position: relative;
  border-radius: var(--radius);
  background: #fff7eb;
  box-shadow:
    0 34px 54px var(--shadow-strong),
    15px 20px 0 rgba(72, 63, 52, 0.07);
  transform: perspective(900px) rotateY(-9deg) rotateX(2deg);
  transform-origin: center;
}

.book-object::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 26px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: linear-gradient(90deg, rgba(31, 29, 26, 0.2), rgba(255, 255, 255, 0.08));
  mix-blend-mode: multiply;
  pointer-events: none;
}

.book-object::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 10%;
  bottom: -25px;
  height: 28px;
  border-radius: var(--radius);
  background: rgba(48, 43, 36, 0.23);
  filter: blur(16px);
  transform: rotate(2deg);
  z-index: -1;
}

.large-book img,
.side-book {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: inherit;
}

.large-book {
  width: min(340px, 72vw);
  margin: 0 auto;
}

.book-meta {
  margin-top: 42px;
}

.book-meta .hero-actions {
  justify-content: center;
  margin-top: 22px;
}

.meta-label {
  margin-bottom: 8px;
  color: #a0907b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.book-meta h2 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: 0;
}

.book-meta p:not(.meta-label):not(.download-note) {
  color: var(--muted);
  line-height: 1.7;
}

#featured-rec {
  margin-bottom: 0;
}

.side-book {
  position: absolute;
  width: 138px;
  height: 205px;
  opacity: 0.62;
  background:
    linear-gradient(140deg, rgba(255, 251, 242, 0.65), rgba(216, 204, 186, 0.82)),
    url("/assets/notta-story-cover-en.png") center / cover;
  box-shadow: 0 20px 34px rgba(66, 57, 46, 0.18);
}

.side-book-left {
  left: 12%;
  bottom: 126px;
  transform: perspective(800px) rotateY(22deg) rotateZ(-8deg);
}

.side-book-right {
  right: 7%;
  top: 92px;
  transform: perspective(800px) rotateY(-20deg) rotateZ(8deg);
}

.section-heading {
  padding-top: 48px;
  margin-bottom: 20px;
}

.section-heading .eyebrow {
  margin-bottom: 6px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.25;
  letter-spacing: 0;
  font-weight: 650;
}

.history-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 72px;
}

/* Archive rows: cover left, full recommendation right — no line-clamp. */
.history-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 22px 24px;
  align-items: start;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.history-card:first-child {
  padding-top: 8px;
}

.history-card:last-child {
  border-bottom: 0;
}

.history-book {
  display: block;
  width: 112px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff7eb;
  box-shadow: 0 14px 28px rgba(66, 57, 46, 0.14);
}

.history-detail-link {
  color: inherit;
  text-decoration: none;
}

.history-detail-link:hover,
.history-detail-link:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.history-book.history-detail-link:hover,
.history-book.history-detail-link:focus-visible {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(66, 57, 46, 0.18);
}

.history-book img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.history-body {
  min-width: 0;
}

.history-card h3 {
  margin: 0 0 6px;
  font-size: 1.18rem;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: 0;
}

.history-badge {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;
  padding: 3px 8px;
  border: 1px solid rgba(53, 49, 43, 0.14);
  border-radius: var(--radius);
  color: #8d7c65;
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.68rem;
  line-height: 1.2;
  font-weight: 650;
}

.history-author {
  margin: 0 0 12px;
  color: #8d8376;
  font-size: 0.9rem;
  line-height: 1.45;
}

.history-rec {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.history-download {
  display: inline-flex;
  margin-top: 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(38, 37, 34, 0.32);
  font-size: 0.92rem;
}

.history-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.share-action,
.history-share {
  appearance: none;
  border: 0;
  cursor: pointer;
}

.history-share {
  display: inline-flex;
  align-items: center;
  padding: 0;
  color: #6f665d;
  background: transparent;
  border-bottom: 1px solid rgba(111, 102, 93, 0.24);
  font-size: 0.92rem;
  line-height: 1.45;
}

.share-backdrop,
.collect-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(38, 35, 30, 0.24);
  backdrop-filter: blur(10px);
}

.share-sheet {
  --share-radius: var(--radius);
  --share-poster-width: min(270px, 74vw);
  position: fixed;
  z-index: 90;
  left: 50%;
  top: 50%;
  width: calc(var(--share-poster-width) + 28px);
  max-height: min(700px, calc(100dvh - 24px));
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: var(--share-radius);
  background: rgba(255, 250, 242, 0.98);
  box-shadow: 0 20px 48px rgba(34, 31, 27, 0.18);
  padding: 12px 14px 10px;
}

.share-close-button {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 28px;
  min-height: 28px;
  max-width: 28px;
  max-height: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--share-radius);
  background: rgba(255, 255, 255, 0.34);
  box-shadow: none;
  font-size: 1rem;
  line-height: 1;
}

.share-sheet .share-close-button {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  max-width: 28px;
  max-height: 28px;
  padding: 0;
}

.share-sheet-head,
.collect-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.share-sheet-head h2,
.collect-sheet-head h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.share-lead,
.collect-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.share-preview-wrap {
  display: grid;
  place-items: center;
  min-height: 0;
  margin: 28px 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.share-preview {
  display: block;
  width: var(--share-poster-width);
  aspect-ratio: 3 / 4;
  object-fit: contain;
  box-shadow: 0 12px 26px rgba(52, 45, 36, 0.12);
}

.share-placeholder {
  width: min(260px, 72vw);
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
  text-align: center;
}

.share-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.share-actions-row .primary-action {
  min-height: 40px;
  padding: 0 22px;
  border-radius: var(--share-radius);
  box-shadow: 0 10px 20px rgba(39, 39, 37, 0.14);
}

.share-actions-row .quiet-button:disabled {
  cursor: default;
  opacity: 0.48;
}

.share-sheet .status-line {
  min-height: 0;
  margin: 0;
}

.share-sheet .status-line:empty {
  display: none;
}

@media (max-width: 520px) {
  .share-sheet {
    --share-poster-width: min(260px, 76vw);
    padding: 10px 12px 9px;
  }

  .share-close-button {
    top: 6px;
    right: 6px;
  }

  .share-preview-wrap {
    margin: 28px 0 8px;
  }
}

body.share-open,
body.collect-open {
  overflow: hidden;
}

.empty-state {
  color: var(--muted);
  padding: 42px 0;
}

.admin-page {
  background: #f5ecdf;
  /* 管理端统一字号 / 间距（书单 + 访问分析共用） */
  --admin-page-title: clamp(1.4rem, 2.4vw, 1.75rem);
  --admin-section-title: 1.05rem;
  --admin-body: 0.9rem;
  --admin-label: 0.82rem;
  --admin-meta: 0.76rem;
  --admin-eyebrow: 0.66rem;
  --admin-card-pad: 20px;
  --admin-radius: var(--radius);
  --admin-gap: 20px;
}

.admin-layout {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 56px;
}

.admin-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  padding: 20px 0 16px;
}

.admin-hero-in-col {
  display: block;
  padding: 20px 0 14px;
  align-items: start;
}

.admin-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-col .admin-catalog-heading {
  padding-top: 20px;
  margin-bottom: 14px;
  min-height: 0;
}

/* 左栏标题与右栏 Catalog 顶对齐：统一标题块高度 */
.admin-col > .admin-hero-in-col,
.admin-col > .admin-catalog-heading {
  box-sizing: border-box;
  min-height: 96px;
}

.admin-col > .admin-hero-in-col h1,
.admin-col > .admin-catalog-heading h2 {
  font-size: var(--admin-page-title);
  line-height: 1.2;
  margin-bottom: 6px;
  font-weight: 650;
}

.admin-col > .admin-hero-in-col p:last-child {
  margin-bottom: 0;
  font-size: var(--admin-body);
  line-height: 1.45;
  color: var(--muted);
}

.admin-page.analytics-view .admin-hero {
  padding: 20px 0 16px;
}

.admin-hero .eyebrow,
.admin-page .eyebrow {
  margin-bottom: 6px;
  font-size: var(--admin-eyebrow);
  letter-spacing: 0.11em;
}

.admin-hero h1,
.admin-page.analytics-view .admin-hero h1 {
  font-size: var(--admin-page-title);
  line-height: 1.2;
  margin-bottom: 6px;
  font-weight: 650;
}

.admin-hero p,
.admin-page.analytics-view .admin-hero p {
  color: var(--muted);
  margin-bottom: 0;
  font-size: var(--admin-body);
  line-height: 1.5;
  max-width: 40rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: var(--admin-gap);
  align-items: start;
}

.admin-catalog-heading {
  padding-top: 0;
  margin-bottom: 14px;
}

.admin-catalog-heading .eyebrow {
  margin-bottom: 4px;
}

.admin-catalog-heading h2,
.admin-card > h2,
.admin-card .section-heading h2,
.analytics-heading h2 {
  margin: 0;
  font-size: var(--admin-section-title);
  font-weight: 650;
  line-height: 1.3;
}

.admin-card > h2 {
  margin-bottom: 14px;
}

.admin-card .section-heading {
  padding-top: 0;
  margin-bottom: 10px;
}

.admin-card .section-heading .eyebrow,
.analytics-heading .eyebrow {
  margin-bottom: 4px;
  font-size: var(--admin-eyebrow);
}

.admin-card,
.book-row {
  border: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.76);
  box-shadow: 0 14px 32px rgba(70, 58, 43, 0.07);
  border-radius: var(--admin-radius);
}

.admin-card {
  padding: var(--admin-card-pad);
}

.admin-form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span,
.toggle-field span {
  color: #5c554d;
  font-size: var(--admin-label);
  font-weight: 650;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(49, 45, 39, 0.16);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 12px;
  font-size: var(--admin-body);
  outline: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(47, 47, 45, 0.5);
  box-shadow: 0 0 0 4px rgba(47, 47, 45, 0.08);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.field-help {
  color: #968a7d;
  font-size: var(--admin-meta);
  line-height: 1.4;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.quiet-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  box-shadow: none;
  font-size: var(--admin-body);
}

.admin-submit {
  font-size: var(--admin-body);
}

.status-line {
  min-height: 20px;
  color: var(--muted);
  font-size: var(--admin-meta);
}

.book-list {
  display: grid;
  gap: 12px;
}

.book-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  padding: 12px;
  align-items: center;
}

.book-row img {
  width: 72px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 10px 18px rgba(52, 45, 36, 0.14);
}

.book-row h3 {
  margin-bottom: 4px;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.3;
}

.book-row p {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: var(--admin-meta);
  line-height: 1.45;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-button {
  min-width: 42px;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  font-size: var(--admin-meta);
  white-space: nowrap;
  line-height: 1.2;
}

.danger { color: #9a3430; }

.file-field input[type="file"] {
  width: 100%;
  padding: 12px 10px;
  border: 1px dashed rgba(49, 45, 39, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font-size: var(--admin-meta);
}

.toggle-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

@media (max-width: 820px) {
  .page-shell,
  .admin-layout {
    width: min(100% - 28px, 720px);
  }

  /* Compact top bar: brand left, tabs top-right */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    min-height: 0;
    padding: 8px 0 6px;
    align-items: center;
    flex-direction: row;
    gap: 10px;
    background: linear-gradient(
      180deg,
      rgba(243, 234, 220, 0.97) 0%,
      rgba(243, 234, 220, 0.9) 72%,
      rgba(243, 234, 220, 0)
    );
    backdrop-filter: blur(10px);
  }

  .admin-page .site-header {
    background: linear-gradient(
      180deg,
      rgba(245, 236, 223, 0.97) 0%,
      rgba(245, 236, 223, 0.9) 72%,
      rgba(245, 236, 223, 0)
    );
  }

  .brand {
    min-height: 0;
    gap: 8px;
    font-size: 0.92rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand > span:last-child {
    font-size: 0.9rem;
    font-weight: 600;
  }

  .top-tabs {
    width: auto;
    margin-left: auto;
    flex-shrink: 0;
    gap: 2px;
    padding: 3px;
  }

  .top-tabs > * {
    flex: none;
    text-align: center;
    min-height: 32px;
    padding: 5px 10px;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .top-tabs .site-home-link {
    width: 32px;
    min-height: 32px;
    padding: 0;
  }

  .site-home-icon {
    width: 16px;
    height: 16px;
  }

  .tab-extra {
    display: none;
  }

  .hero-grid,
  .hero-grid.hero-b {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 20px;
    /* Top spacing below sticky header controls the book block’s Y on mobile. */
    padding: 28px 0 28px;
  }

  /* Mobile：封面在上，文案在下 */
  .hero-b .book-stage {
    order: 1;
    min-height: 0;
    padding: 8px 0 0;
  }

  .hero-b .hero-copy {
    order: 2;
    max-width: none;
    text-align: center;
  }

  .hero-b .hero-copy .meta-label {
    margin-bottom: 4px;
  }

  .hero-b #featured-title {
    margin-bottom: 4px;
    font-size: 1.28rem;
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .hero-b #featured-author {
    margin-bottom: 8px;
    font-size: 0.88rem;
  }

  .hero-b #featured-rec {
    font-size: 0.9rem;
    line-height: 1.55;
    max-height: calc(1.55em * 8);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    text-align: left;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(116, 111, 104, 0.45) transparent;
  }

  .hero-b #featured-rec::-webkit-scrollbar {
    width: 4px;
  }

  .hero-b #featured-rec::-webkit-scrollbar-thumb {
    border-radius: var(--radius);
    background: rgba(116, 111, 104, 0.4);
  }

  .hero-b .hero-actions {
    margin-top: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    justify-content: center;
  }

  .side-book {
    display: none;
  }

  .featured-book-card {
    width: min(300px, 88vw);
  }

  .large-book {
    width: min(148px, 38vw);
  }

  .book-object {
    transform: perspective(900px) rotateY(-5deg) rotateX(1deg);
    box-shadow:
      0 18px 28px var(--shadow-strong),
      10px 12px 0 rgba(72, 63, 52, 0.06);
  }

  .book-object::before {
    width: 16px;
  }

  .book-object::after {
    bottom: -14px;
    height: 18px;
    filter: blur(12px);
  }

  .book-meta {
    margin-top: 14px;
  }

  .meta-label {
    margin-bottom: 4px;
    font-size: 0.7rem;
  }

  .book-meta h2 {
    margin-bottom: 4px;
    font-size: 1.28rem;
    line-height: 1.25;
  }

  #featured-author {
    margin-bottom: 8px;
    font-size: 0.88rem;
  }

  #featured-rec {
    font-size: 0.9rem;
    line-height: 1.55;
    /* Cap at ~8 lines; longer copy scrolls inside the block. */
    max-height: calc(1.55em * 8);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    text-align: left;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(116, 111, 104, 0.45) transparent;
  }

  #featured-rec::-webkit-scrollbar {
    width: 4px;
  }

  #featured-rec::-webkit-scrollbar-thumb {
    border-radius: var(--radius);
    background: rgba(116, 111, 104, 0.4);
  }

  .book-meta .hero-actions {
    margin-top: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .primary-action {
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    box-shadow: 0 10px 18px rgba(39, 39, 37, 0.14);
  }

  .download-note {
    text-align: center;
    font-size: 0.8rem;
  }

  .section-heading {
    padding-top: 18px;
    margin-bottom: 8px;
  }

  .section-heading .eyebrow {
    margin-bottom: 6px;
    font-size: 0.68rem;
  }

  .section-heading h2 {
    font-size: 1.28rem;
    line-height: 1.25;
  }

  .history-grid {
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0));
  }

  .history-card {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 14px 14px;
    padding: 22px 0;
  }

  .history-book {
    width: 78px;
    border-radius: var(--radius);
    box-shadow: 0 10px 18px rgba(66, 57, 46, 0.12);
  }

  .history-card h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
  }

  .history-author {
    margin-bottom: 8px;
    font-size: 0.82rem;
  }

  .history-rec {
    margin-bottom: 10px;
    font-size: 0.9rem;
    line-height: 1.7;
  }

  .admin-hero {
    display: grid;
    grid-template-columns: 1fr;
    padding: 16px 0 12px;
    align-items: start;
  }

  .admin-page.analytics-view .admin-hero {
    padding: 14px 0 10px;
  }

  .admin-hero h1,
  .admin-page.analytics-view .admin-hero h1 {
    font-size: 1.35rem;
    margin-bottom: 4px;
  }

  .admin-hero p,
  .admin-page.analytics-view .admin-hero p {
    font-size: 0.84rem;
    line-height: 1.45;
  }

  .admin-card {
    padding: 14px;
  }

  .admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .admin-card h2,
  .admin-card .section-heading h2,
  .admin-catalog-heading h2 {
    font-size: 1.02rem;
  }

  .admin-form {
    gap: 14px;
  }

  .field input,
  .field textarea {
    min-height: 48px;
    font-size: 16px; /* avoid iOS zoom on focus */
    padding: 13px 14px;
  }

  .field textarea {
    min-height: 110px;
  }

  .admin-actions {
    gap: 10px;
  }

  .admin-actions-sticky {
    position: sticky;
    bottom: calc(10px + env(safe-area-inset-bottom, 0));
    z-index: 15;
    padding: 10px;
    margin: 4px -6px 0;
    border-radius: var(--radius);
    background: rgba(255, 250, 242, 0.92);
    border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(70, 58, 43, 0.12);
    backdrop-filter: blur(12px);
  }

  .admin-submit,
  .quiet-button {
    flex: 1;
    min-height: 48px;
  }

  .book-row {
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 12px;
  }

  .book-row img {
    width: 72px;
  }

  .row-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .row-actions .icon-button {
    flex: 1;
    min-height: 44px;
  }

  .admin-layout {
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0));
  }
}

@media (max-width: 520px) {
  .page-shell,
  .admin-layout {
    width: calc(100% - 20px);
  }

  .brand > span:last-child {
    font-size: 0.84rem;
  }

  .top-tabs > * {
    padding: 5px 8px;
    font-size: 0.74rem;
  }

  .large-book {
    width: min(132px, 36vw);
  }

  .book-meta h2 {
    font-size: 1.18rem;
  }

  #featured-rec {
    font-size: 0.86rem;
    line-height: 1.55;
    max-height: calc(1.55em * 8);
  }

  .history-card {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
  }

  .history-book {
    width: 68px;
  }

  .history-card h3 {
    font-size: 1rem;
  }
}

@media (max-width: 360px) {
  .brand > span:last-child {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .large-book {
    width: min(120px, 34vw);
  }
}

/* Admin analytics — 与书单共用 --admin-* 字号 / 卡片规范 */
.admin-panel[hidden] {
  display: none !important;
}

.analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: end;
  margin-bottom: var(--admin-gap);
  padding: var(--admin-card-pad);
  border: 1px solid var(--line);
  border-radius: var(--admin-radius);
  background: rgba(255, 250, 242, 0.76);
  box-shadow: 0 14px 32px rgba(70, 58, 43, 0.07);
}

.analytics-token-field {
  flex: 1 1 200px;
  margin: 0;
  gap: 6px;
}

.analytics-token-field span,
.country-filter-field span {
  font-size: var(--admin-label);
  font-weight: 650;
  color: #5c554d;
}

.analytics-token-field input {
  min-height: 40px;
  padding: 10px 12px;
  font-size: var(--admin-body);
  border-radius: var(--radius);
}

.analytics-refresh {
  min-height: 40px;
  padding: 8px 16px;
  font-size: var(--admin-body);
}

.analytics-status {
  flex: 1 1 100%;
  margin: 0;
  font-size: var(--admin-meta);
  line-height: 1.4;
}

.analytics-card {
  margin-bottom: var(--admin-gap);
  padding: var(--admin-card-pad);
  border-radius: var(--admin-radius);
  box-shadow: 0 14px 32px rgba(70, 58, 43, 0.07);
}

.analytics-heading {
  margin-bottom: 10px;
}

.analytics-heading .eyebrow {
  margin-bottom: 4px;
  font-size: var(--admin-eyebrow);
  letter-spacing: 0.11em;
}

.analytics-heading h2,
.analytics-card .section-heading h2 {
  font-size: var(--admin-section-title);
  font-weight: 650;
  line-height: 1.3;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--admin-gap);
  align-items: stretch;
}

.analytics-grid .analytics-card {
  margin-bottom: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.analytics-grid .analytics-table-wrap {
  flex: 1;
  max-height: 360px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-legend {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: var(--admin-meta);
}

.legend-item::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 2px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: var(--radius);
}

.legend-visit::before { background: #2f2f2d; }
.legend-download::before { background: #9a7b52; }

.chart-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.analytics-chart-svg {
  width: 100%;
  min-width: 360px;
  height: auto;
  display: block;
}

.chart-grid {
  stroke: rgba(53, 49, 43, 0.1);
  stroke-width: 1;
}

.chart-label {
  fill: #8d8376;
  font-size: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.chart-line {
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line-visit { stroke: #2f2f2d; }
.chart-line-download { stroke: #9a7b52; }

.analytics-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--admin-meta);
  line-height: 1.4;
}

.analytics-table th,
.analytics-table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.analytics-table th {
  color: #8d8376;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.analytics-table .num,
.analytics-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.analytics-table tbody tr:last-child td {
  border-bottom: 0;
}

.daily-stats-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.daily-stats-head .analytics-heading {
  margin-bottom: 0;
}

.country-filter-field {
  margin: 0;
  min-width: 120px;
  gap: 4px;
}

.country-filter-field select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffaf1;
  padding: 6px 10px;
  font-size: var(--admin-meta);
}

@media (max-width: 820px) {
  .analytics-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .analytics-grid .analytics-card {
    min-height: 0;
  }

  .analytics-grid .analytics-table-wrap {
    max-height: 280px;
  }

  .analytics-card {
    padding: 14px;
    margin-bottom: 14px;
  }

  .analytics-toolbar {
    margin-bottom: 14px;
    padding: 14px;
  }

  .analytics-heading h2,
  .analytics-card .section-heading h2 {
    font-size: 1rem;
  }

  .analytics-chart-svg {
    min-width: 300px;
  }
}

/* Book recommendation collect (frontend) */
.collect-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 40;
  min-width: 52px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid rgba(53, 49, 43, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, 0.94);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(70, 58, 43, 0.14);
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  line-height: 1.2;
}

.collect-fab:hover,
.collect-fab:focus-visible {
  background: #fffaf1;
  outline: none;
}

.collect-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(40, 36, 30, 0.28);
}

.collect-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 60;
  width: min(440px, 100%);
  max-height: min(88vh, 720px);
  transform: translateX(-50%);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: #fffaf1;
  box-shadow: 0 -18px 48px rgba(70, 58, 43, 0.18);
  padding:
    18px 18px
    calc(18px + env(safe-area-inset-bottom, 0px));
}

.collect-sheet-head {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.collect-sheet-head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.collect-close {
  flex: 0 0 auto;
  white-space: nowrap;
  min-width: max(52px, 3.2em);
  padding: 8px 14px;
  line-height: 1.2;
}

.collect-sheet-head h2 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  line-height: 1.25;
  font-weight: 650;
}

.collect-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.collect-form {
  display: grid;
  gap: 12px;
}

.collect-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.collect-actions {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.collect-actions .primary-action {
  width: 100%;
  text-align: center;
}

.collect-actions .status-line {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.84rem;
}

body.collect-open {
  overflow: hidden;
}

.submissions-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.submissions-table {
  table-layout: fixed;
  width: 100%;
  min-width: 920px;
}

.submissions-table col.col-time { width: 11.5rem; }
.submissions-table col.col-title { width: 14%; }
.submissions-table col.col-author { width: 10%; }
.submissions-table col.col-publisher { width: 10%; }
.submissions-table col.col-rec { width: auto; }
.submissions-table col.col-country { width: 4.2rem; }
.submissions-table col.col-ip { width: 9.5rem; }
.submissions-table col.col-actions { width: 4.8rem; }

.submissions-table th,
.submissions-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 8px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.submissions-table th.col-country,
.submissions-table td.submissions-country,
.submissions-table th.col-ip,
.submissions-table td.submissions-ip {
  text-align: left;
}

.submissions-table th.col-actions,
.submissions-table td.submissions-actions {
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

.submissions-time,
.submissions-ip {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.submissions-country {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.submissions-rec {
  max-width: none;
  line-height: 1.45;
  color: #4d4740;
}

.submissions-title {
  font-weight: 600;
}

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

.admin-page.submissions-view .admin-layout {
  width: min(1280px, calc(100% - 36px));
}

.admin-page.submissions-view .admin-hero {
  padding: 18px 0 12px;
}

@media (min-width: 821px) {
  .collect-sheet {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: var(--radius);
    border-bottom: 1px solid var(--line);
    max-height: min(80vh, 680px);
  }

  .submissions-table th,
  .submissions-table td {
    padding: 11px 10px;
  }
}

@media (max-width: 820px) {
  .collect-fab {
    min-width: 48px;
    min-height: 48px;
    font-size: 0.86rem;
  }

  .collect-sheet {
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .collect-sheet-head h2 {
    font-size: 1.12rem;
  }

  .submissions-table {
    font-size: 0.74rem;
    min-width: 760px;
  }

  .submissions-table col.col-time { width: 9.5rem; }
  .submissions-table col.col-ip { width: 8.5rem; }
  .submissions-table col.col-actions { width: 4.2rem; }
}
