/*
 * go-site SSR — 宣纸 + 朱砂设计体系（参考 jingxin），light/dark 双主题。
 * @author daichangya@163.com
 * https://gshici.cn (go-site)
 */
:root {
  /* --- sc design tokens (jingxin-aligned) --- */
  --sc-paper: #f8f5ef;
  --sc-paper-deep: #f0ebe2;
  --sc-paper-elevated: #fffefb;
  --sc-ink: #1c1917;
  --sc-ink-light: #5c4f3d;
  --sc-ink-classical: #2b2318;
  --sc-muted: #78716c;
  --sc-muted-label: #9a8e7a;
  --sc-cinnabar: #8b2500;
  --sc-cinnabar-hover: #6f1d00;
  --sc-gold: #b08d57;
  --sc-border: #d9d0c1;
  --sc-border-strong: #c9bfae;
  --sc-verse-bg: #fdf6e3;
  --sc-verse-border: #e8d5b7;
  --sc-sidebar-bg: #faf8f5;
  --sc-sidebar-border: #e5dfd4;
  --sc-card-bg: rgb(255 255 255 / 0.6);
  --sc-measure: 38rem;
  --sc-shell-width: 80rem;
  --sc-page-width: 75rem;
  --sc-combo-width: 48.75rem;
  --sc-header-height: 52px;
  --sc-sidebar-width: 17.5rem;
  --sc-radius-xl: 1rem;
  --sc-shadow-hero: 0 2px 6px rgb(28 25 23 / 0.05), 0 12px 36px rgb(139 37 0 / 0.08);
  --sc-ui-font: "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  --sc-reading-font: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sc-display-font: "Ma Shan Zheng", "ZCOOL XiaoWei", "Noto Serif SC", serif;
  --sc-shadow-sm: 0 1px 3px rgb(28 25 23 / 0.04), 0 4px 12px rgb(28 25 23 / 0.04);
  --sc-shadow: 0 1px 3px rgb(28 25 23 / 0.06), 0 8px 24px rgb(139 37 0 / 0.06);
  --sc-shadow-hover: 0 4px 28px rgb(139 37 0 / 0.12), 0 12px 40px rgb(28 25 23 / 0.08);
  --sc-section-gap: 3.5rem;

  /* legacy aliases (existing rules keep working) */
  --color-primary: var(--sc-cinnabar);
  --color-secondary: var(--sc-gold);
  --color-cta: var(--sc-cinnabar);
  --color-background: var(--sc-paper);
  --color-text: var(--sc-ink-classical);
  --color-border: var(--sc-border);
  --color-surface: var(--sc-paper-elevated);
  --font-serif: var(--sc-reading-font);
  --border-secondary-20: color-mix(in srgb, var(--sc-border) 55%, transparent);
  --border-secondary-30: color-mix(in srgb, var(--sc-border) 75%, transparent);
  --text-90: color-mix(in srgb, var(--sc-ink-classical) 90%, transparent);
  --text-80: color-mix(in srgb, var(--sc-ink-classical) 80%, transparent);
  --text-70: color-mix(in srgb, var(--sc-ink-classical) 70%, transparent);
  --text-60: color-mix(in srgb, var(--sc-muted) 100%, transparent);
  --text-50: color-mix(in srgb, var(--sc-muted) 85%, transparent);
  --secondary-10: color-mix(in srgb, var(--sc-gold) 12%, transparent);
  --focus-ring: 0 0 0 2px var(--sc-paper), 0 0 0 4px var(--sc-cinnabar);
  --radius: 0.375rem;
  --radius-lg: 0.5rem;
  --transition: 0.2s ease;
}

html.dark {
  --sc-paper: #0c0a09;
  --sc-paper-deep: #141210;
  --sc-paper-elevated: #1c1917;
  --sc-ink: #fafaf9;
  --sc-ink-light: #d6d3d1;
  --sc-ink-classical: #f5f0e8;
  --sc-muted: #a8a29e;
  --sc-muted-label: #78716c;
  --sc-border: #292524;
  --sc-border-strong: #44403c;
  --sc-verse-bg: #1c1917;
  --sc-verse-border: #44403c;
  --sc-sidebar-bg: #141210;
  --sc-sidebar-border: #292524;
  --sc-card-bg: rgb(28 25 23 / 0.6);
  --sc-shadow: 0 4px 20px rgb(0 0 0 / 0.35);
  --sc-shadow-hover: 0 8px 32px rgb(176 141 87 / 0.1), 0 20px 48px rgb(0 0 0 / 0.3);
  --color-primary: var(--sc-cinnabar);
  --color-secondary: var(--sc-gold);
  --color-cta: var(--sc-cinnabar);
  --color-background: var(--sc-paper);
  --color-text: var(--sc-ink-classical);
  --focus-ring: 0 0 0 2px var(--sc-paper), 0 0 0 4px var(--sc-gold);
}

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

* { box-sizing: border-box; }

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

body.site-shell {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sc-ui-font);
  background: var(--sc-paper);
  color: var(--sc-ink-classical);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body.site-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.site-shell > *:not(.site-header):not(.sc-mobile-drawer):not(.sc-mobile-drawer-backdrop):not(.skip-link):not(.share-toast):not(.poster-preview-overlay):not(#poster-preview-overlay):not(.poem-reading-bar):not(.poem-reading-sheet):not(#poem-reading-bar):not(#poem-reading-font-sheet):not(.poem-reader-fab-stack):not(#poem-reader-fab):not(.poem-speech-bar):not(#poem-speech-bar):not(.poem-reader-settings-sheet):not(#poem-reader-settings-sheet) {
  position: relative;
  z-index: 1;
}

.muted {
  color: var(--sc-muted);
}

/* Topic detail: label + pagination polish (overrides are safe). */
.home-section-label {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  line-height: 1.2;
}

.home-section-label a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-secondary-30);
  background: color-mix(in srgb, var(--color-background) 86%, white);
  text-decoration: none;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 600;
}

.home-section-label a:hover {
  border-color: var(--color-secondary);
  color: var(--color-primary);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0 0;
  flex-wrap: wrap;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-secondary-30);
  background: color-mix(in srgb, var(--color-background) 86%, white);
  text-decoration: none;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 600;
}

.pagination a:hover {
  border-color: var(--color-secondary);
  color: var(--color-primary);
}

.pagination span {
  padding: 0.25rem 0.5rem;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--color-background);
  color: var(--color-primary);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.skip-link:focus {
  left: 0.75rem;
  outline: none;
  box-shadow: var(--focus-ring);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--sc-paper) 88%, transparent);
  backdrop-filter: blur(12px);
  transition: border-color var(--transition), background var(--transition);
}

body.page-home .site-header:not(.site-header-scrolled) {
  border-bottom-color: transparent;
  background: color-mix(in srgb, var(--sc-paper) 72%, transparent);
}

.site-header.site-header-scrolled {
  border-bottom-color: var(--border-secondary-20);
  background: color-mix(in srgb, var(--sc-paper) 92%, transparent);
}

.site-header-inner {
  max-width: var(--sc-shell-width);
  margin: 0 auto;
  padding: 0 1rem;
  min-height: var(--sc-header-height);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .site-header-inner { padding: 0 1.5rem; }
}

.nav.nav-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
}

.logo {
  font-weight: 600;
  font-size: 1.125rem;
  text-decoration: none;
  color: var(--color-primary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition);
}
.logo:hover { color: var(--color-secondary); }
.logo:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.nav.nav-primary a:not(.logo) {
  color: var(--text-90);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition);
}
.nav.nav-primary a:not(.logo):hover { color: var(--color-primary); }
.nav.nav-primary a:not(.logo).active {
  font-weight: 600;
  color: var(--sc-cinnabar);
  box-shadow: inset 0 -2px 0 var(--sc-cinnabar);
}
.nav.nav-primary a:not(.logo):focus-visible { outline: none; box-shadow: var(--focus-ring); }

.site-header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.nav-search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-search-type {
  cursor: pointer;
  flex-shrink: 0;
  padding: 0.375rem 0.45rem;
  font-size: 0.8125rem;
  border: 1px solid var(--border-secondary-30);
  border-radius: var(--radius-lg);
  background: var(--color-background);
  color: var(--color-text);
  max-width: 5.5rem;
}
@media (min-width: 768px) {
  .nav-search-type { max-width: 6.25rem; font-size: 0.875rem; }
}
.nav-search-type:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.nav-search-input {
  width: 10rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-secondary-30);
  border-radius: var(--radius-lg);
  background: var(--color-background);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
@media (min-width: 768px) {
  .nav-search-input { width: 13rem; }
}
.nav-search-input::placeholder { color: var(--text-50); }
.nav-search-input:hover { border-color: var(--border-secondary-20); }
.nav-search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.nav-search-submit {
  margin-left: 0.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background: var(--color-cta);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: opacity var(--transition);
}
.nav-search-submit:hover { opacity: 0.9; }
.nav-search-submit:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.nav-theme-select {
  cursor: pointer;
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  border: 1px solid var(--border-secondary-30);
  border-radius: var(--radius-lg);
  background: var(--color-background);
  color: var(--color-text);
}
.nav-theme-select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.nav-github {
  font-size: 0.875rem;
  color: var(--text-90);
  text-decoration: none;
  padding: 0.25rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition);
}
.nav-github:hover { color: var(--color-primary); }
.nav-github:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.content {
  flex: 1;
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}
@media (min-width: 768px) {
  .content { padding: 1.5rem 1.5rem 3rem; }
}
.content.content-home { max-width: 72rem; }

/* 诗人列表主区（与首页同宽侧栏布局；主站 max-w-4xl 量级） */
.authors-page { display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 768px) {
  .authors-page { gap: 2rem; }
}
.authors-page-title {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
}
.authors-page-lead,
.authors-page-desc { margin: 0; font-size: 0.95rem; }
.authors-filter-hint { margin: 0; font-size: 0.9rem; }
.authors-filter-hint a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.authors-filter-hint a:hover { text-decoration: underline; }
.authors-filter-hint a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.authors-page-empty { margin: 0; }
.authors-page-empty a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.authors-page-empty a:hover { text-decoration: underline; }
.authors-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .authors-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .authors-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.authors-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-secondary-20);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color var(--transition), background var(--transition);
}
.authors-card:hover {
  border-color: var(--color-primary);
  background: var(--secondary-10);
}
.authors-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.authors-card-name {
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.authors-card-count { flex-shrink: 0; font-size: 0.875rem; }
.authors-pagination { margin-top: 0.5rem; justify-content: center; }

/* 诗人详情：对齐 app/authors/[slug]/page.tsx @author poetry (go-site) */
.author-detail-page {
  width: 100%;
}
.author-detail-main {
  max-width: 56rem;
}
.author-detail-hero {
  margin-bottom: 1.5rem;
}
/* 无图：占满主栏宽度，左对齐，不展示占位圆头像 */
.author-detail-hero-grid--no-portrait {
  display: block;
  width: 100%;
}
.author-detail-hero-grid--no-portrait .author-detail-identity-text {
  width: 100%;
  max-width: none;
  text-align: left;
}
.author-detail-hero--no-portrait-full {
  width: 100%;
}
.author-detail-hero--no-portrait-full .author-detail-hero-grid--no-portrait {
  width: 100%;
}
.author-detail-bio-body--in-hero {
  margin-top: 0.75rem;
  max-width: none;
  width: 100%;
}
.author-detail-hero--no-portrait-full .author-detail-bio-body--in-hero {
  padding: 1.25rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-secondary-20);
  background: color-mix(in srgb, var(--color-background) 65%, white);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-text) 5%, transparent);
}
@media (min-width: 768px) {
  .author-detail-hero--no-portrait-full .author-detail-bio-body--in-hero {
    padding: 1.5rem 1.5rem;
  }
}
.author-detail-hero--no-portrait-full .author-detail-bio-notice {
  margin-top: 0.5rem;
}
.author-detail-hero--no-portrait-full .author-detail-bio-source {
  margin-top: 0.75rem;
}
.author-detail-hero-grid--has-portrait {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
}
.author-detail-hero-grid--has-portrait .author-detail-identity-text {
  width: 100%;
  text-align: center;
}
.author-detail-portrait {
  width: 100%;
  max-width: 24rem;
  margin: 0 auto;
}
.author-detail-identity-text {
  min-width: 0;
}
@media (min-width: 768px) {
  .author-detail-hero-grid--has-portrait {
    display: grid;
    grid-template-columns: minmax(16rem, 28rem) 1fr;
    align-items: start;
    gap: 2rem 2.5rem;
  }
  .author-detail-hero-grid--has-portrait .author-detail-portrait {
    width: 100%;
    max-width: none;
    margin: 0;
  }
  .author-detail-hero-grid--has-portrait .author-detail-identity-text {
    text-align: left;
    align-self: start;
    padding-top: 0.25rem;
  }
}
.author-detail-name {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--color-primary);
  font-family: "Noto Serif SC", "Songti SC", serif;
  line-height: 1.2;
}
.author-detail-meta {
  margin: 0 0 0.85rem;
  font-size: 0.98rem;
  line-height: 1.5;
}
.author-detail-dynasty {
  font-weight: 600;
  color: var(--color-primary);
}
.author-detail-meta-sep {
  margin: 0 0.35rem;
  opacity: 0.55;
}
.author-detail-lead {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-90);
  max-width: 42em;
}
.author-detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin-top: 0.25rem;
}
.author-detail-hero-action {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  border: 1px solid var(--border-secondary-25);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-background) 75%, white);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.author-detail-hero-action:hover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-secondary) 12%, var(--color-background));
}
.author-detail-hero-action--external::after {
  content: "↗";
  margin-left: 0.25rem;
  font-size: 0.75em;
  opacity: 0.7;
}
.author-detail-section-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary);
}
.author-detail-bio {
  margin-bottom: 1.75rem;
  padding: 1.25rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-secondary-20);
  background: color-mix(in srgb, var(--color-background) 65%, white);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-text) 5%, transparent);
}
@media (min-width: 768px) {
  .author-detail-bio {
    padding: 1.5rem 1.5rem;
  }
}
.author-detail-bio-body {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-90);
}
.author-detail-bio--empty {
  border-style: dashed;
  background: color-mix(in srgb, var(--color-background) 88%, var(--secondary-10));
}
.author-detail-bio-empty,
.author-detail-bio-hint {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.6;
}
.author-detail-bio-hint {
  margin-bottom: 0;
}
.author-detail-bio-hint code {
  font-size: 0.82rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
}
.author-detail-bio-hint a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.author-detail-bio-hint a:hover {
  text-decoration: underline;
}
.author-detail-bio-hint a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.author-detail-works {
  margin-bottom: 1.5rem;
}
.author-detail-poem-list {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .author-detail-poem-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 900px) {
  .author-detail-poem-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.author-detail-pagination {
  margin-top: 1rem;
  justify-content: flex-start;
}
.author-detail-back {
  margin: 1.5rem 0 0;
}
.author-detail-back a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.author-detail-back a:hover {
  text-decoration: underline;
}
.author-detail-back a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.author-detail-empty {
  margin: 0.5rem 0 0;
}

/* 朝代 / 标签 / 词牌索引页（对齐 FilterableList + max-w-4xl 主区） */
.browse-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: none;
  width: 100%;
}
.browse-intro { margin: 0; font-size: 0.95rem; }
.browse-empty { margin: 0; }
.browse-empty a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.browse-empty a:hover { text-decoration: underline; }
.browse-item-grid { margin-top: 0.25rem; }

/* 页脚友情站点（全站） */
.site-footer-friends {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-secondary-20);
  font-size: 0.8125rem;
  color: var(--text-70);
}
.site-footer-friends-label {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-70);
}
.site-footer-friends-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.site-footer-friends-list a {
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}
.site-footer-friends-list a:hover { text-decoration: underline; }

/* 首页：左栏 + 主区（对齐 LayoutWithSidebar） */
.home-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
@media (min-width: 1024px) {
  .home-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
  }
}

.home-aside {
  width: 100%;
  flex-shrink: 0;
  padding: 0.75rem 0;
}
@media (min-width: 1024px) {
  .home-aside {
    position: sticky;
    top: 5rem;
    width: 13rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-secondary-20);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--color-background) 70%, white);
  }
}

.home-main {
  min-width: 0;
  flex: 1;
}

.home-aside-block { margin-bottom: 1.25rem; }
.home-aside-block:last-child { margin-bottom: 0; }
.home-aside-heading {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-primary);
}
.home-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.4rem;
}
a.home-chip {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-decoration: none;
  color: var(--color-primary);
  border: 1px solid var(--border-secondary-30);
  border-radius: 999px;
  background: var(--color-background);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
a.home-chip:hover {
  border-color: var(--color-primary);
  background: var(--secondary-10);
}
a.home-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.hero { text-align: center; margin-bottom: 1.5rem; }
.hero h1 {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 0.5rem;
}
.home-hero .home-tagline { margin: 0.35rem 0; font-size: 1rem; color: var(--text-80); }
.home-hero .home-stats { margin: 0.5rem 0; }
.home-intro {
  max-width: 36rem;
  margin: 0.75rem auto 0;
  line-height: 1.55;
  font-size: 0.9rem;
  text-align: center;
}
.home-intro a {
  color: var(--color-primary);
  font-weight: 500;
}
.home-intro a:hover { color: var(--color-secondary); }

.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto 2rem;
  max-width: 48rem;
  padding: 0 0.5rem;
}

/* 对齐 app/page.tsx CTA */
.home-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: center;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.home-btn-solid {
  background: var(--color-primary);
  color: #fff;
  border: 2px solid var(--color-primary);
}
.home-btn-solid:hover {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
}
.home-btn-outline-primary {
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}
.home-btn-outline-primary:hover {
  background: var(--color-primary);
  color: #fff;
}
.home-btn-outline-cta {
  border: 2px solid var(--color-cta);
  color: var(--color-cta);
  background: transparent;
}
.home-btn-outline-cta:hover {
  background: var(--color-cta);
  color: #fff;
}
.home-btn-outline-secondary {
  border: 2px solid var(--color-secondary);
  color: var(--color-secondary);
  background: transparent;
}
.home-btn-outline-secondary:hover {
  background: var(--color-secondary);
  color: #fff;
}
.home-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.home-recommend { margin: 0 auto 2.5rem; max-width: 42rem; }
@media (min-width: 1024px) {
  .home-main .home-recommend { max-width: none; margin-left: 0; margin-right: 0; }
}
.home-recommend-title {
  font-family: "Noto Serif SC", serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--color-primary);
}
.home-recommend-list { list-style: none; padding: 0; margin: 0; }
.home-recommend-list li { margin: 0 0 0.75rem; }
.home-recommend-card {
  display: block;
  padding: 1rem;
  border: 1px solid var(--border-secondary-20);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-background) 50%, white);
  text-decoration: none;
  color: var(--color-text);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.home-recommend-card:hover {
  border-color: var(--color-primary);
  background: var(--secondary-10);
}
.home-recommend-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.home-recommend-card-title {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}
.home-recommend-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  margin-top: 0.375rem;
  font-size: 0.875rem;
}
.home-recommend-sep { color: var(--text-50); user-select: none; }
.home-recommend-card-excerpt {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-60);
}
.home-recommend-empty { text-align: center; max-width: 28rem; margin: 0 auto 2rem; }
.home-recommend-empty a { color: var(--color-primary); }

/* 阅读型首页 */
.home-main-reading { max-width: 42rem; }
.home-section-label {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.home-section-heading { margin: 0; font-size: 1.25rem; font-family: var(--font-serif); }
.home-topics { margin-bottom: 2.25rem; }
.home-read-more { font-weight: 600; color: var(--color-primary); text-decoration: none; }
.home-read-more:hover { text-decoration: underline; }
.home-author-card { display: flex; gap: 1rem; align-items: flex-start; }
.home-author-initials {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-serif);
}
.home-author-name { margin: 0; font-size: 1.25rem; }
.home-author-name a { color: inherit; text-decoration: none; }
.home-author-name a:hover { color: var(--color-primary); }
.home-author-bio { margin: 0.35rem 0 0.5rem; line-height: 1.5; }
.home-author-highlights { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.home-author-highlights li { margin: 0.25rem 0; }
.home-author-highlights a { color: var(--color-primary); text-decoration: none; }
.home-author-highlights a:hover { text-decoration: underline; }
.home-seasonal-topic { margin-bottom: 2.25rem; }
.home-seasonal-link {
  display: block;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-subtle, rgba(0,0,0,0.08));
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-seasonal-link:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.06));
}
.home-seasonal-title { margin: 0; font-size: 1.5rem; font-family: var(--font-serif); line-height: 1.35; }
.home-seasonal-sub { margin: 0.35rem 0 0; font-size: 0.9375rem; line-height: 1.45; }
.home-seasonal-desc {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-80, rgba(0,0,0,0.75));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-seasonal-cta { font-size: 0.875rem; color: var(--color-primary); font-weight: 500; }
.home-topics-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.home-topics-all { font-size: 0.875rem; text-decoration: none; }
.home-topics-all:hover { color: var(--color-primary); }
.home-topic-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
.home-topic-grid-page { margin-top: 1rem; }
.home-topic-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--border-subtle, rgba(0,0,0,0.08));
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  min-height: 5.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.home-topic-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.06)); }
.home-topic-card-title { font-weight: 600; font-family: var(--font-serif); line-height: 1.35; }
.home-topic-card-sub { font-size: 0.875rem; line-height: 1.4; }
.home-topic-card-count { font-size: 0.8125rem; margin-top: auto; }
.home-secondary { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border-subtle, rgba(0,0,0,0.08)); }
.home-actions-compact { margin-top: 0.75rem; }
.poem-intro {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--color-cta, var(--color-primary));
  background: var(--surface-muted, rgba(0,0,0,0.03));
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-80);
}
.topic-description { margin: 0.5rem 0 0; line-height: 1.6; max-width: 40rem; }

@media (min-width: 960px) {
  .home-main-reading { max-width: none; }
}

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin: 1.5rem 0; }

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  background: var(--color-background);
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.btn:hover {
  background: var(--secondary-10);
  color: var(--color-primary);
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-secondary);
  border-color: var(--color-secondary);
  color: #fff;
}
/* 朗读进行中：与主站「停止」次要按钮风格接近 */
button.btn-secondary {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
}
button.btn-secondary:hover {
  opacity: 0.9;
  color: #fff;
}

table.list {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  border: 1px solid var(--border-secondary-20);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
table.list th, table.list td {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border-secondary-20);
  text-align: left;
  vertical-align: top;
}
table.list tbody tr:last-child td { border-bottom: none; }
table.list tbody tr:hover td { background: var(--secondary-10); }
table.list th {
  color: var(--text-70);
  font-weight: 600;
  background: color-mix(in srgb, var(--color-background) 60%, white);
}
table.list a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
table.list a:hover { text-decoration: underline; color: var(--color-secondary); }
table.list a:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.poem-body p { margin: 0.75rem 0; }
.title-pinyin { font-size: 0.95rem; letter-spacing: 0.02em; margin: 0.25rem 0 0.75rem; }
.meta-pinyin { font-size: 0.85rem; margin: -0.25rem 0 0.75rem; }
.poem-line-ruby {
  text-align: center;
  line-height: 2.15;
  margin: 0.75rem 0;
  text-indent: 0;
  word-break: keep-all;
  overflow-wrap: normal;
}
.poem-line-ruby ruby,
.poem-line-ruby > span {
  margin-inline: 0.04em;
}
.poem-ruby-chunk {
  display: inline;
  white-space: normal;
  word-break: keep-all;
}
ruby { ruby-align: center; }
.py-rt { font-size: 0.65rem; font-family: "Noto Sans SC", system-ui, sans-serif; color: var(--text-60); }
.poem-meta { color: var(--text-70); font-size: 0.9rem; margin-bottom: 1rem; }
.poem-meta a { color: var(--color-primary); text-decoration: none; }
.poem-meta a:hover { text-decoration: underline; }
.section-title { font-size: 1.2rem; margin: 1.5rem 0 0.75rem; color: var(--color-text); }
.pagination { margin-top: 1.5rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.pagination a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.pagination a:hover { text-decoration: underline; }
.pagination a:focus-visible { outline: none; box-shadow: var(--focus-ring); }

blockquote.bio {
  margin: 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--border-secondary-30);
  color: var(--text-70);
}

html[data-variant="t"] body {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif TC", "Songti SC", serif;
}

/* 诗文详情：三栏（左发现 + 中 PoemReader + 右 PoemDetailSidebar），对齐 LayoutWithSidebar */
.poem-detail-shell {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: stretch;
}
@media (min-width: 1024px) {
  .poem-detail-shell {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
  }
}
.poem-detail-aside-left {
  width: 100%;
  flex-shrink: 0;
}
@media (min-width: 1024px) {
  .poem-detail-aside-left {
    position: sticky;
    top: 5rem;
    width: 13rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-secondary-20);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--color-background) 70%, white);
  }
}
.poem-detail-article {
  flex: 1;
  min-width: 0;
  max-width: 42rem;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.poem-detail-header { text-align: center; }
.poem-detail-title {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(1.5rem, 3.5vw, 1.875rem);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0;
  line-height: 1.35;
}
.poem-detail-title-pinyin { margin: 0.35rem 0 0; font-size: 0.95rem; }
.poem-detail-meta {
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.15rem 0.25rem;
  font-size: 0.9rem;
  color: var(--text-80);
}
.poem-detail-meta-sep { color: var(--text-50); }
.poem-detail-meta a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.poem-detail-meta a:hover { text-decoration: underline; }
.poem-detail-meta-pinyin { margin: 0.25rem 0 0; font-size: 0.85rem; }
.poem-detail-rhythmic-label { font-size: 0.9rem; }
.poem-detail-tags {
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.875rem;
}
.poem-detail-tags-label { flex-shrink: 0; }
a.poem-detail-tag-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
  color: var(--color-primary);
  text-decoration: none;
  border: 1px solid var(--border-secondary-20);
  transition: border-color var(--transition), background var(--transition);
}
a.poem-detail-tag-pill:hover {
  border-color: var(--color-primary);
  background: var(--secondary-10);
}
a.poem-detail-tag-pill:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.poem-detail-body { margin: 0; }
.poem-detail-body-line {
  margin: 0.75rem 0;
  text-align: center;
  font-size: 1.125rem;
  line-height: 2;
}

.poem-detail-annotation-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-secondary-20);
}
.poem-annotation-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-secondary-20);
  padding: 1rem;
  background: color-mix(in srgb, var(--color-background) 88%, white);
}
.poem-annotation-card-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}
.poem-annotation-card-body {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text-90);
  line-height: 1.65;
  font-size: 0.95rem;
}

.poem-detail-back { margin: 0; padding-top: 0.5rem; }
.poem-detail-back a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.poem-detail-back a:hover { text-decoration: underline; }
.poem-detail-back a:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.poem-detail-aside-right {
  width: 100%;
  flex-shrink: 0;
}
@media (min-width: 1024px) {
  .poem-detail-aside-right {
    width: 15rem;
    position: sticky;
    top: 5.5rem;
    align-self: flex-start;
  }
}
.poem-aside-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.poem-aside-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-secondary-20);
  padding: 1rem;
  background: var(--color-background);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.poem-aside-card-title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}
.poem-aside-correction-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}
.poem-correction-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--color-text);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity var(--transition);
}
.poem-correction-btn:hover { opacity: 0.9; }
.poem-correction-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.poem-correction-icon { flex-shrink: 0; }
.poem-correction-hint { margin: 0; font-size: 0.75rem; line-height: 1.45; }
.poem-correction-hint a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.poem-correction-hint a:hover { text-decoration: underline; }

.poem-aside-read-inner { display: flex; justify-content: center; }
.poem-aside-read .read-aloud { min-width: 7rem; }

.poem-aside-share-hint { margin: 0 0 0.75rem; font-size: 0.8125rem; line-height: 1.45; }
.share-data-src {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  resize: none;
}
.share-actions { display: flex; flex-direction: column; gap: 0.5rem; }
.share-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-sm, 0.375rem);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.share-btn:hover {
  background: color-mix(in srgb, var(--color-secondary) 12%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-border) 70%, var(--color-primary));
}
.share-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.share-btn-icon { flex-shrink: 0; }
.share-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md, 0.5rem);
  /* 浅色底 + 主题正文色：避免误用未定义的 --color-surface 导致与背景同色 */
  background: #ffffff;
  color: var(--color-text);
  border: 1px solid var(--border-secondary-30);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
  max-width: min(90vw, 20rem);
  text-align: center;
  animation: share-toast-in 0.22s ease-out;
}
@keyframes share-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(0.5rem); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .share-toast { animation: none; }
}
@media (max-width: 767px) {
  .share-toast {
    top: calc(0.85rem + env(safe-area-inset-top, 0px));
    bottom: auto;
    transform: translateX(-50%);
    z-index: 100001;
  }
  @keyframes share-toast-in-mobile {
    from { opacity: 0; transform: translateX(-50%) translateY(-0.5rem); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
  .share-toast {
    animation: share-toast-in-mobile 0.22s ease-out;
  }
  .poem-detail-article .poem-aside-share.poem-detail-main-share {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  }
  .share-btn {
    min-height: 2.75rem;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(139, 37, 0, 0.12);
  }
  .share-btn:active {
    opacity: 0.82;
  }
}
.poster-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.78);
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.18s ease-out;
}
.poster-preview-overlay.poster-preview-open {
  opacity: 1;
}
.poster-preview-panel {
  width: min(100%, 24rem);
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem 1rem;
  border-radius: var(--radius-md, 0.5rem);
  background: var(--sc-surface, #fff);
  color: var(--color-text, #2b2318);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transform: translateY(0.35rem);
  transition: transform 0.18s ease-out;
}
.poster-preview-overlay.poster-preview-open .poster-preview-panel {
  transform: translateY(0);
}
.poster-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
}
.poster-preview-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.poster-preview-close {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--sc-muted, #78716c);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
}
.poster-preview-hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  flex-shrink: 0;
}
.poster-preview-img-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm, 0.375rem);
  background: #f5f5f4;
  touch-action: pan-y;
}
.poster-preview-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: var(--radius-sm, 0.375rem);
  background: #f5f5f4;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
  pointer-events: auto;
}
.poster-preview-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}
.poster-preview-share,
.poster-preview-download {
  width: 100%;
  flex-shrink: 0;
}
.poem-aside-share-hint-mobile {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  line-height: 1.55;
}
@media (prefers-reduced-motion: reduce) {
  .poster-preview-overlay,
  .poster-preview-panel {
    transition: none;
  }
}


/* 主栏内分享：与居中正文一致，按钮组可换行不溢出 */
.poem-detail-article .poem-aside-share.poem-detail-main-share {
  width: 100%;
  box-sizing: border-box;
}
.poem-detail-article .poem-aside-share .share-actions-row {
  justify-content: center;
}

.poem-aside-author-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.poem-aside-author-avatar {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--color-secondary) 22%, transparent);
  color: var(--color-text);
}
.poem-aside-author-text { min-width: 0; flex: 1; }
.poem-aside-author-name {
  display: block;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.poem-aside-author-name:hover { color: var(--color-primary); }
.poem-aside-author-py { margin: 0.2rem 0 0; font-size: 0.8125rem; }
.poem-aside-author-dyn { margin: 0.35rem 0 0; font-size: 0.75rem; }

.poem-detail-aside-right .reading-settings-hint { display: none; }

.same-dynasty-list { list-style: none; padding: 0; margin: 0; font-size: 0.875rem; }
.same-dynasty-list li { margin: 0.35rem 0; line-height: 1.4; }
.same-dynasty-list a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  color: var(--text-90);
}
.same-dynasty-list a:hover { color: var(--color-primary); }
.same-dynasty-list a:focus-visible { outline: none; box-shadow: var(--focus-ring); }

html[data-show-annotation="0"] .poem-annotation-sections { display: none !important; }

/* 拼音：正文 ruby / 无拼音纯文 切换；标题/作者拼音行随开关显示。 */
html[data-show-pinyin="0"] .poem-pinyin-layer { display: none !important; }
html[data-show-pinyin="1"] .poem-body-plain-layer { display: none !important; }

/* 简繁：纯文双层 SSR；繁体+拼音时正文仍用简体 ruby，由 JS+opencc-js 转汉字（与主站 PoemReader 一致）。 */
html[data-variant="t"] .poem-variant-s-layer { display: none !important; }
html[data-variant="s"] .poem-variant-t-layer { display: none !important; }
html[data-variant="t"] .poem-detail-title-pinyin,
html[data-variant="t"] .poem-detail-meta-pinyin { display: none !important; }
.poem-font-song .poem-body { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; }
.poem-font-kai .poem-body { font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; }
.poem-font-calligraphy .poem-body { font-family: "STXingkai", "Xingkai SC", "Kaiti SC", serif; }
.poem-font-handwriting .poem-body { font-family: "HanziPen SC", "Kaiti SC", cursive; }
.poem-font-artistic .poem-body { font-family: "Baoli SC", "Songti SC", serif; }
.poem-detail-page.poem-font-song .poem-detail-title,
.poem-detail-page.poem-font-song .poem-detail-body { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; }
.poem-detail-page.poem-font-kai .poem-detail-title,
.poem-detail-page.poem-font-kai .poem-detail-body { font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; }
.poem-detail-page.poem-font-calligraphy .poem-detail-title,
.poem-detail-page.poem-font-calligraphy .poem-detail-body { font-family: "STXingkai", "Xingkai SC", "Kaiti SC", serif; }
.poem-detail-page.poem-font-handwriting .poem-detail-title,
.poem-detail-page.poem-font-handwriting .poem-detail-body { font-family: "HanziPen SC", "Kaiti SC", cursive; }
.poem-detail-page.poem-font-artistic .poem-detail-title,
.poem-detail-page.poem-font-artistic .poem-detail-body { font-family: "Baoli SC", "Songti SC", serif; }

.poems-list-root h1 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

/* 诗文列表页：主站 PoemsListClient 式卡片 + 工具条 */
.poems-list-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: none;
  width: 100%;
}
.poems-page-header { margin: 0; }
.poems-page-title {
  font-family: "Noto Serif SC", serif;
  font-size: clamp(1.5rem, 3.5vw, 1.875rem);
  font-weight: 700;
  color: var(--color-primary);
  margin: 0 0 0.35rem;
}
.poems-page-lead { margin: 0; font-size: 0.95rem; line-height: 1.5; }
.poems-page-lead strong { color: var(--color-text); font-weight: 700; }

.poems-active-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-secondary-20);
  background: color-mix(in srgb, var(--color-background) 75%, white);
  font-size: 0.875rem;
}
.poems-active-label { color: var(--text-70); font-weight: 600; }
.poems-filter-chip {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-secondary-30);
  background: var(--color-background);
  color: var(--color-text);
  font-weight: 500;
}
.poems-clear-filter {
  margin-left: auto;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}
.poems-clear-filter:hover { text-decoration: underline; }
.poems-clear-filter:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius); }

.poems-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.poems-toolbar .home-btn {
  font-size: 0.8125rem;
  padding: 0.35rem 0.65rem;
}

.poems-empty { padding: 1rem 0; }
.poems-empty-text { margin: 0 0 0.5rem; }
.poems-empty a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.poems-empty a:hover { text-decoration: underline; }

.poems-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
a.poems-list-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-secondary-20);
  background: color-mix(in srgb, var(--color-background) 85%, white);
  text-decoration: none;
  color: var(--color-text);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
a.poems-list-card:hover {
  border-color: var(--color-primary);
  background: var(--secondary-10);
}
a.poems-list-card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.poems-list-card-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
}
.poems-list-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  font-size: 0.875rem;
}
.poems-list-card-sep { color: var(--text-50); user-select: none; }
.poems-list-card-excerpt {
  font-size: 0.875rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.poems-pagination {
  margin-top: 0.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-secondary-20);
}

/* 阅读设置：对齐主站 ReadingSettingsCard + Toggle（侧栏内全宽） */
.reading-settings-panel {
  max-width: 100%;
  margin: 0;
  padding: 0;
}
.reading-settings-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-secondary-20);
  background: var(--color-background);
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.reading-settings-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}
.reading-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-90);
}
.reading-toggle__text { flex: 1; }
.reading-toggle__switch {
  position: relative;
  display: inline-flex;
  width: 2.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}
.reading-toggle__input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.reading-toggle__track {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--color-secondary) 30%, transparent);
  transition: background var(--transition);
  pointer-events: none;
}
.reading-toggle__thumb {
  position: absolute;
  left: 0.125rem;
  top: 0.125rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: transform var(--transition);
  pointer-events: none;
}
.reading-toggle__input:checked ~ .reading-toggle__track {
  background: var(--color-primary);
}
.reading-toggle__input:checked ~ .reading-toggle__thumb {
  transform: translateX(1rem);
}
.reading-toggle__input:focus-visible ~ .reading-toggle__track {
  box-shadow: var(--focus-ring);
}
.reading-font-block { padding: 0.5rem 0; }
.reading-font-heading {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-90);
}
.reading-font-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.reading-font-chip {
  position: relative;
  cursor: pointer;
}
.reading-font-chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}
.reading-font-chip span {
  display: inline-block;
  padding: 0.375rem 0.625rem;
  font-size: 0.875rem;
  border-radius: var(--radius);
  color: var(--text-90);
  background: color-mix(in srgb, var(--color-secondary) 20%, transparent);
  transition: background var(--transition), color var(--transition);
}
.reading-font-chip:hover span {
  background: color-mix(in srgb, var(--color-secondary) 30%, transparent);
}
.reading-font-chip input:checked + span,
.reading-font-chip input:focus-visible + span {
  background: var(--color-primary);
  color: #fff;
}
.reading-font-chip input:focus-visible + span {
  box-shadow: var(--focus-ring);
}
.reading-settings-hint {
  font-size: 0.75rem;
  margin: 0.75rem 0 0;
  line-height: 1.45;
}
.reading-settings-hint code {
  font-size: 0.7rem;
  background: var(--secondary-10);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

/* 移动端底部阅读工具栏（诗详情）；桌面默认隐藏见 @media min-width 768px */
.poem-reading-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--sc-paper-elevated, #fff);
  border-top: 1px solid var(--sc-border, var(--border-secondary-20));
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
  pointer-events: auto;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.poem-reading-bar-inner {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 0.25rem;
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.35rem 0.5rem;
}
.poem-reading-bar-btn {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  border-radius: var(--radius-md, 0.5rem);
  background: transparent;
  color: var(--text-90, var(--sc-ink));
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.5rem 0.35rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(139, 37, 0, 0.12);
  pointer-events: auto;
  transition: background var(--transition), color var(--transition);
}
.poem-reading-bar-btn:hover {
  background: color-mix(in srgb, var(--color-secondary, #888) 14%, transparent);
}
.poem-reading-bar-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.poem-reading-bar-btn:active {
  opacity: 0.82;
}
.poem-reading-bar-btn.is-active {
  background: color-mix(in srgb, var(--color-primary, #8b2500) 14%, transparent);
  color: var(--color-primary, #8b2500);
}
.poem-reading-bar-btn-font {
  flex: 1.15 1 0;
}
.poem-reading-sheet {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.poem-reading-sheet[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.poem-reading-sheet.is-open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}
.poem-reading-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  padding: 0;
  cursor: pointer;
}
.poem-reading-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 24rem);
  margin: 0 auto;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
  border-radius: var(--radius-lg, 0.75rem) var(--radius-lg, 0.75rem) 0 0;
  background: var(--sc-paper-elevated, #fff);
  color: var(--color-text, #2b2318);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  transform: translateY(100%);
  transition: transform 0.22s ease-out;
}
.poem-reading-sheet.is-open .poem-reading-sheet-panel {
  transform: translateY(0);
}
.poem-reading-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.poem-reading-sheet-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.poem-reading-sheet-close {
  border: none;
  background: transparent;
  color: var(--sc-muted, #78716c);
  font-size: 0.875rem;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
}
.poem-reading-sheet-fonts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.poem-reading-sheet-font {
  border: 1px solid var(--border-secondary-20);
  border-radius: var(--radius-md, 0.5rem);
  background: color-mix(in srgb, var(--color-secondary) 12%, transparent);
  color: var(--text-90);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 0.35rem;
  cursor: pointer;
}
.poem-reading-sheet-font.is-active,
.poem-reading-sheet-font[aria-selected="true"] {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.poem-reading-sheet-font:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
@media (min-width: 768px) {
  .poem-reading-bar,
  .poem-reading-sheet {
    display: none !important;
  }
}

/* 诗详情 FAB + 设置抽屉 + 朗读底栏（对齐 jingxin reader chrome） @author changyadai */
.poem-reader-fab-stack {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(5.5rem + env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
}
body.poem-speech-active .poem-reader-fab-stack {
  bottom: calc(9.5rem + env(safe-area-inset-bottom));
}
@media (min-width: 768px) {
  .poem-reader-fab-stack {
    bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }
  body.poem-speech-active .poem-reader-fab-stack {
    bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }
}
.poem-reader-fab {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 3rem;
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--color-primary) 25%, transparent);
  border-radius: 9999px;
  background: color-mix(in srgb, var(--color-background) 92%, transparent);
  color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
}
.poem-reader-fab:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16); }
.poem-reader-fab:active { transform: scale(0.96); }
.poem-reader-fab:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.poem-reader-fab-speech {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
}
.poem-reader-fab-label { display: none; }
@media (min-width: 768px) {
  .poem-reader-fab-label { display: inline; }
}

.poem-reader-settings-sheet {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.poem-reader-settings-sheet[hidden] { display: none !important; }
.poem-reader-settings-sheet.is-open { pointer-events: auto; }
.poem-reader-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.24s ease;
}
.poem-reader-settings-sheet.is-open .poem-reader-settings-backdrop { opacity: 1; }
.poem-reader-settings-panel {
  position: relative;
  width: min(100%, 24rem);
  max-height: min(80vh, 28rem);
  overflow: auto;
  margin: 0 0 max(0.5rem, env(safe-area-inset-bottom));
  padding: 1rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-background);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform 0.24s ease;
}
@media (min-width: 768px) {
  .poem-reader-settings-sheet { align-items: center; }
  .poem-reader-settings-panel {
    margin: 1rem;
    border-radius: var(--radius-lg);
    transform: translateY(12px);
    opacity: 0;
    transition: transform 0.24s ease, opacity 0.24s ease;
  }
  .poem-reader-settings-sheet.is-open .poem-reader-settings-panel {
    transform: translateY(0);
    opacity: 1;
  }
}
.poem-reader-settings-sheet.is-open .poem-reader-settings-panel { transform: translateY(0); }
.poem-reader-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.poem-reader-settings-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}
.poem-reader-settings-close {
  border: 0;
  background: transparent;
  color: var(--text-70);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
}
.poem-reader-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
}
.poem-reader-settings-row-font { align-items: flex-start; }
.poem-reader-settings-label {
  font-size: 0.875rem;
  color: var(--text-90);
  flex-shrink: 0;
}
.poem-toggle-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  justify-content: flex-end;
}
.poem-toggle-chip {
  border: 1px solid var(--border-secondary-20);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-70);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.poem-toggle-chip.is-active,
.poem-toggle-chip[aria-pressed="true"] {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
}
.poem-toggle-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.poem-speech-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  border-top: 1px solid var(--border-secondary-20);
  background: color-mix(in srgb, var(--color-background) 95%, transparent);
  backdrop-filter: blur(10px);
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}
.poem-speech-bar[hidden] { display: none !important; }
body.poem-speech-active { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
@media (min-width: 768px) {
  body.poem-speech-active { padding-bottom: calc(3.75rem + env(safe-area-inset-bottom)); }
}
.poem-speech-bar-hint {
  margin: 0;
  padding: 0.35rem 1rem;
  font-size: 0.6875rem;
  text-align: center;
  color: var(--color-primary);
  border-bottom: 1px solid var(--border-secondary-20);
}
.poem-speech-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  max-width: 48rem;
  margin: 0 auto;
}
.poem-speech-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-70);
  cursor: pointer;
}
.poem-speech-btn-play {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  background: var(--color-primary);
  color: #fff;
}
.poem-speech-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.poem-speech-progress {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-70);
  min-width: 3rem;
}
.poem-speech-chip {
  border: 1px solid var(--border-secondary-20);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-70);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  white-space: nowrap;
}
.poem-speech-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.poem-detail-body-line.sc-speech-active {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  border-radius: var(--radius);
  transition: background var(--transition);
}

.poem-body { font-size: 1.05rem; line-height: 1.85; }
.poem-detail-body.poem-body { font-size: 1.125rem; line-height: 2; }

button.btn {
  font: inherit;
  border-style: solid;
}
button.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-secondary-20);
  background: var(--color-background);
}
.site-footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}
@media (min-width: 768px) {
  .site-footer-inner { padding: 1.5rem 1.5rem; }
}
.site-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-70);
}
.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.site-footer-nav a,
.site-footer-copy {
  color: var(--text-70);
}
.site-footer-nav a {
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--transition);
}
.site-footer-nav a:hover { color: var(--color-primary); }
.site-footer-nav a:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* HTML 404（fragment_not_found） @author poetry (go-site) */
.not-found-page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}
@media (min-width: 768px) {
  .not-found-page { padding: 2.5rem 1.5rem 4rem; }
}

.not-found-hero {
  text-align: center;
  margin-bottom: 2rem;
}
.not-found-code {
  margin: 0 0 0.25rem;
  font-size: clamp(3.5rem, 12vw, 5.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: transparent;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--color-primary) 85%, white),
    var(--color-secondary)
  );
  -webkit-background-clip: text;
  background-clip: text;
  user-select: none;
}
.not-found-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  color: var(--color-text);
}
.not-found-lead {
  margin: 0 auto;
  max-width: 32rem;
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-70);
}

.not-found-card {
  border: 1px solid var(--border-secondary-20);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-background) 70%, white);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-text) 6%, transparent);
  padding: 1.25rem 1.25rem 1rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 768px) {
  .not-found-card { padding: 1.5rem 1.5rem 1.25rem; }
}
.not-found-subtitle {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-80);
}

.not-found-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 1fr;
}
@media (min-width: 520px) {
  .not-found-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}
@media (min-width: 768px) {
  .not-found-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.not-found-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-secondary-20);
  background: var(--color-background);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  min-height: 4.25rem;
}
.not-found-tile:hover {
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--border-secondary-20));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-primary) 12%, transparent);
  transform: translateY(-1px);
}
.not-found-tile:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.not-found-tile-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-primary);
}
.not-found-tile-desc {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-60);
}

.not-found-hint {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-60);
  border-top: 1px dashed var(--border-secondary-20);
  padding-top: 0.85rem;
}

.not-found-details {
  margin-bottom: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-secondary-20);
  background: color-mix(in srgb, var(--color-background) 85%, transparent);
  padding: 0.35rem 0.75rem;
}
.not-found-details-summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-70);
  list-style: none;
}
.not-found-details-summary::-webkit-details-marker { display: none; }
.not-found-details-summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform var(--transition);
  color: var(--color-primary);
}
.not-found-details[open] .not-found-details-summary::before {
  transform: rotate(90deg);
}
.not-found-details-body {
  padding: 0.5rem 0 0.35rem 1rem;
}
.not-found-path {
  display: block;
  font-size: 0.8rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-all;
  color: var(--text-80);
  line-height: 1.5;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

a.btn-secondary {
  border-color: var(--border-secondary-20);
  color: var(--color-text);
}
a.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.poem-annotation-missing {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--border-secondary-20);
  border-radius: 0.5rem;
}
.poem-aside-author-bio {
  margin-top: 0.65rem;
  font-size: 0.875rem;
  line-height: 1.55;
}
.poem-ai-slot {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--border-secondary-20);
  border-radius: 0.5rem;
}
.poem-ai-badge {
  font-size: 0.75rem;
  font-weight: normal;
}
.poem-ai-generated .poem-annotation-card-title {
  scroll-margin-top: 4rem;
}
.poem-ai-saved,
.poem-ai-error {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

/* media_cache 热链配图（Wikimedia Commons 等） */
.poem-hero-media {
  margin: 1rem 0 1.25rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--border-secondary-20);
  background: color-mix(in srgb, var(--color-background) 92%, var(--color-secondary));
}
.poem-hero-media img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  opacity: 0.92;
  filter: saturate(0.85);
}
.poem-media-credit {
  margin: 0;
  padding: 0.45rem 0.65rem;
  font-size: 0.72rem;
  line-height: 1.45;
  border-top: 1px solid var(--border-secondary-20);
}
.poem-media-credit a {
  color: var(--text-70);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.home-topic-card-has-media {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  overflow: hidden;
}
.home-topic-card-media {
  display: block;
  width: 100%;
  min-height: 5.5rem;
  background-size: cover;
  background-position: center;
  opacity: 0.9;
  filter: saturate(0.85);
}
.home-topic-card-has-media .home-topic-card-title,
.home-topic-card-has-media .home-topic-card-sub,
.home-topic-card-has-media .home-topic-card-count {
  padding-left: 0.85rem;
  padding-right: 0.85rem;
}
.home-topic-card-has-media .home-topic-card-count {
  padding-bottom: 0.75rem;
}
/* 维基肖像：勿用 .author-detail-page .author-detail-avatar 的 4rem 限制（见下方 :not(--photo)） */
.author-detail-page .author-detail-avatar--photo {
  width: 100%;
  height: auto;
  max-width: none;
  font-size: inherit;
}
.author-detail-avatar--photo {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: min(75vh, 32rem);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-secondary-20);
  background: color-mix(in srgb, var(--color-background) 92%, var(--color-secondary));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-text) 8%, transparent);
}
@media (min-width: 768px) {
  .author-detail-hero-grid--has-portrait .author-detail-avatar--photo {
    max-height: min(80vh, 36rem);
  }
}
.author-detail-avatar--photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
}
.author-detail-initials-fallback {
  display: none;
}
.author-detail-avatar--fallback {
  aspect-ratio: 1;
  max-height: 5.5rem;
}
.author-detail-avatar--fallback .author-detail-initials-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 4rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-background) 88%, var(--color-secondary));
  border-radius: 0.5rem;
}

/* ========== sc design system (jingxin-aligned) ========== */

.sc-shell {
  max-width: var(--sc-shell-width);
  margin: 0 auto;
  padding: 0 1rem;
}

.sc-page {
  max-width: var(--sc-page-width);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

@media (min-width: 768px) {
  .sc-page { padding: 2.5rem 1.5rem 4rem; }
}

.sc-section-label {
  margin: 0;
  font-family: var(--sc-ui-font);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  color: var(--sc-gold);
  text-align: center;
}

.sc-section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.sc-section-header .sc-section-label {
  text-align: left;
  flex-shrink: 0;
}

.sc-section-header-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--sc-border), transparent);
}

.sc-divider {
  border: none;
  height: 1px;
  margin: 0 auto;
  max-width: var(--sc-shell-width);
  background: linear-gradient(to right, transparent, var(--sc-border), transparent);
}

.sc-portal-hero {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 0 0;
  border-bottom: 1px solid var(--sc-border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--sc-paper-elevated) 55%, var(--sc-paper)) 0%, var(--sc-paper) 100%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgb(176 141 87 / 0.08), transparent 70%);
}

@media (min-width: 768px) {
  .sc-portal-hero { padding-top: 3.5rem; }
}

html.dark .sc-portal-hero {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--sc-paper-elevated) 80%, var(--sc-paper)) 0%, var(--sc-paper) 100%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgb(212 169 106 / 0.06), transparent 70%);
}

.sc-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 50% 100%, rgb(176 141 87 / 0.1), transparent 65%),
    radial-gradient(ellipse 70% 40% at 20% 30%, rgb(28 25 23 / 0.04), transparent 55%),
    radial-gradient(ellipse 60% 35% at 80% 20%, rgb(139 37 0 / 0.04), transparent 50%),
    linear-gradient(180deg, rgb(248 245 239 / 0.35) 0%, transparent 42%, rgb(248 245 239 / 0.75) 100%);
}

html.dark .sc-hero-bg {
  background:
    radial-gradient(ellipse 90% 60% at 50% 100%, rgb(212 169 106 / 0.07), transparent 65%),
    radial-gradient(ellipse 70% 40% at 20% 30%, rgb(245 240 232 / 0.03), transparent 55%),
    linear-gradient(180deg, rgb(12 10 9 / 0.25) 0%, transparent 42%, rgb(12 10 9 / 0.65) 100%);
}

.sc-hero-core {
  padding: 0 1rem 1.5rem;
}

@media (min-width: 768px) {
  .sc-hero-core { padding: 0 1.5rem 2rem; }
}

.sc-hero-discovery {
  position: relative;
  z-index: 1;
  max-width: var(--sc-page-width);
  margin: 0 auto;
  padding: 1.75rem 1rem 2.25rem;
  border-top: 1px solid color-mix(in srgb, var(--sc-border) 65%, transparent);
}

@media (min-width: 768px) {
  .sc-hero-discovery { padding: 2rem 1.5rem 2.75rem; }
}

.sc-hero-discovery-label {
  text-align: center;
  margin-bottom: 0.75rem;
}

.sc-hero-discovery .sc-hero-chips,
.sc-hero-discovery .sc-stats-bar,
.sc-hero-discovery .sc-feature-grid {
  margin-left: auto;
  margin-right: auto;
}

.sc-hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--sc-page-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.sc-hero-title {
  margin: 1rem 0 0;
  font-family: var(--sc-display-font);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--sc-ink-classical);
  line-height: 1.1;
}

.sc-hero-tagline {
  margin: 0.75rem 0 0;
  font-family: var(--sc-ui-font);
  font-size: 0.875rem;
  letter-spacing: 0.35em;
  color: var(--sc-ink-light);
}

.sc-combo-search {
  display: flex;
  width: 100%;
  max-width: var(--sc-combo-width);
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--sc-border);
  background: var(--sc-paper-elevated);
  box-shadow: var(--sc-shadow-sm);
  overflow: hidden;
}

.sc-combo-search .nav-search-type {
  border: none;
  border-right: 1px solid var(--sc-border);
  border-radius: 0;
  background: transparent;
  max-width: 5.5rem;
}

.sc-combo-search .nav-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.625rem 0.75rem;
  font-family: var(--sc-ui-font);
  font-size: 0.9375rem;
  color: var(--sc-ink-classical);
  min-width: 0;
}

.sc-combo-search .nav-search-input:focus { outline: none; }

.sc-combo-search .nav-search-submit {
  border: none;
  border-radius: 0;
  background: var(--sc-cinnabar);
  color: #fff;
  padding: 0.625rem 1.25rem;
  font-family: var(--sc-ui-font);
  font-weight: 600;
  cursor: pointer;
}

.sc-combo-search .nav-search-submit:hover { background: var(--sc-cinnabar-hover); }

.sc-hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  max-width: var(--sc-combo-width);
}

.sc-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--sc-border);
  background: var(--sc-card-bg);
  backdrop-filter: blur(8px);
  font-family: var(--sc-ui-font);
  font-size: 0.8125rem;
  color: var(--sc-ink-classical);
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}

.sc-chip:hover {
  border-color: var(--sc-cinnabar);
  color: var(--sc-cinnabar);
}

.sc-stats-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem 2.5rem;
  margin-top: 1.75rem;
  font-family: var(--sc-ui-font);
  font-size: 0.875rem;
  color: var(--sc-muted);
}

.sc-stats-bar strong {
  color: var(--sc-gold);
  font-weight: 600;
}

.sc-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  width: 100%;
  max-width: var(--sc-combo-width);
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .sc-feature-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .sc-feature-grid { grid-template-columns: repeat(4, 1fr); }
}

.sc-feature-card--ai {
  border-color: color-mix(in srgb, var(--sc-cinnabar) 35%, var(--sc-border));
}

.sc-feature-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--sc-border);
  background: var(--sc-card-bg);
  text-decoration: none;
  color: var(--sc-ink-classical);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.sc-feature-card:hover {
  border-color: var(--sc-cinnabar);
  box-shadow: var(--sc-shadow-hover);
  transform: translateY(-2px);
}

.sc-feature-card-title {
  font-family: var(--sc-ui-font);
  font-weight: 600;
  font-size: 0.9375rem;
}

.sc-feature-card-desc { font-size: 0.75rem; color: var(--sc-muted); }

.sc-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.125rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--sc-border);
  background: var(--sc-paper-elevated);
  box-shadow: var(--sc-shadow-sm);
  text-decoration: none;
  color: var(--sc-ink-classical);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.sc-card:hover {
  border-color: var(--sc-cinnabar);
  box-shadow: var(--sc-shadow-hover);
  transform: translateY(-2px);
}

.sc-card-title { font-family: var(--sc-ui-font); font-weight: 600; font-size: 1rem; }
.sc-card-meta { font-size: 0.8125rem; }
.sc-card-excerpt { font-family: var(--sc-reading-font); font-size: 0.875rem; line-height: 1.6; }

.sc-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 640px) {
  .sc-card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .sc-card-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

.sc-home-feed {
  padding-top: 2rem;
}

@media (min-width: 768px) {
  .sc-home-feed { padding-top: 2.5rem; }
}

.sc-home-section { padding: 2rem 0; }

@media (min-width: 768px) {
  .sc-home-section { padding: var(--sc-section-gap) 0; }
}

.sc-home-section--daily-band {
  padding-top: 0;
  padding-bottom: 2rem;
}

@media (min-width: 768px) {
  .sc-home-section--daily-band { padding-bottom: 2.5rem; }
}

.sc-home-daily-row {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .sc-home-daily-row:has(> :nth-child(2)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
    align-items: stretch;
  }
}

.sc-home-daily-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sc-home-daily-col .sc-section-header {
  margin-bottom: 1rem;
}

.sc-home-daily-poem {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.25rem 1.375rem;
  border-radius: calc(var(--radius-lg) * 2);
  border: 1px solid var(--sc-verse-border);
  background: linear-gradient(
    135deg,
    var(--sc-paper-elevated),
    color-mix(in srgb, var(--sc-verse-bg) 55%, var(--sc-paper))
  );
  box-shadow: var(--sc-shadow);
  border-left: 3px solid var(--sc-cinnabar);
}

.sc-home-daily-poem__media {
  margin: 0 0 0.75rem;
}

.sc-home-daily-poem__media .poem-hero-media {
  margin: 0;
}

.sc-home-daily-poem__media .poem-hero-media img {
  max-height: 140px;
}

.sc-home-daily-poem__title {
  margin: 0 0 0.25rem;
  font-family: var(--sc-ui-font);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

.sc-home-daily-poem__title a {
  color: var(--sc-ink-classical);
  text-decoration: none;
}

.sc-home-daily-poem__title a:hover {
  color: var(--sc-cinnabar);
}

.sc-home-daily-poem__meta {
  margin: 0;
  font-family: var(--sc-ui-font);
  font-size: 0.8125rem;
}

.sc-home-daily-poem__body {
  margin: 0.5rem 0 0;
  font-family: var(--sc-reading-font);
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--sc-ink);
}

.sc-home-daily-poem__body p {
  margin: 0.2rem 0;
}

.sc-home-daily-poem__intro {
  margin: 0.625rem 0 0;
  padding: 0.5rem 0.75rem;
  border-left: 2px solid color-mix(in srgb, var(--sc-gold) 65%, var(--sc-cinnabar));
  background: color-mix(in srgb, var(--sc-verse-bg) 35%, transparent);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--sc-muted);
}

.sc-home-daily-poem__action {
  margin: 0.75rem 0 0;
}

.sc-home-daily-poem__link {
  font-family: var(--sc-ui-font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sc-cinnabar);
  text-decoration: none;
}

.sc-home-daily-poem__link:hover {
  text-decoration: underline;
}

.sc-section-header--accent .sc-section-label {
  color: var(--sc-cinnabar);
}

html.dark .sc-section-header--accent .sc-section-label {
  color: var(--sc-gold);
}

.sc-section-header-link {
  font-size: 0.875rem;
  margin-left: auto;
  flex-shrink: 0;
  text-decoration: none;
}

.sc-section-header-link:hover { color: var(--sc-cinnabar); }

.sc-btn-cinnabar {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius-lg);
  background: var(--sc-cinnabar);
  color: #fff;
  font-family: var(--sc-ui-font);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.sc-btn-cinnabar:hover { background: var(--sc-cinnabar-hover); color: #fff; }

.sc-empty {
  padding: 2rem;
  border: 1px dashed var(--sc-border);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--sc-muted);
}

.prose-poetry,
.poem-detail-body.prose-poetry {
  max-width: var(--sc-measure);
  font-family: var(--sc-reading-font);
  font-size: 1.125rem;
  line-height: 1.9;
  color: var(--sc-ink);
}

.prose-poetry .poem-detail-body-line,
.prose-poetry p:not(.poem-line-ruby) {
  text-indent: 2em;
  margin: 0.5rem 0;
}
.prose-poetry .poem-line-ruby {
  text-indent: 0;
  margin: 0.65rem 0;
}


.sc-speech-active {
  border-left: 3px solid var(--sc-cinnabar);
  padding-left: 0.75rem;
  background: color-mix(in srgb, var(--sc-cinnabar) 6%, transparent);
}

.sc-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--sc-border);
  border-radius: var(--radius-lg);
  background: var(--sc-paper-elevated);
  color: var(--sc-ink-classical);
  cursor: pointer;
}

.sc-theme-toggle:hover { border-color: var(--sc-cinnabar); color: var(--sc-cinnabar); }
.sc-theme-toggle svg { width: 1.125rem; height: 1.125rem; }
html:not(.dark) .sc-theme-toggle .icon-moon { display: block; }
html:not(.dark) .sc-theme-toggle .icon-sun { display: none; }
html.dark .sc-theme-toggle .icon-moon { display: none; }
html.dark .sc-theme-toggle .icon-sun { display: block; }

.sc-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--sc-border);
  border-radius: var(--radius-lg);
  background: var(--sc-paper-elevated);
  color: var(--sc-ink-classical);
  cursor: pointer;
}

@media (max-width: 767px) {
  .sc-nav-toggle { display: inline-flex; }
  .nav.nav-primary .nav-links-desktop { display: none; }
  .site-header-tools .nav-search-form--header { display: none; }
  .site-header-inner {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }
  .nav.nav-primary {
    flex: 1;
    min-width: 0;
    gap: 0.5rem;
  }
  .site-header-tools {
    flex-shrink: 0;
    gap: 0.5rem;
  }
  .nav-github {
    font-size: 0.8125rem;
    white-space: nowrap;
  }
  .sc-mobile-drawer .sc-combo-search {
    width: 100%;
    max-width: none;
    margin-top: 0.75rem;
  }
  .sc-mobile-drawer .nav-search-input {
    min-width: 0;
    width: auto;
  }
  body.site-shell {
    overflow-x: clip;
  }

  /* 浏览页：移动端先展示列表，发现栏置底 */
  .content.content-browse .home-layout {
    display: flex;
    flex-direction: column;
  }
  .content.content-browse .home-main {
    order: 1;
  }
  .content.content-browse .home-aside {
    order: 2;
    padding: 1rem;
    border: 1px solid var(--sc-border);
    border-radius: var(--radius-lg);
    background: var(--sc-paper-elevated);
  }
  .content.content-browse .home-aside .home-chip-list {
    gap: 0.4rem 0.45rem;
  }
  a.home-chip {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
    text-align: center;
  }

  /* 诗详情：正文优先，侧栏依次后置 */
  .poem-detail-shell {
    display: flex;
    flex-direction: column;
  }
  .poem-detail-article { order: 1; }
  .poem-detail-aside-right { order: 2; }
  .poem-detail-aside-left { order: 3; }

  .poem-line-ruby {
    font-size: 1.05rem;
    line-height: 2.05;
  }
  .poem-line-ruby .py-rt {
    font-size: 0.58rem;
  }
  .poem-ruby-chunk {
    /* 按标点分句后，优先在句读处换行，避免单字成行 */
    display: inline-block;
    max-width: 100%;
    vertical-align: top;
    margin-bottom: 0.15rem;
  }

  .poem-detail-page {
    padding-bottom: calc(3.25rem + env(safe-area-inset-bottom, 0px));
  }
  .poem-detail-aside-right .reading-settings-panel {
    display: none;
  }
  .poem-reading-bar {
    display: block;
  }

  .sc-hero-title {
    letter-spacing: 0.12em;
  }
  .sc-hero-tagline {
    letter-spacing: 0.2em;
  }
}

.sc-mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgb(0 0 0 / 0.35);
}

.sc-mobile-drawer-backdrop.is-open { display: block; }

@media (min-width: 768px) {
  .sc-mobile-drawer,
  .sc-mobile-drawer-backdrop {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
  }
}

.sc-mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 50;
  width: min(18rem, 88vw);
  height: 100dvh;
  max-height: 100vh;
  padding: 1rem;
  background: var(--sc-paper-elevated);
  border-left: 1px solid var(--sc-border);
  box-shadow: -8px 0 32px rgb(0 0 0 / 0.12);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  visibility: hidden;
  pointer-events: none;
}

.sc-mobile-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.sc-mobile-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;
}

.sc-mobile-drawer nav a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-family: var(--sc-ui-font);
  font-size: 1rem;
  color: var(--sc-ink-classical);
  text-decoration: none;
}

.sc-mobile-drawer nav a.active,
.sc-mobile-drawer nav a:hover {
  background: color-mix(in srgb, var(--sc-cinnabar) 10%, transparent);
  color: var(--sc-cinnabar);
}

.sc-seasonal-banner {
  display: block;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--sc-border);
  background: var(--sc-card-bg);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.sc-seasonal-banner:hover {
  border-color: var(--sc-cinnabar);
  box-shadow: var(--sc-shadow-hover);
}

.sc-seasonal-banner-title {
  margin: 0;
  font-family: var(--sc-ui-font);
  font-size: 1.25rem;
  font-weight: 600;
}

.sc-daily-author {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 1.375rem;
  border-radius: calc(var(--radius-lg) * 2);
  border: 1px solid var(--sc-verse-border);
  background: linear-gradient(
    135deg,
    var(--sc-paper-elevated),
    color-mix(in srgb, var(--sc-verse-bg) 35%, var(--sc-paper))
  );
  box-shadow: var(--sc-shadow);
}

.sc-daily-author--featured {
  height: 100%;
}

.sc-daily-author-body {
  flex: 1;
  min-width: 0;
}

.sc-daily-author-name {
  margin: 0 0 0.25rem;
  font-family: var(--sc-ui-font);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

.sc-daily-author-name a {
  color: inherit;
  text-decoration: none;
}

.sc-daily-author-name a:hover { color: var(--sc-cinnabar); }

.sc-daily-author-bio {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.65;
}

.sc-daily-author-works {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  font-family: var(--sc-reading-font);
  font-size: 0.9375rem;
}

.sc-daily-author-works a {
  color: var(--sc-ink-classical);
  text-decoration: none;
}

.sc-daily-author-works a:hover { color: var(--sc-cinnabar); }

.sc-seasonal-banner-sub { margin: 0.35rem 0 0; }
.sc-seasonal-banner-desc { margin: 0.75rem 0 0; }
.sc-seasonal-banner-meta { margin: 0.75rem 0 0; }

.sc-daily-author-initials {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--sc-cinnabar) 12%, var(--sc-paper));
  color: var(--sc-cinnabar);
  font-family: var(--sc-ui-font);
  font-weight: 600;
  font-size: 0.875rem;
}

.sc-contribute-page { max-width: 42rem; }

.sc-about-page { max-width: 42rem; }

.sc-about-section {
  margin-top: 2rem;
}

.sc-about-heading {
  margin: 0 0 0.75rem;
  font-family: var(--sc-ui-font);
  font-size: 1.125rem;
}

.sc-about-list {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.7;
}

.sc-about-list li + li {
  margin-top: 0.5rem;
}

.sc-contribute-card {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--sc-border);
  background: var(--sc-paper-elevated);
  box-shadow: var(--sc-shadow-sm);
}

.sc-topic-hero {
  padding: 2rem 0 1rem;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--sc-gold) 8%, var(--sc-paper)), var(--sc-paper));
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.poems-list-card,
.home-topic-card,
.authors-card {
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.poems-list-card:hover,
.home-topic-card:hover,
.authors-card:hover {
  border-color: var(--sc-cinnabar);
  box-shadow: var(--sc-shadow-hover);
  transform: translateY(-2px);
}

.nav-search-submit {
  background: var(--sc-cinnabar);
  color: #fff;
  border-color: var(--sc-cinnabar);
}

.nav-search-submit:hover { background: var(--sc-cinnabar-hover); }

@media (prefers-reduced-motion: reduce) {
  .sc-card:hover,
  .sc-feature-card:hover,
  .poems-list-card:hover,
  .home-topic-card:hover,
  .authors-card:hover { transform: none; }
  .sc-mobile-drawer { transition: none; }
}

.sc-animate-in { animation: sc-fade-in 0.4s ease both; }

@keyframes sc-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .sc-animate-in { animation: none; }
}

.nav-links-desktop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.nav-links-desktop a {
  color: var(--text-90);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.25rem 0.35rem;
  border-radius: var(--radius);
  font-family: var(--sc-ui-font);
  transition: color var(--transition);
}

.nav-links-desktop a:hover { color: var(--sc-cinnabar); }
.nav-links-desktop a.active {
  font-weight: 600;
  color: var(--sc-cinnabar);
  box-shadow: inset 0 -2px 0 var(--sc-cinnabar);
}

.content.page-home {
  padding: 0;
  max-width: none;
}

.content.content-home {
  padding: 0;
  max-width: none;
}

.content.content-browse {
  width: 100%;
  max-width: var(--sc-shell-width);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

@media (min-width: 768px) {
  .content.content-browse { padding: 1.5rem 1.5rem 3rem; }
}

.content.content-browse .home-layout {
  width: 100%;
}


.sc-page-header {
  margin-bottom: 1.5rem;
}

.sc-page-header .poems-page-title,
.sc-page-header .authors-page-title {
  font-family: var(--sc-ui-font);
  color: var(--sc-ink-classical);
  font-size: 1.75rem;
  margin: 0 0 0.35rem;
}

.sc-page-header .poems-page-lead {
  font-family: var(--sc-ui-font);
  margin: 0;
}

/* ========== 统一浏览页（诗文 / 诗人 / 朝代 / 标签 / 词牌） ========== */

.sc-browse-main,
.poems-list-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: none;
  width: 100%;
  flex: 1;
  min-width: 0;
}

.sc-browse-title,
.sc-page-header .sc-browse-title {
  font-family: var(--sc-ui-font);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--sc-ink-classical);
  margin: 0 0 0.35rem;
}

.sc-browse-lead {
  margin: 0;
  font-family: var(--sc-ui-font);
  font-size: 0.95rem;
  line-height: 1.5;
}

.sc-browse-lead strong {
  color: var(--sc-gold);
  font-weight: 600;
}

.sc-filter-bar,
.poems-active-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--sc-border);
  background: var(--sc-card-bg);
  font-size: 0.875rem;
}

.sc-filter-bar-label,
.poems-active-label {
  color: var(--sc-muted);
  font-weight: 600;
}

.sc-filter-chip,
.poems-filter-chip {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--sc-border);
  background: var(--sc-paper-elevated);
  color: var(--sc-ink-classical);
  font-weight: 500;
}

.sc-filter-clear,
.poems-clear-filter {
  margin-left: auto;
  font-weight: 600;
  color: var(--sc-cinnabar);
  text-decoration: none;
}

.sc-filter-clear:hover,
.poems-clear-filter:hover { text-decoration: underline; }

.sc-browse-toolbar,
.poems-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sc-browse-toolbar .home-btn,
.poems-toolbar .home-btn {
  font-size: 0.8125rem;
  padding: 0.35rem 0.65rem;
}

.sc-browse-empty,
.poems-empty {
  padding: 1rem 0;
}

.sc-browse-empty p { margin: 0 0 0.5rem; }
.sc-browse-empty a,
.poems-empty a {
  color: var(--sc-cinnabar);
  font-weight: 600;
  text-decoration: none;
}

.sc-browse-empty a:hover,
.poems-empty a:hover { text-decoration: underline; }

.authors-grid.sc-card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
}

.authors-card {
  background: var(--sc-paper-elevated);
  box-shadow: var(--sc-shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.authors-card:hover {
  border-color: var(--sc-cinnabar);
  box-shadow: var(--sc-shadow-hover);
  transform: translateY(-2px);
  background: var(--sc-paper-elevated);
}

.logo.active {
  color: var(--sc-cinnabar);
}

@media (prefers-reduced-motion: reduce) {
  .authors-card:hover { transform: none; }
}

/* --- AI 问诗 /chat/ — 横向同 content-browse，纵向填满 header 与 footer 之间 --- */

body.site-shell:has(main.sc-chat-page) {
  min-height: 100dvh;
}

main.sc-chat-page.content-browse {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding-top: 1rem;
  padding-bottom: 0.75rem;
}

@media (min-width: 768px) {
  main.sc-chat-page.content-browse {
    padding-top: 1.25rem;
    padding-bottom: 1rem;
  }
}

.sc-chat-viewport {
  display: flex;
  flex: 1 1 auto;
  gap: 0.5rem;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .sc-chat-viewport {
    gap: 0.75rem;
  }
}

.sc-chat-sidebar {
  display: none;
  flex-direction: column;
  width: var(--sc-sidebar-width);
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--sc-radius-xl);
  background: var(--sc-paper-deep);
  box-shadow: var(--sc-shadow-sm);
}

@media (min-width: 1024px) {
  .sc-chat-sidebar {
    display: flex;
  }
}

.sc-chat-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem 1rem 0.75rem;
}

.sc-chat-brand-icon {
  display: flex;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgb(139 37 0 / 0.08);
  color: var(--sc-cinnabar);
}

.sc-chat-brand-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--sc-ink-classical);
}

.sc-chat-brand-label {
  margin: 0.125rem 0 0;
}

.sc-chat-sidebar-actions {
  padding: 0 1rem 0.75rem;
}

.sc-chat-new-btn {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 2rem;
  border: none;
  border-radius: 0.5rem;
  background: rgb(139 37 0 / 0.06);
  color: var(--sc-cinnabar);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sc-chat-new-btn:hover {
  background: rgb(139 37 0 / 0.1);
}

.sc-chat-sidebar-foot {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--sc-border);
}

.sc-chat-clear-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
}

.sc-chat-clear-btn:hover {
  color: var(--sc-cinnabar);
}

.sc-chat-history {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0.5rem;
  overflow-y: auto;
  flex: 1;
}

.sc-chat-history-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0.125rem 0;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease;
}

.sc-chat-history-item:hover {
  background: color-mix(in srgb, var(--sc-paper) 80%, transparent);
}

.sc-chat-history-btn {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 0.5rem;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
  color: var(--sc-ink);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-chat-history-btn.active {
  background: rgb(139 37 0 / 0.08);
  color: var(--sc-cinnabar);
}

html.dark .sc-chat-history-btn.active {
  background: rgb(196 74 42 / 0.15);
}

.sc-chat-history-del {
  border: none;
  background: none;
  color: var(--sc-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem 0.375rem;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.sc-chat-history-item:hover .sc-chat-history-del,
.sc-chat-history-del:focus-visible {
  opacity: 1;
}

.sc-chat-history-del:hover {
  color: var(--sc-cinnabar);
}

.sc-chat-sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgb(28 25 23 / 0.25);
  backdrop-filter: blur(6px);
}

.sc-chat-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--sc-radius-xl);
  background: var(--sc-paper);
}

.sc-chat-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgb(248 245 239 / 0.72);
  backdrop-filter: blur(12px);
}

html.dark .sc-chat-header {
  background: rgb(12 10 9 / 0.72);
}

.sc-chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.sc-chat-header-titles {
  min-width: 0;
}

.sc-chat-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--sc-muted);
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 0.375rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sc-chat-sidebar-toggle:hover {
  background: var(--sc-paper-deep);
  color: var(--sc-ink);
}

@media (min-width: 1024px) {
  .sc-chat-sidebar-toggle {
    display: none;
  }
}

.sc-chat-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--sc-ink-classical);
}

.sc-chat-subtitle {
  margin: 0.125rem 0 0;
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-chat-context-badge {
  flex-shrink: 0;
  border-radius: 9999px;
  background: rgb(139 37 0 / 0.08);
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  color: var(--sc-cinnabar);
}

html.dark .sc-chat-context-badge {
  background: rgb(196 74 42 / 0.15);
  color: var(--sc-gold);
}

.sc-chat-banner {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  background: color-mix(in srgb, var(--sc-gold) 12%, var(--sc-paper));
  border-bottom: 1px solid var(--sc-border);
}

.sc-chat-banner-actions {
  margin: 0.5rem 0 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sc-chat-banner-cta {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sc-cinnabar);
  text-decoration: none;
}

.sc-chat-banner-cta:hover {
  text-decoration: underline;
}

.share-toast--auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: min(92vw, 28rem);
}

.share-toast-cta {
  font-weight: 600;
  color: var(--sc-cinnabar);
  text-decoration: none;
  white-space: nowrap;
}

.share-toast-cta:hover {
  text-decoration: underline;
}

.sc-chat-messages-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.sc-chat-empty {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 0 1rem;
  text-align: center;
}

.sc-chat-empty-glow {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  border-radius: 9999px;
  background: var(--sc-paper-elevated);
  box-shadow: var(--sc-shadow-sm);
  color: var(--sc-cinnabar);
}

.sc-chat-empty-glow::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 9999px;
  background: radial-gradient(
    circle,
    rgb(139 37 0 / 0.12) 0%,
    rgb(176 141 87 / 0.06) 45%,
    transparent 70%
  );
  z-index: -1;
}

.sc-chat-empty-title {
  margin: 0.5rem 0 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--sc-ink-classical);
}

.sc-chat-empty-desc {
  margin: 0.5rem auto 0;
  max-width: 28rem;
  font-size: 0.875rem;
  line-height: 1.65;
}

.sc-chat-hot-grid {
  display: grid;
  gap: 0.625rem;
  margin-top: 1.75rem;
  text-align: left;
}

@media (min-width: 640px) {
  .sc-chat-hot-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sc-chat-hot-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
  padding: 0.75rem 0.875rem 0.625rem;
  border: none;
  border-radius: 0.625rem;
  background: var(--sc-paper-elevated);
  box-shadow: var(--sc-shadow-sm);
  cursor: pointer;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--sc-muted);
  text-align: left;
  transition: box-shadow 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.sc-chat-hot-card:hover {
  color: var(--sc-cinnabar);
  background: rgb(176 141 87 / 0.08);
  box-shadow: var(--sc-shadow);
}

.sc-chat-hot-cat {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--sc-gold);
}

.sc-chat-messages {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sc-chat-msg-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.sc-chat-msg-row--user {
  flex-direction: row-reverse;
}

.sc-chat-avatar {
  display: flex;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 500;
}

.sc-chat-msg-row--user .sc-chat-avatar {
  background: rgb(139 37 0 / 0.12);
  color: var(--sc-cinnabar);
}

.sc-chat-msg-row:not(.sc-chat-msg-row--user) .sc-chat-avatar {
  background: rgb(176 141 87 / 0.12);
  color: var(--sc-gold);
}

.sc-chat-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.625;
  white-space: pre-wrap;
}

.sc-chat-bubble--user {
  border-bottom-right-radius: 0.25rem;
  background: var(--sc-cinnabar);
  color: #fff;
  box-shadow: var(--sc-shadow-sm);
}

.sc-chat-bubble--assistant {
  border-bottom-left-radius: 0.25rem;
  background: var(--sc-paper-deep);
  color: var(--sc-ink-classical);
  box-shadow: var(--sc-shadow-sm);
}

html.dark .sc-chat-bubble--assistant {
  background: var(--sc-paper-elevated);
}

.sc-chat-citations {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sc-chat-citation {
  display: inline-flex;
  max-width: 100%;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  background: rgb(139 37 0 / 0.05);
  text-decoration: none;
  font-size: 0.75rem;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.sc-chat-citation:hover {
  background: rgb(139 37 0 / 0.1);
  box-shadow: var(--sc-shadow-sm);
}

html.dark .sc-chat-citation {
  background: rgb(196 74 42 / 0.1);
}

.sc-chat-citation-title {
  color: var(--sc-cinnabar);
  font-weight: 600;
}

.sc-chat-citation-snippet {
  color: var(--sc-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sc-chat-disclaimer {
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  color: var(--sc-muted);
  opacity: 0.85;
}

.sc-chat-thinking {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--sc-muted);
  font-size: 0.875rem;
}

.sc-chat-dock {
  flex-shrink: 0;
  padding: 0 1rem 1rem;
  background: linear-gradient(
    to top,
    var(--sc-paper) 0%,
    var(--sc-paper) 55%,
    transparent 100%
  );
}

.sc-chat-dock-inner {
  max-width: 48rem;
  margin: 0 auto;
}

.sc-chat-input-shell {
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--sc-paper-elevated);
  box-shadow: var(--sc-shadow-hero);
  transition: box-shadow 0.2s ease;
}

.sc-chat-input-shell:focus-within {
  box-shadow: var(--sc-shadow-hero), 0 0 0 2px rgb(139 37 0 / 0.12);
}

.sc-chat-input {
  width: 100%;
  resize: none;
  min-height: 1.5rem;
  max-height: 9rem;
  padding: 0.25rem 0;
  border: none;
  background: transparent;
  box-shadow: none;
  font-family: var(--sc-ui-font);
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--sc-ink);
}

.sc-chat-input:focus {
  outline: none;
}

.sc-chat-input-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

.sc-chat-input-hint {
  font-size: 0.6875rem;
}

.sc-chat-input-spacer {
  flex: 1;
}

@media (max-width: 480px) {
  .sc-chat-input-toolbar {
    flex-wrap: wrap;
    row-gap: 0.375rem;
  }

  .sc-chat-input-spacer {
    flex-basis: 100%;
    height: 0;
  }
}

.sc-chat-send,
.sc-chat-stop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  padding: 0 0.75rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.sc-chat-send {
  background: var(--sc-cinnabar);
  color: #fff;
}

.sc-chat-send:hover:not(:disabled) {
  background: var(--sc-cinnabar-hover);
}

.sc-chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sc-chat-stop {
  background: transparent;
  color: #b91c1c;
}

.sc-chat-stop:hover {
  background: rgb(185 28 28 / 0.08);
}

.sc-chat-dock-note {
  margin: 0.5rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  opacity: 0.8;
}

.poem-aside-chat-desc {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
}

.poem-aside-chat-link {
  display: inline-block;
  width: 100%;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 1023px) {
  .sc-chat-sidebar {
    display: flex;
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    bottom: 0.5rem;
    z-index: 40;
    width: min(var(--sc-sidebar-width), calc(100vw - 1rem));
    transform: translateX(calc(-100% - 1rem));
    transition: transform 0.2s ease;
    box-shadow: var(--sc-shadow-hover);
  }

  .sc-chat-sidebar.open {
    transform: translateX(0);
  }
}

@media (min-width: 1024px) {
  .sc-chat-sidebar-overlay {
    display: none !important;
  }
}


/* Email auth pages */
.sc-auth-page { max-width: 28rem; margin: 0 auto; }
.sc-auth-form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.sc-auth-field { display: grid; gap: 0.35rem; }
.sc-auth-field label { font-size: 0.875rem; font-weight: 500; }
.sc-auth-field input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--sc-border, #d8d0c4);
  border-radius: 0.5rem;
  background: var(--sc-surface, #fff);
  color: inherit;
  font: inherit;
}
.sc-auth-submit { width: 100%; justify-content: center; margin-top: 0.25rem; }
.sc-auth-foot { margin-top: 1rem; font-size: 0.875rem; }
.sc-auth-error { color: #b42318; font-size: 0.875rem; margin: 0; }
.sc-auth-banner { padding: 0.75rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; margin: 0 0 1rem; }
.sc-auth-banner--ok { background: #ecfdf3; color: #027a48; }
.sc-auth-banner--warn { background: #fffaeb; color: #b54708; }
.sc-auth-card { margin-top: 1rem; padding: 1rem; border: 1px solid var(--sc-border, #e8e2d8); border-radius: 0.75rem; }
.sc-auth-dl { margin: 0; display: grid; gap: 0.75rem; }
.sc-auth-dl div { display: grid; grid-template-columns: 5rem 1fr; gap: 0.5rem; font-size: 0.9375rem; }
.sc-auth-dl dt { color: var(--sc-muted, #6b645a); margin: 0; }
.sc-auth-dl dd { margin: 0; word-break: break-all; }
.sc-auth-logout-btn {
  border: 1px solid var(--sc-border, #d8d0c4);
  background: transparent;
  color: inherit;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
}
.nav-auth-login, .nav-auth-account {
  font-size: 0.875rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--sc-border, #d8d0c4);
  text-decoration: none;
  white-space: nowrap;
}
.nav-auth-unverified::after { content: " ·"; color: #b54708; }
.hidden { display: none !important; }

/* 账号中心（宽版） @author daichangya@163.com */
.sc-account-page {
  max-width: var(--sc-page-width);
  margin: 0 auto;
}

.sc-account-hero {
  margin-top: 0.5rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--sc-gold) 10%, var(--sc-paper)),
    color-mix(in srgb, var(--sc-cinnabar) 6%, var(--sc-paper))
  );
  border: 1px solid var(--sc-border);
}

.sc-account-hero-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.sc-account-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  font-family: var(--sc-ui-font);
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(145deg, var(--sc-cinnabar), color-mix(in srgb, var(--sc-cinnabar) 70%, var(--sc-gold)));
  box-shadow: var(--sc-shadow-sm);
}

.sc-account-name {
  margin: 0.25rem 0 0;
  font-family: var(--sc-ui-font);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.sc-account-email {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.9375rem;
  word-break: break-all;
}

.sc-account-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.sc-account-badge--ok {
  background: #ecfdf3;
  color: #027a48;
  border: 1px solid color-mix(in srgb, #027a48 20%, transparent);
}

.sc-account-badge--warn {
  background: #fffaeb;
  color: #b54708;
  border: 1px solid color-mix(in srgb, #b54708 20%, transparent);
}

html.dark .sc-account-badge--ok {
  background: color-mix(in srgb, #027a48 18%, transparent);
  color: #6ce9a6;
}

html.dark .sc-account-badge--warn {
  background: color-mix(in srgb, #b54708 18%, transparent);
  color: #fec84b;
}

.sc-account-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-top: 1.5rem;
  padding: 0.75rem 0;
  font-family: var(--sc-ui-font);
  font-size: 0.875rem;
  color: var(--sc-muted);
}

.sc-account-stats strong {
  color: var(--sc-gold);
  font-weight: 600;
  font-size: 1.05rem;
}

.sc-account-layout {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

@media (min-width: 900px) {
  .sc-account-layout {
    grid-template-columns: minmax(0, 1fr) 20rem;
    align-items: start;
  }
}

.sc-account-section-title,
.sc-account-panel-title {
  margin: 0;
  font-family: var(--sc-ui-font);
  font-size: 1.0625rem;
  font-weight: 600;
}

.sc-account-section-head {
  margin-bottom: 1rem;
}

.sc-account-panel {
  padding: 1.125rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--sc-border);
  background: var(--sc-card-bg);
  backdrop-filter: blur(8px);
}

.sc-account-aside {
  display: grid;
  gap: 1rem;
}

.sc-account-panel--emphasis {
  border-color: color-mix(in srgb, var(--sc-cinnabar) 35%, var(--sc-border));
  background: color-mix(in srgb, var(--sc-cinnabar) 4%, var(--sc-card-bg));
}

.sc-account-panel--chat {
  border-color: color-mix(in srgb, var(--sc-cinnabar) 25%, var(--sc-border));
}

.sc-account-panel-btn {
  display: inline-flex;
  margin-top: 0.875rem;
  text-decoration: none;
}

.sc-account-panel p.muted {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.55;
}

.sc-account-panel p.muted:first-of-type {
  margin-top: 0.65rem;
}

.sc-account-chat-count {
  margin: 0.75rem 0 0;
  font-family: var(--sc-ui-font);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--sc-gold);
}

.sc-account-chat-desc {
  margin: 0.35rem 0 0 !important;
}

.sc-account-verify-link {
  margin-top: 0.5rem !important;
  font-size: 0.8125rem !important;
}

.account-fav-grid {
  list-style: none;
  margin: 0;
  padding: 0;
}

.account-fav-grid > li {
  position: relative;
  list-style: none;
}

.account-fav-grid.sc-card-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .account-fav-grid.sc-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.account-fav-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.125rem;
  min-height: 6.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--sc-border);
  background: var(--sc-card-bg);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.account-fav-card:hover {
  border-color: var(--sc-cinnabar);
  box-shadow: var(--sc-shadow-hover);
  transform: translateY(-2px);
}

.account-fav-card-title {
  font-family: var(--sc-ui-font);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.35;
  padding-right: 1.75rem;
}

.account-fav-card-meta {
  font-size: 0.8125rem;
  color: var(--sc-muted);
}

.account-fav-card-excerpt {
  font-family: var(--sc-reading-font);
  font-size: 0.875rem;
  color: var(--sc-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.account-fav-card-remove {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--sc-border);
  border-radius: 50%;
  background: var(--sc-paper-elevated);
  color: var(--sc-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.account-fav-card-remove:hover {
  color: #b42318;
  border-color: #b42318;
}

.account-reading-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.account-reading-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--sc-border);
  background: var(--sc-paper-elevated);
  font-family: var(--sc-ui-font);
  font-size: 0.8125rem;
  color: var(--sc-ink-classical);
}

.account-reading-chip--loading {
  border-style: dashed;
}

.account-reading-hint {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.sc-account-empty {
  margin-top: 1rem;
  padding: 2rem 1.5rem;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--sc-border);
  background: color-mix(in srgb, var(--sc-gold) 4%, var(--sc-paper));
}

.sc-account-empty-title {
  margin: 0;
  font-family: var(--sc-ui-font);
  font-weight: 600;
  font-size: 1.0625rem;
}

.sc-account-empty-cta {
  display: inline-flex;
  margin-top: 1rem;
  text-decoration: none;
}

.sc-account-loading {
  margin: 0.5rem 0 0;
}

.sc-account-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--sc-border);
}

.sc-account-logout-btn {
  border: 1px solid var(--sc-border);
  background: transparent;
  color: var(--sc-muted);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.sc-account-logout-btn:hover {
  color: #b42318;
  border-color: #b42318;
}

.sc-account-back {
  font-size: 0.9375rem;
  color: var(--sc-muted);
  text-decoration: none;
}

.sc-account-back:hover {
  color: var(--sc-cinnabar);
}

@media (prefers-reduced-motion: reduce) {
  .account-fav-card:hover {
    transform: none;
  }
}

/* 诗页收藏（Phase 2） @author daichangya@163.com */
.poem-detail-actions { margin: 0.5rem 0 0; }
.poem-favorite-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--sc-border, #d8d0c4);
  border-radius: 999px;
  background: var(--sc-surface, #fff);
  color: var(--sc-text, #2c2416);
  font-size: 0.875rem;
  cursor: pointer;
}
.poem-favorite-btn.is-favorited {
  border-color: #c9a227;
  color: #9a7b0a;
}
.poem-favorite-btn:disabled { opacity: 0.6; cursor: wait; }

