/* ==========================================================================
   日韩午夜电影 zzgjg.com — 全站样式表
   分组：base / layout / components / pages / responsive
   ========================================================================== */

/* ==========================================================================
   1. base — 变量、重置、排版、通用元素
   ========================================================================== */

:root {
  --bg-page: #f7f8fa;
  --bg-surface: #ffffff;
  --bg-soft: #eef2f7;
  --bg-accent: #fdf1e8;
  --text-main: #1f2733;
  --text-sub: #5b6673;
  --line: #e2e6ec;
  --line-strong: #ccd3dc;
  --accent: #c2571a;
  --accent-deep: #9c4413;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow-soft: 0 1px 2px rgba(31, 39, 51, 0.05);
  --font-sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Courier New", monospace;
  --wrap: 1120px;
  --wrap-pad: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-main);
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease;
}

a:hover,
a:focus-visible {
  color: var(--accent-deep);
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

caption {
  text-align: left;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

time,
.mono,
.cell-code,
.step-index,
.step-no,
.log-date,
.revision-date,
.fact-key,
.month-tag,
.notice-tag,
.meta-label,
.field-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.visually-caption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   2. layout — 页面骨架：body、页头、导航、主容器、页脚
   ========================================================================== */

.site-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--bg-page);
}

/* --- 页头 --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 0 var(--wrap-pad);
  min-height: 64px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--text-main);
  text-decoration: none;
  padding: 10px 0;
}

.brand:hover,
.brand:focus-visible {
  text-decoration: none;
  color: var(--text-main);
}

.brand-mark {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--text-main);
}

.brand-note {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
}

/* --- 导航 --- */

.site-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  display: block;
}

.nav-link {
  display: inline-block;
  padding: 20px 12px;
  font-size: 15px;
  color: var(--text-sub);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text-main);
  text-decoration: none;
}

.nav-link.is-current {
  color: var(--text-main);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--text-main);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* --- 主容器 --- */

.site-main {
  flex: 1 1 auto;
  width: 100%;
}

.home-main,
.inner-main {
  display: block;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--wrap-pad);
}

/* --- 页脚 --- */

.site-footer {
  margin-top: 56px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--line);
  color: var(--text-sub);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(140px, 1fr)) minmax(180px, 1.2fr);
  gap: 32px 28px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 44px var(--wrap-pad) 32px;
}

.footer-brand-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.footer-brand-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-sub);
}

.footer-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-list a {
  font-size: 14px;
  color: var(--text-sub);
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--accent);
}

.footer-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-sub);
}

.footer-bottom {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px var(--wrap-pad) 28px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-sub);
}

/* ==========================================================================
   3. components — 通用组件
   ========================================================================== */

/* --- 按钮 --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
  text-decoration: none;
}

.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #ffffff;
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--line-strong);
  color: var(--text-main);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- 区块通用 --- */

.section {
  padding: 44px 0;
  border-bottom: 1px solid var(--line);
}

.section:last-of-type {
  border-bottom: 0;
}

.section-head {
  margin-bottom: 24px;
}

.section-title {
  font-size: 24px;
  margin-bottom: 10px;
}

.section-desc {
  font-size: 15px;
  color: var(--text-sub);
  max-width: 780px;
}

.section-lead {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 18px;
  max-width: 820px;
}

.section-text {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 18px;
  max-width: 820px;
}

.section-note,
.section-foot {
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-sub);
}

.section-note a,
.section-foot a {
  margin-right: 16px;
}

.sub-title {
  font-size: 18px;
  margin-bottom: 14px;
}

.subsection-title {
  font-size: 17px;
  margin-bottom: 12px;
}

.inline-link {
  font-size: 14px;
  font-weight: 600;
}

/* --- 表格 --- */

.table-caption {
  font-size: 13px;
  color: var(--text-sub);
  padding-bottom: 10px;
}

.data-table,
.channel-table,
.field-table {
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table th,
.data-table td,
.channel-table th,
.channel-table td,
.field-table th,
.field-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  font-size: 15px;
  border-bottom: 1px solid var(--line);
}

.data-table thead th,
.channel-table thead th,
.field-table thead th {
  background-color: var(--bg-soft);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td,
.channel-table tbody tr:last-child th,
.channel-table tbody tr:last-child td,
.field-table tbody tr:last-child th,
.field-table tbody tr:last-child td {
  border-bottom: 0;
}

.channel-table tbody tr:hover,
.data-table tbody tr:hover,
.field-table tbody tr:hover {
  background-color: var(--bg-accent);
}

.cell-code {
  color: var(--text-sub);
  white-space: nowrap;
  width: 96px;
}

.mono {
  color: var(--text-sub);
  white-space: nowrap;
  font-weight: 600;
}

.field-table .field-name,
.map-table .field-name {
  width: 170px;
  font-weight: 600;
  color: var(--text-main);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

/* --- 图片容器 --- */

.hero-figure,
.card-media,
.collection-cover,
.media-figure,
.section-media,
.section-figure,
.guide-figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background-color: var(--bg-soft);
}

.hero-figure img,
.card-media img,
.collection-cover img,
.media-figure img,
.section-media img,
.section-figure img,
.guide-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-caption,
.hero-figure figcaption,
.section-figure figcaption,
.guide-figure figcaption {
  padding: 10px 2px 0;
  font-size: 13px;
  color: var(--text-sub);
}

/* --- 边界清单 --- */

.boundary-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.boundary-item,
.boundary-list li {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  color: var(--text-sub);
  line-height: 1.7;
}

.boundary-item::before,
.boundary-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
}

.boundary-include .boundary-list li::before,
.boundary-in .boundary-list li::before {
  background-color: var(--accent);
}

.boundary-exclude .boundary-list li::before,
.boundary-out .boundary-list li::before {
  background-color: var(--line-strong);
}

.boundary-cols,
.boundary-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 24px;
}

.boundary-col {
  min-width: 0;
  padding: 20px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* --- 步骤条 --- */

.step-list {
  display: grid;
  gap: 16px;
}

.step-item {
  min-width: 0;
  padding: 18px 20px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.step-index {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}

.step-name,
.step-title {
  font-size: 17px;
  margin-bottom: 8px;
}

.step-text {
  font-size: 15px;
  color: var(--text-sub);
}

.step-entry {
  margin-top: 10px;
  font-size: 14px;
}

.step-need {
  font-size: 15px;
  color: var(--text-sub);
}

.step-no {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}

/* --- FAQ --- */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 20px;
}

.faq-question {
  position: relative;
  padding: 16px 32px 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 24px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-sub);
  border-bottom: 2px solid var(--text-sub);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
  transform: rotate(-135deg);
}

.faq-answer {
  padding: 14px 0 18px;
  font-size: 15px;
  color: var(--text-sub);
  border-top: 1px solid var(--line);
}

/* --- 月度记录 / 修订列表 --- */

.log-groups {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.log-group {
  padding: 20px 22px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.log-month,
.log-group-title {
  font-size: 17px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-item {
  display: grid;
  grid-template-columns: 96px 150px minmax(220px, 1fr);
  gap: 8px 16px;
  align-items: baseline;
  font-size: 15px;
}

.log-date {
  color: var(--text-sub);
}

.log-target {
  font-weight: 600;
  color: var(--text-main);
}

.log-text,
.log-note {
  color: var(--text-sub);
}

.revision-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.revision-item {
  padding: 16px 20px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.revision-date {
  color: var(--text-sub);
  margin-bottom: 6px;
}

.revision-field {
  font-size: 16px;
  margin-bottom: 6px;
}

.revision-text,
.revision-note {
  font-size: 15px;
  color: var(--text-sub);
}

.field-label {
  color: var(--text-sub);
}

.meta-sep {
  color: var(--line-strong);
  margin: 0 6px;
}

/* ==========================================================================
   4. pages — 首页与各内页模块
   ========================================================================== */

/* --- 首页：公告栏式首屏 --- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 40px;
  padding: 48px 0 44px;
  border-bottom: 1px solid var(--line);
}

.hero-lead {
  min-width: 0;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero-title {
  font-size: 34px;
  line-height: 1.35;
  margin-bottom: 16px;
}

.hero-text {
  font-size: 16px;
  color: var(--text-sub);
  max-width: 640px;
  margin-bottom: 24px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.hero-figure {
  max-width: 620px;
  aspect-ratio: 16 / 9;
}

.hero-notice {
  min-width: 0;
  padding: 22px 24px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  align-self: start;
}

.notice-title {
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.notice-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.notice-item {
  min-width: 0;
}

.notice-tag {
  display: inline-block;
  padding: 2px 8px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-accent);
  color: var(--accent);
  font-size: 12px;
}

.notice-heading {
  font-size: 16px;
  margin-bottom: 6px;
}

.notice-text {
  font-size: 14px;
  color: var(--text-sub);
}

/* --- 首页：题材频道总表 --- */

.section-channels .channel-table tbody td:nth-child(3) {
  color: var(--text-sub);
}

/* --- 首页：专题片单入口 --- */

.collection-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.collection-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.18s ease;
}

.collection-card:hover {
  border-color: var(--accent);
}

.collection-cards .collection-card .card-media {
  border-radius: 0;
  aspect-ratio: 16 / 9;
}

.card-body {
  padding: 20px 22px 22px;
}

.card-title {
  font-size: 18px;
  margin-bottom: 8px;
}

.card-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.card-text {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 14px;
}

.card-link {
  font-size: 14px;
  font-weight: 600;
}

/* --- 首页：字段说明与收录边界 --- */

.fields-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr);
  gap: 32px;
}

.fields-table-col,
.fields-boundary-col {
  min-width: 0;
}

.fields-boundary-col .boundary-list {
  margin-bottom: 16px;
}

/* --- 首页：整理记录速览 --- */

.section-log .log-group {
  padding: 18px 20px;
}

/* --- 首页：浏览前准备要点 --- */

.section-browse .step-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* --- 首页：站内栏目索引 --- */

.index-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.index-cell {
  min-width: 0;
  padding: 18px 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.18s ease;
}

.index-cell:hover {
  border-color: var(--accent);
}

.index-link {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.index-text {
  font-size: 13px;
  color: var(--text-sub);
}

/* --- 内页：面包屑与页面标题区 --- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 20px 0 0;
  font-size: 14px;
  color: var(--text-sub);
}

.breadcrumb-sep {
  color: var(--line-strong);
}

.breadcrumb-current {
  color: var(--text-sub);
}

.page-header {
  padding: 18px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.page-title {
  font-size: 34px;
  line-height: 1.35;
  margin-bottom: 12px;
}

.page-description {
  font-size: 16px;
  color: var(--text-sub);
  max-width: 820px;
}

.page-meta {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-sub);
}

.meta-label {
  color: var(--text-sub);
  margin-right: 6px;
}

/* --- 题材频道页 --- */

.section-channel-map .section-body {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 1.4fr);
  gap: 28px;
  align-items: start;
}

.section-channel-map .media-figure {
  aspect-ratio: 4 / 3;
}

.section-channel-map .section-text {
  margin-bottom: 0;
}

.section-channel-list .channel-table tbody th {
  background-color: transparent;
  border-bottom: 1px solid var(--line);
}

.section-channel-collections .mapping-table td:nth-child(2),
.section-channel-collections .mapping-table td:nth-child(3) {
  color: var(--text-sub);
}

.channel-flow-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.channel-flow-list .step-item {
  border-left: 1px solid var(--line);
  border-top: 3px solid var(--accent);
}

/* --- 专题片单页 --- */

.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.collection-grid .collection-card {
  display: grid;
  grid-template-columns: minmax(160px, 0.85fr) minmax(0, 1.15fr);
  gap: 0;
}

.collection-grid .collection-cover {
  border-radius: 0;
  min-height: 100%;
  aspect-ratio: 3 / 4;
}

.collection-body {
  min-width: 0;
  padding: 20px 22px;
}

.collection-name {
  font-size: 18px;
  margin-bottom: 8px;
}

.collection-desc {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 14px;
}

.collection-facts {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0 0 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fact-key {
  color: var(--text-sub);
  margin: 0;
}

.fact-value {
  margin: 0;
  font-size: 14px;
  color: var(--text-main);
}

.collection-links a {
  margin-right: 14px;
  font-size: 14px;
  font-weight: 600;
}

.cross-table td:nth-child(2) {
  color: var(--text-sub);
}

.read-order-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
}

.read-order-column {
  min-width: 0;
  padding: 20px 22px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.column-title {
  font-size: 17px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.field-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-item {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  color: var(--text-sub);
}

.field-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent);
}

.read-order-steps .step-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.read-order-steps .step-item {
  border-left: 1px solid var(--line);
  border-top: 3px solid var(--accent);
}

.maintain-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.maintain-item {
  padding: 18px 20px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.maintain-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.maintain-text {
  font-size: 15px;
  color: var(--text-sub);
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.related-item {
  font-size: 15px;
}

/* --- 字段说明页 --- */

.section-field-table .section-media {
  max-width: 720px;
  aspect-ratio: 16 / 9;
  margin-bottom: 22px;
}

.section-field-table .field-table td:nth-child(2),
.section-field-table .field-table td:nth-child(3) {
  color: var(--text-sub);
}

.section-field-map .map-table td:last-child {
  color: var(--text-sub);
}

/* --- 浏览指引页 --- */

.guide-steps .guide-figure {
  max-width: 720px;
  aspect-ratio: 16 / 9;
  margin-bottom: 22px;
}

.guide-steps .step-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.guide-compare .compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.compare-col {
  min-width: 0;
  padding: 20px 22px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.compare-heading {
  font-size: 17px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.compare-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compare-item {
  min-width: 0;
}

.compare-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.compare-text {
  font-size: 14px;
  color: var(--text-sub);
}

.guide-record .record-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.record-item {
  min-width: 0;
  padding: 18px 20px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.record-name {
  font-size: 16px;
  margin-bottom: 8px;
}

.record-text {
  font-size: 15px;
  color: var(--text-sub);
}

.guide-limits .limits-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.limits-item {
  min-width: 0;
  padding: 18px 20px;
  background-color: var(--bg-soft);
  border-radius: var(--radius);
}

.limits-name {
  font-size: 16px;
  margin-bottom: 6px;
}

.limits-text {
  font-size: 15px;
  color: var(--text-sub);
}

/* --- 整理记录页 --- */

.section-log-monthly .log-item {
  grid-template-columns: 110px 150px minmax(220px, 1fr);
}

.section-log-monthly .section-figure {
  max-width: 720px;
  aspect-ratio: 16 / 9;
  margin-top: 26px;
}

.section-log-changes .change-table td {
  color: var(--text-sub);
}

.section-log-changes .change-table td:first-child {
  color: var(--text-main);
  font-weight: 600;
}

.section-log-fields .revision-item {
  display: grid;
  grid-template-columns: 110px 170px minmax(220px, 1fr);
  gap: 6px 16px;
  align-items: baseline;
}

.section-log-fields .revision-date,
.section-log-fields .revision-field {
  margin-bottom: 0;
}

.section-log-fields .revision-field {
  font-size: 15px;
}

.reading-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.reading-step {
  min-width: 0;
  padding: 18px 20px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.reading-step-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.reading-step-text {
  font-size: 15px;
  color: var(--text-sub);
}

/* --- 404 --- */

.error-main {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0 var(--wrap-pad);
}

.error-inner {
  width: 100%;
  max-width: 720px;
  padding: 64px 0 24px;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 12px;
}

.error-title {
  font-size: 32px;
  margin-bottom: 14px;
}

.error-text {
  font-size: 16px;
  color: var(--text-sub);
  margin-bottom: 24px;
}

.error-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: var(--radius);
  background-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.error-action:hover,
.error-action:focus-visible {
  background-color: var(--accent-deep);
  color: #ffffff;
  text-decoration: none;
}

.error-section {
  margin-top: 40px;
  padding: 24px;
  background-color: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.error-subtitle {
  font-size: 18px;
  margin-bottom: 14px;
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-bottom: 14px;
}

.error-links a {
  font-size: 15px;
  font-weight: 600;
}

.error-note {
  font-size: 14px;
  color: var(--text-sub);
}

/* ==========================================================================
   5. responsive — 平板与移动端
   ========================================================================== */

@media (max-width: 1024px) {
  .footer-inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .index-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section-browse .step-list,
  .guide-steps .step-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  :root {
    --wrap-pad: 20px;
  }

  body {
    font-size: 15px;
  }

  /* 页头与移动导航 */
  .site-header {
    gap: 12px;
    padding: 0 20px;
  }

  .nav-toggle {
    display: flex;
    order: 2;
  }

  .site-nav {
    order: 3;
    flex: 0 0 auto;
  }

  .nav-list {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 8px 20px 20px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--line);
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-item {
    border-bottom: 1px solid var(--line);
  }

  .nav-item:last-child {
    border-bottom: 0;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 14px 2px;
    border-bottom: 0;
    border-left: 2px solid transparent;
    font-size: 16px;
  }

  .nav-link.is-current {
    border-bottom-color: transparent;
    border-left-color: var(--accent);
    padding-left: 12px;
    background-color: var(--bg-accent);
  }

  /* 首屏 */
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding: 32px 0 34px;
  }

  .hero-title {
    font-size: 26px;
  }

  .hero-text {
    font-size: 15px;
  }

  .hero-notice {
    padding: 18px 20px;
  }

  /* 区块 */
  .section {
    padding: 34px 0;
  }

  .section-title {
    font-size: 20px;
  }

  .page-title {
    font-size: 26px;
  }

  .page-header {
    padding: 14px 0 22px;
  }

  /* 多栏模块收成单栏 */
  .fields-layout,
  .section-channel-map .section-body,
  .read-order-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .collection-cards,
  .collection-grid,
  .guide-compare .compare-grid,
  .boundary-cols,
  .boundary-columns,
  .guide-limits .limits-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .collection-grid .collection-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .collection-grid .collection-cover {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .section-browse .step-list,
  .guide-steps .step-list,
  .channel-flow-list,
  .read-order-steps .step-list,
  .guide-record .record-grid,
  .reading-steps,
  .index-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 记录行改为纵向堆叠 */
  .log-item,
  .section-log-monthly .log-item,
  .section-log-fields .revision-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .section-log-fields .revision-field {
    margin-bottom: 4px;
  }

  /* 表格横向滚动 */
  .channel-table,
  .field-table,
  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .channel-table thead,
  .channel-table tbody,
  .field-table thead,
  .field-table tbody,
  .data-table thead,
  .data-table tbody {
    display: block;
    min-width: 560px;
  }

  .channel-table tbody tr,
  .field-table tbody tr,
  .data-table tbody tr {
    display: flex;
    flex-wrap: nowrap;
  }

  .channel-table tbody th,
  .channel-table tbody td,
  .field-table tbody td,
  .data-table tbody td,
  .data-table tbody th {
    flex: 0 0 auto;
    min-width: 120px;
    white-space: normal;
  }

  .channel-table thead tr,
  .field-table thead tr,
  .data-table thead tr {
    display: flex;
  }

  .channel-table thead th,
  .field-table thead th,
  .data-table thead th {
    flex: 0 0 auto;
    min-width: 120px;
  }

  .cell-code,
  .field-table .field-name,
  .map-table .field-name {
    width: auto;
    min-width: 96px;
  }

  /* 页脚 */
  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 20px;
    padding: 34px 20px 26px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    padding: 14px 20px 24px;
  }

  .error-inner {
    padding: 40px 0 16px;
  }

  .error-title {
    font-size: 26px;
  }
}

@media (max-width: 480px) {
  :root {
    --wrap-pad: 16px;
  }

  .site-header {
    padding: 0 16px;
  }

  .brand-note {
    display: none;
  }

  .nav-list {
    padding: 8px 16px 18px;
  }

  .hero-title {
    font-size: 23px;
  }

  .page-title {
    font-size: 23px;
  }

  .section-title {
    font-size: 19px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    padding: 30px 16px 22px;
  }

  .footer-bottom {
    padding: 12px 16px 22px;
  }

  .faq-item {
    padding: 0 16px;
  }

  .log-group,
  .revision-item,
  .step-item,
  .boundary-col,
  .compare-col,
  .record-item,
  .reading-step,
  .maintain-item,
  .read-order-column {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
