/* ==========================================================================
   里番动漫观看 · 全站样式表
   分组：base / layout / components / pages / responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   base — 变量与基础排版
   -------------------------------------------------------------------------- */
:root {
  --bg-page: #f5f6fa;
  --bg-surface: #ffffff;
  --brand: #4b56d2;
  --brand-soft: #eceefb;
  --brand-deep: #3b45b8;
  --accent: #ef7a45;
  --text-main: #1b1e27;
  --text-sub: #5b6272;
  --text-mute: #8a90a0;
  --line: #e6e8f0;
  --line-card: #e2e5ef;
  --radius-s: 4px;
  --radius-m: 6px;
  --radius-l: 8px;
  --shadow-card: 0 1px 2px rgba(27, 30, 39, .04);
  --shadow-hover: 0 6px 16px rgba(27, 30, 39, .08);
  --container: 1080px;
  --reading: 760px;
  --pad-x: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-main);
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color .18s ease;
}

a:hover {
  color: var(--brand-deep);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

time {
  font-style: normal;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   layout — 全站骨架：页头 / 主容器 / 内页外壳 / 页脚
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.brand:hover {
  color: var(--brand);
}

.primary-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  display: block;
  padding: 8px 12px;
  min-height: 40px;
  line-height: 24px;
  font-size: 15px;
  color: var(--text-sub);
  border-radius: var(--radius-m);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.nav-link.is-current {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--bg-surface);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-main);
}

.site-main {
  display: block;
}

.home-main,
.inner-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.inner-main {
  padding-top: 20px;
  padding-bottom: 40px;
}

.page-header {
  margin: 0 0 12px;
}

.page-title {
  font-size: 30px;
  line-height: 1.3;
  color: var(--text-main);
}

.page-head {
  margin: 0 0 20px;
}

.page-lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-sub);
  max-width: var(--reading);
}

.page-meta,
.page-head-desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-mute);
}

.page-head-desc {
  max-width: var(--reading);
  font-size: 15px;
  color: var(--text-sub);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-mute);
}

.breadcrumb a {
  color: var(--text-sub);
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb-sep {
  color: var(--text-mute);
}

.breadcrumb-current {
  color: var(--text-mute);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* 内页两栏外壳：默认主内容在前、侧栏在后 */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 28px;
  align-items: start;
  margin-bottom: 40px;
}

/* 侧栏在前的内页外壳：布局容器自身带 .sidebar-left */
.page-layout.sidebar-left {
  grid-template-columns: 268px minmax(0, 1fr);
  max-width: var(--container);
  margin: 0 auto 40px;
  padding: 0 var(--pad-x);
}

/* 祖先节点带 .sidebar-left 时的内页外壳 */
.sidebar-left .page-layout {
  grid-template-columns: 268px minmax(0, 1fr);
}

.content-main,
.content-column,
.content-col,
.page-content {
  min-width: 0;
}

/* 页脚 */
.site-footer {
  margin-top: 8px;
  background: var(--bg-surface);
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px var(--pad-x) 24px;
}

.footer-brand {
  margin-bottom: 20px;
}

.footer-logo {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
}

.footer-slogan {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-sub);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.footer-col-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.footer-col li + li {
  margin-top: 6px;
}

.footer-col a {
  display: inline-block;
  padding: 2px 0;
  font-size: 14px;
  color: var(--text-sub);
}

.footer-col a:hover {
  color: var(--brand);
}

.footer-note {
  margin-top: 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-mute);
}

.footer-copy {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-mute);
}

/* --------------------------------------------------------------------------
   components — 通用组件
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-m);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-deep);
  color: #fff;
}

.btn-ghost {
  background: var(--bg-surface);
  border-color: var(--line-card);
  color: var(--brand);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 20px;
}

.section-more {
  flex: 0 0 auto;
  font-size: 14px;
  color: var(--brand);
}

.section-more:hover {
  color: var(--brand-deep);
}

.section-title {
  font-size: 20px;
  margin-bottom: 8px;
}

.section-intro,
.section-desc {
  max-width: var(--reading);
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--text-sub);
}

.section-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-sub);
}

.tag,
.genre-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-s);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  line-height: 1.6;
  white-space: nowrap;
}

.tree-list,
.genre-tree {
  display: block;
}

.tree-list li + li,
.genre-tree li + li {
  margin-top: 2px;
}

.tree-link,
.genre-tree a {
  display: block;
  padding: 9px 12px;
  min-height: 40px;
  line-height: 22px;
  font-size: 15px;
  color: var(--text-sub);
  border-radius: var(--radius-m);
}

.tree-link:hover,
.genre-tree a:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.genre-tree a.is-current {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.side-block,
.sidebar,
.side-panel,
.genre-aside,
.genre-sidebar {
  min-width: 0;
}

.side-block + .side-block,
.sidebar-block + .sidebar-block {
  margin-top: 20px;
}

.side-title,
.sidebar-title,
.side-panel-title,
.aside-title {
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.side-note,
.sidebar-note,
.side-cta,
.sidebar-block {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-sub);
}

.side-note-link,
.side-cta-link,
.sidebar-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 14px;
}

.sidebar-note-text {
  font-size: 14px;
  color: var(--text-sub);
}

.aside-note {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-mute);
}

.aside-note a {
  margin-right: 8px;
}

.aside-details {
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
  background: var(--bg-surface);
  overflow: hidden;
}

.aside-summary {
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.aside-summary::-webkit-details-marker {
  display: none;
}

.aside-summary::after {
  content: "＋";
  float: right;
  color: var(--text-mute);
  font-weight: 400;
}

.aside-details[open] .aside-summary::after {
  content: "－";
}

.aside-details .genre-tree {
  padding: 0 8px 10px;
}

.update-list {
  display: block;
}

.update-row,
.update-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}

.update-row:last-child,
.update-item:last-child {
  border-bottom: 0;
}

.update-thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-s);
  object-fit: cover;
  background: var(--brand-soft);
}

.update-body {
  flex: 1 1 auto;
  min-width: 0;
}

.update-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-note {
  font-size: 13px;
  color: var(--text-mute);
}

.update-date,
.update-time {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--text-mute);
}

.update-row .tag-genre {
  flex: 0 0 auto;
}

.related-links {
  margin-top: 32px;
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.related-title {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.related-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.related-list a,
.related-link {
  display: block;
  padding: 12px 14px;
  min-height: 44px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-m);
  font-size: 14px;
  color: var(--text-sub);
  background: var(--bg-page);
}

.related-list a:hover,
.related-link:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.chapter-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.chapter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-m);
  background: var(--bg-page);
  font-size: 14px;
  color: var(--text-sub);
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}

.chapter-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.chapter-btn-center {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.chapter-btn-center:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}

.chapter-hint {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-sub);
  text-align: center;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 70;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-card);
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--brand);
  font-size: 18px;
  line-height: 1;
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  border-color: var(--brand);
}

.mobile-taskbar,
.mobile-task-nav {
  display: none;
}

.figure-media,
.section-media,
.page-figure,
.block-figure,
.notes-figure,
.component-figure {
  margin: 0 0 20px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
  overflow: hidden;
}

.figure-media img,
.section-media img,
.page-figure img,
.block-figure img,
.notes-figure img,
.component-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.figure-media figcaption,
.section-media figcaption,
.page-figure figcaption,
.block-figure figcaption,
.notes-figure figcaption,
.component-figure figcaption {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-mute);
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   pages — 首页
   -------------------------------------------------------------------------- */
.hero {
  padding: 32px 0 24px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 32px;
  align-items: center;
}

.hero-copy {
  min-width: 0;
}

.hero-eyebrow {
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--brand);
}

.hero-copy h1 {
  font-size: 30px;
  line-height: 1.3;
}

.hero-lead {
  margin-top: 12px;
  max-width: 560px;
  font-size: 16px;
  color: var(--text-sub);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-mute);
}

.hero-meta li {
  position: relative;
  padding-left: 14px;
}

.hero-meta li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-figure {
  margin: 0;
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--line-card);
  background: var(--bg-surface);
}

.hero-figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.latest-strip {
  padding: 24px 0 8px;
}

.latest-strip .update-list {
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
  padding: 4px 16px;
}

.genre-wall {
  padding: 28px 0 8px;
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.genre-card {
  display: block;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
  color: var(--text-main);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.genre-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-hover);
  color: var(--text-main);
}

.genre-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-m);
  background: var(--brand-soft);
}

.genre-name {
  margin-top: 12px;
  font-size: 17px;
}

.genre-desc {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-sub);
}

.home-layout {
  padding: 28px 0 8px;
}

.qa-main {
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
  padding: 20px;
}

.qa-list {
  display: block;
}

.qa-item {
  border-bottom: 1px solid var(--line);
}

.qa-item:last-child {
  border-bottom: 0;
}

.qa-question {
  display: block;
  width: 100%;
  padding: 14px 0;
  min-height: 44px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.qa-question::after {
  content: "＋";
  float: right;
  color: var(--text-mute);
  font-weight: 400;
}

.qa-question[aria-expanded="true"]::after {
  content: "－";
}

.qa-question:hover {
  color: var(--brand);
}

.qa-answer {
  padding: 0 0 14px;
}

.qa-answer p {
  font-size: 15px;
  color: var(--text-sub);
}

.sidebar {
  min-width: 0;
}

.sidebar .side-block {
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.sidebar .side-block + .side-block {
  margin-top: 16px;
}

.side-note {
  margin-top: 0;
}

.reading-teaser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin: 28px 0;
  padding: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.reading-copy h2 {
  font-size: 20px;
}

.reading-copy p {
  margin-top: 10px;
  font-size: 15px;
  color: var(--text-sub);
}

.link-inline {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
}

.notes-summary {
  padding: 8px 0 32px;
}

.notes-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.notes-item {
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.notes-name {
  font-size: 16px;
  margin-bottom: 8px;
}

.notes-item p {
  font-size: 14px;
  color: var(--text-sub);
}

/* --------------------------------------------------------------------------
   pages — 最近更新
   -------------------------------------------------------------------------- */
.update-timeline {
  margin-bottom: 32px;
}

.timeline-group + .timeline-group {
  margin-top: 24px;
}

.timeline-group .timeline-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.timeline-group .update-list {
  margin-top: 4px;
}

.genre-locate {
  margin-bottom: 8px;
}

.genre-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.genre-tag-list li {
  display: block;
}

.genre-tag-link {
  display: inline-block;
  padding: 8px 14px;
  min-height: 40px;
  line-height: 22px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-m);
  background: var(--bg-surface);
  font-size: 14px;
  color: var(--text-sub);
}

.genre-tag-link:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* --------------------------------------------------------------------------
   pages — 题材分类
   -------------------------------------------------------------------------- */
.genre-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.genre-card-link {
  display: block;
  height: 100%;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
  color: var(--text-main);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.genre-card-link:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-hover);
  color: var(--text-main);
}

.genre-card-media {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-m);
  background: var(--brand-soft);
}

.genre-card-name {
  margin-top: 12px;
  font-size: 17px;
}

.genre-card-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-sub);
}

.genre-scope-item {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.genre-scope-item:last-child {
  border-bottom: 0;
}

.genre-scope-name {
  font-size: 17px;
  margin-bottom: 8px;
}

.genre-scope-text {
  font-size: 15px;
  color: var(--text-sub);
}

.genre-scope-link {
  margin-top: 10px;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   pages — 阅读顺序
   -------------------------------------------------------------------------- */
.section-block {
  margin-bottom: 32px;
}

.component-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.component-item {
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.component-name {
  font-size: 16px;
  margin-bottom: 8px;
}

.component-desc {
  font-size: 14px;
  color: var(--text-sub);
}

.rule-list {
  display: block;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.rule-item:last-child {
  border-bottom: 0;
}

.rule-index {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  line-height: 26px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.rule-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  color: var(--text-sub);
}

.switch-tips {
  margin-top: 20px;
  padding: 16px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.switch-tips-title {
  font-size: 15px;
  margin-bottom: 6px;
}

.switch-tips-text {
  font-size: 14px;
  color: var(--text-sub);
}

/* --------------------------------------------------------------------------
   pages — 常见问题
   -------------------------------------------------------------------------- */
.faq-group {
  margin-bottom: 28px;
}

.faq-group h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.group-intro {
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--text-sub);
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.faq-item + .faq-item {
  margin-top: 10px;
}

.faq-question {
  padding: 14px 16px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "＋";
  float: right;
  color: var(--text-mute);
  font-weight: 400;
}

.faq-item[open] .faq-question::after {
  content: "－";
}

.faq-question:hover {
  color: var(--brand);
}

.faq-answer {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.faq-answer p {
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-sub);
}

.faq-more {
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   pages — 内容规则
   -------------------------------------------------------------------------- */
.content-block {
  margin-bottom: 32px;
}

.content-block h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.block-lead {
  margin-bottom: 16px;
  font-size: 15px;
  color: var(--text-sub);
}

.content-block .rule-item {
  display: block;
  padding: 16px 0;
}

.content-block .rule-item h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.content-block .rule-item p {
  font-size: 14px;
  color: var(--text-sub);
}

.order-explain {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.order-explain:last-child {
  border-bottom: 0;
}

.order-explain h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.order-explain p {
  font-size: 14px;
  color: var(--text-sub);
}

.order-sample {
  display: block;
  margin-top: 12px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.order-sample-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--line);
}

.order-sample-row:last-child {
  border-bottom: 0;
}

.sample-thumb {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-s);
  object-fit: cover;
  background: var(--brand-soft);
}

.sample-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  color: var(--text-main);
}

.sample-tag {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: var(--radius-s);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
}

.sample-date {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--text-mute);
}

.sample-hint {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-mute);
  background: var(--bg-page);
}

.tip-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tip-item {
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.tip-item h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.tip-item p {
  font-size: 14px;
  color: var(--text-sub);
}

.tip-example {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--brand-soft);
  border-radius: var(--radius-l);
  font-size: 14px;
  color: var(--brand-deep);
}

/* --------------------------------------------------------------------------
   pages — 纠错反馈
   -------------------------------------------------------------------------- */
.feedback-type-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feedback-type-item {
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.feedback-type-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.feedback-type-desc {
  font-size: 14px;
  color: var(--text-sub);
}

.feedback-info-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feedback-info-item {
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.feedback-info-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.feedback-info-desc {
  font-size: 14px;
  color: var(--text-sub);
}

.process-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  counter-reset: step;
}

.process-step {
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.process-step-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.process-step-title::before {
  counter-increment: step;
  content: counter(step) ". ";
  color: var(--brand);
}

.process-step-desc {
  font-size: 14px;
  color: var(--text-sub);
}

/* --------------------------------------------------------------------------
   pages — 404
   -------------------------------------------------------------------------- */
.error-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px var(--pad-x);
}

.error-panel {
  max-width: 560px;
  padding: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--line-card);
  border-radius: var(--radius-l);
}

.error-title {
  font-size: 30px;
  line-height: 1.3;
  margin-bottom: 12px;
}

.error-text {
  font-size: 16px;
  color: var(--text-sub);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.error-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid var(--line-card);
  border-radius: var(--radius-m);
  background: var(--bg-surface);
  font-size: 15px;
  color: var(--text-sub);
}

.error-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.error-btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.error-btn-primary:hover {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #fff;
}

/* --------------------------------------------------------------------------
   responsive — 1024px 断点
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
  }

  .page-layout {
    grid-template-columns: minmax(0, 1fr) 232px;
    gap: 22px;
  }

  .page-layout.sidebar-left,
  .sidebar-left .page-layout {
    grid-template-columns: 232px minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------------------
   responsive — 768px 断点
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --pad-x: 16px;
  }

  body {
    padding-bottom: 60px;
  }

  .header-inner {
    min-height: 56px;
    gap: 10px;
  }

  .nav-toggle {
    display: flex;
  }

  .primary-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-left: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-card);
  }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px var(--pad-x) 12px;
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-link {
    padding: 12px 10px;
    min-height: 48px;
    line-height: 24px;
    font-size: 16px;
  }

  .hero {
    padding: 20px 0 12px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .hero-copy h1,
  .page-title,
  .error-title {
    font-size: 24px;
    line-height: 1.35;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .hero-figure {
    order: -1;
  }

  .latest-strip,
  .genre-wall,
  .home-layout,
  .notes-summary {
    padding-top: 20px;
  }

  .latest-strip .update-list {
    padding: 2px 12px;
  }

  .update-row,
  .update-item {
    flex-wrap: wrap;
    gap: 8px 10px;
  }

  .update-body {
    flex: 1 1 160px;
  }

  .update-row .tag-genre {
    order: 3;
  }

  .update-date,
  .update-time {
    order: 4;
    margin-left: auto;
  }

  .genre-grid,
  .genre-card-grid,
  .notes-list,
  .component-list,
  .process-list,
  .tip-list,
  .feedback-type-list,
  .feedback-info-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .genre-grid,
  .genre-card-grid,
  .notes-list {
    gap: 12px;
  }

  .reading-teaser {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }

  .related-list {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 内页外壳：单列，正文在前，侧栏折叠到正文之后 */
  .page-layout,
  .page-layout.sidebar-left,
  .sidebar-left .page-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .page-layout.sidebar-left {
    padding-left: var(--pad-x);
    padding-right: var(--pad-x);
  }

  .sidebar-left .genre-aside,
  .sidebar-left .sidebar,
  .sidebar-left .side-panel,
  .sidebar-left .genre-sidebar,
  .page-layout.sidebar-left .genre-aside,
  .page-layout.sidebar-left .sidebar,
  .page-layout.sidebar-left .side-panel,
  .page-layout.sidebar-left .genre-sidebar {
    order: 2;
  }

  .sidebar-left .content-main,
  .sidebar-left .content-column,
  .sidebar-left .content-col,
  .sidebar-left .page-content,
  .page-layout.sidebar-left .content-main,
  .page-layout.sidebar-left .content-column,
  .page-layout.sidebar-left .content-col,
  .page-layout.sidebar-left .page-content {
    order: 1;
  }

  .sidebar-left .aside-details,
  .page-layout.sidebar-left .aside-details {
    display: block;
  }

  .chapter-nav {
    flex-wrap: wrap;
    gap: 10px;
  }

  .chapter-btn {
    flex: 1 1 30%;
    min-width: 0;
    padding: 10px 8px;
  }

  .footer-inner {
    padding: 24px var(--pad-x) 20px;
  }

  .footer-nav {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  /* 移动端底部任务导航 */
  .mobile-taskbar,
  .mobile-task-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    background: var(--bg-surface);
    border-top: 1px solid var(--line);
    padding: 0 4px;
    min-height: 56px;
  }

  .mobile-task-list {
    display: contents;
  }

  .task-link,
  .taskbar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 6px 4px;
    font-size: 13px;
    color: var(--text-sub);
    text-align: center;
  }

  .task-link.is-current,
  .taskbar-link.is-current {
    color: var(--brand);
    font-weight: 600;
  }

  .back-to-top {
    right: 14px;
    bottom: 70px;
  }

  .error-main {
    padding: 40px var(--pad-x);
  }

  .error-panel {
    padding: 24px 20px;
  }
}

/* --------------------------------------------------------------------------
   responsive — 390px 断点
   -------------------------------------------------------------------------- */
@media (max-width: 390px) {
  .brand {
    font-size: 16px;
  }

  .hero-copy h1,
  .page-title,
  .error-title {
    font-size: 22px;
  }

  .section-head h2,
  .section-title,
  .content-block h2,
  .faq-group h2,
  .reading-copy h2 {
    font-size: 18px;
  }

  .update-thumb {
    width: 40px;
    height: 40px;
  }
}

/* 程序验收反馈：移动端正文优先 */
@media (max-width: 768px) {
  .site-main :is(.page-content, .main-content, .content-main) {
    order: 1;
  }

  .site-main :is(aside, .sidebar) {
    order: 2;
  }
}
