/* =========================================================
   午夜电影网 · 全站样式
   分组：base / layout / components / pages / responsive
   ========================================================= */

/* ---------------------------------------------------------
   base
   --------------------------------------------------------- */

:root {
  --ink: #232a33;
  --ink-soft: #5b6472;
  --ink-mute: #8a919c;
  --navy: #1b2a4a;
  --navy-deep: #12203c;
  --amber: #c8791f;
  --amber-soft: #fdf3e6;
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #dfe3e9;
  --line-strong: #c9d0da;
  --ok: #2f7d5d;
  --warn: #b4453a;
  --radius: 6px;
  --radius-sm: 4px;
  --wrap: 1120px;
  --read: 760px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.35;
}

p {
  margin: 0;
}

ul,
ol,
dl {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--navy);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--amber);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

caption {
  caption-side: top;
  text-align: left;
}

button {
  font: inherit;
  color: inherit;
}

/* ---------------------------------------------------------
   layout · 全站骨架
   --------------------------------------------------------- */

.site-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  font-family: var(--font-sans);
  color: var(--ink);
}

/* 顶部线索说明条 */
.topline {
  background: var(--navy-deep);
  color: #cfd7e4;
  font-size: 13px;
}

.topline p {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 8px 20px;
  line-height: 1.6;
}

/* 页头 */
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px 20px;
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin-right: auto;
}

.brand-mark {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}

.brand-sub {
  font-size: 12px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--navy);
  font-size: 14px;
  cursor: pointer;
}

.nav-toggle::before {
  content: "";
  width: 14px;
  height: 2px;
  background: var(--navy);
  box-shadow: 0 5px 0 var(--navy), 0 -5px 0 var(--navy);
}

.nav-toggle:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.nav-toggle:hover::before {
  background: var(--amber);
  box-shadow: 0 5px 0 var(--amber), 0 -5px 0 var(--amber);
}

.site-nav {
  display: block;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
  font-size: 14px;
}

.nav-group-title {
  color: var(--ink-mute);
  font-size: 12px;
  font-family: var(--font-mono);
  padding-left: 4px;
}

.nav-list li:not(.nav-group-title) {
  display: inline-flex;
}

.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 2px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
}

.nav-list a:hover {
  color: var(--amber);
  text-decoration: none;
  border-bottom-color: var(--amber);
}

.nav-list a.is-current {
  color: var(--navy);
  font-weight: 700;
  border-bottom-color: var(--amber);
}

.header-entry {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--amber);
  border-radius: var(--radius-sm);
  color: var(--amber);
  font-size: 14px;
  white-space: nowrap;
}

.header-entry:hover {
  background: var(--amber);
  color: #fff;
  text-decoration: none;
}

/* 主内容容器 */
.site-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.inner-main {
  padding-top: 20px;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 14px;
}

.breadcrumb a {
  color: var(--ink-soft);
}

.breadcrumb-sep {
  color: var(--line-strong);
}

.breadcrumb-current {
  color: var(--ink);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-mute);
}

.breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-list li + li::before {
  content: "/";
  color: var(--line-strong);
}

.breadcrumb-list a {
  color: var(--ink-soft);
}

/* 页标题区 */
.page-header,
.page-content .page-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.page-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 10px;
}

.inner-main .page-title {
  font-size: 28px;
}

.page-description {
  max-width: var(--read);
  color: var(--ink-soft);
  font-size: 15px;
}

/* 页脚 */
.site-footer {
  background: var(--navy);
  color: #c6cfdd;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 32px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 34px 20px 22px;
}

.footer-title {
  color: #fff;
  font-size: 15px;
  margin-bottom: 10px;
}

.footer-list {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.footer-list a {
  color: #c6cfdd;
}

.footer-list a:hover {
  color: #f0c286;
}

.footer-copy {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px 20px 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  color: #9fabbe;
}

/* ---------------------------------------------------------
   components · 通用模块
   --------------------------------------------------------- */

.section-title {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 8px;
}

.section-desc,
.section-lead,
.section-intro,
.section-summary {
  max-width: var(--read);
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 16px;
}

.section-desc a,
.section-lead a,
.section-intro a,
.section-summary a {
  color: var(--amber);
}

.block-title {
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 10px;
}

/* 表格通用 */
.table-scroll,
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.data-table {
  min-width: 640px;
  font-size: 14px;
}

.data-table caption.table-caption {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink-mute);
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f3f6;
  color: var(--navy);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 13px;
}

.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: top;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #fbf7f1;
}

.data-table tbody tr.is-current td,
.data-table tbody tr[aria-current] td {
  background: var(--amber-soft);
}

.data-table tbody tr.is-current td:first-child,
.data-table tbody tr[aria-current] td:first-child {
  box-shadow: inset 3px 0 0 var(--amber);
}

.col-no,
.cell-code,
.cell-num,
.col-time,
.cell-date,
.history-date,
.record-date,
.note-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.col-name,
.cell-name {
  font-weight: 700;
  color: var(--navy);
}

.table-foot {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}

.table-foot a {
  color: var(--amber);
}

.section-foot {
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}

.section-foot a {
  color: var(--amber);
}

/* 状态标签 */
.status,
.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.status-done {
  background: #eaf5ef;
  color: var(--ok);
}

.status-todo,
.status-pending {
  background: #fbeceb;
  color: var(--warn);
}

.status-warn {
  background: #fbeceb;
  color: var(--warn);
}

/* 列表条目通用 */
.boundary-list,
.limit-list,
.rule-list,
.fallback-list,
.note-list,
.issue-list,
.history-list,
.related-list {
  display: grid;
  gap: 10px;
}

.boundary-item,
.limit-list li,
.rule-list li,
.fallback-item,
.issue-item {
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-soft);
}

.boundary-item {
  border-left-color: var(--amber);
  color: var(--ink);
}

.note-item,
.record-item {
  display: grid;
  grid-template-columns: 96px minmax(140px, 200px) 1fr;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.record-target,
.note-target {
  color: var(--navy);
  font-weight: 700;
}

.record-desc,
.note-text {
  color: var(--ink-soft);
}

/* 相关入口 */
.related-list {
  gap: 8px;
}

.related-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.related-item a {
  color: var(--navy);
  font-weight: 700;
}

.related-note,
.related-desc {
  color: var(--ink-soft);
  font-size: 13px;
}

/* 侧栏通用 */
.page-aside,
.page-sidebar,
.layout-aside {
  font-size: 14px;
}

.aside-block {
  margin-top: 18px;
}

.aside-block:first-child {
  margin-top: 0;
}

.page-sidebar > * + *,
.layout-aside > * + * {
  margin-top: 18px;
}

.aside-title,
.sidebar-title {
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.aside-block p,
.aside-text,
.sidebar-note {
  color: var(--ink-soft);
  font-size: 14px;
}

.aside-list {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

.aside-list li {
  padding-left: 12px;
  position: relative;
}

.aside-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  background: var(--amber);
  border-radius: 50%;
}

.aside-link-line {
  margin-top: 10px;
}

.aside-link,
.sidebar-entry {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--amber);
  border-radius: var(--radius-sm);
  color: var(--amber);
  font-size: 14px;
}

.aside-link:hover,
.sidebar-entry:hover {
  background: var(--amber);
  color: #fff;
  text-decoration: none;
}

/* 快速字段表 */
.quick-fields {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  font-size: 13px;
}

.quick-fields dt {
  color: var(--navy);
  font-weight: 700;
  white-space: nowrap;
}

.quick-fields dd {
  margin: 0;
  color: var(--ink-soft);
}

/* 字段简表（首页摘要） */
.field-brief {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 14px;
}

.field-brief dt {
  color: var(--navy);
  font-weight: 700;
  white-space: nowrap;
}

.field-brief dd {
  margin: 0;
  color: var(--ink-soft);
}

/* 版本条 */
.version-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 14px;
  margin-bottom: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-soft);
}

.version-label {
  color: var(--ink-mute);
  font-family: var(--font-mono);
}

.version-value {
  color: var(--navy);
  font-weight: 700;
  font-family: var(--font-mono);
}

.version-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-left: auto;
}

.version-link {
  color: var(--amber);
}

/* 图片容器通用 */
.hero-media,
.card-media,
.scene-figure,
.group-cover,
.guide-figure,
.field-map-figure {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.hero-media img,
.card-media img,
.scene-figure img,
.group-cover img,
.guide-figure img,
.field-map-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #e8ebf0;
}

figcaption {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink-mute);
  border-top: 1px solid var(--line);
  background: #fafbfc;
}

/* 展开收起 */
.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "展开";
  flex: none;
  font-size: 12px;
  font-weight: 400;
  font-family: var(--font-mono);
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

.faq-item[open] .faq-question::after {
  content: "收起";
  background: var(--amber);
  color: #fff;
}

.faq-answer {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
}

.faq-answer p + p {
  margin-top: 8px;
}

/* 淡入增强 */
@media (prefers-reduced-motion: no-preference) {
  .status-section,
  .record-section,
  .playlist-section {
    animation: fade-up 0.5s ease-out both;
  }
}

@keyframes fade-up {
  from {
    transform: translateY(10px);
  }
  to {
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------
   pages · 首页
   --------------------------------------------------------- */

.home-main {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr);
  gap: 28px;
  align-items: start;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.hero-intro {
  min-width: 0;
}

.hero-intro .page-title {
  font-size: 30px;
  margin-bottom: 12px;
}

.hero-lead {
  max-width: var(--read);
  color: var(--ink-soft);
  margin-bottom: 18px;
}

.hero-media {
  margin-bottom: 14px;
}

.hero-media img {
  aspect-ratio: 16 / 9;
}

.hero-note {
  font-size: 14px;
  color: var(--ink-soft);
}

.hero-note a {
  color: var(--amber);
}

.hero-table {
  min-width: 0;
}

.hero-table .section-desc {
  margin-bottom: 12px;
}

.channel-table {
  min-width: 560px;
}

.overview-table {
  min-width: 720px;
}

/* 工具区 */
.toolbar {
  margin-bottom: 34px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 96px;
}

.tool-card:hover {
  border-color: var(--amber);
  text-decoration: none;
}

.tool-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.tool-card:hover .tool-name {
  color: var(--amber);
}

.tool-desc {
  font-size: 14px;
  color: var(--ink-soft);
}

/* 数据区 */
.data-section {
  margin-bottom: 34px;
}

/* 状态区 */
.status-section {
  margin-bottom: 34px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.status-block {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.status-list {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.status-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.issue-list {
  margin-top: 14px;
}

.issue-item {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(120px, 200px) 1fr;
  gap: 10px 14px;
  align-items: baseline;
}

.issue-channel {
  color: var(--navy);
  font-weight: 700;
}

.issue-field {
  color: var(--ink-soft);
}

.issue-action {
  color: var(--ink-soft);
}

/* 片单入口 */
.playlist-section {
  margin-bottom: 34px;
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.playlist-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.playlist-card:hover {
  border-color: var(--amber);
}

.card-media {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.card-media img {
  aspect-ratio: 16 / 9;
  transition: transform 0.25s ease;
}

.playlist-card:hover .card-media img {
  transform: translateY(-3px);
}

.card-title {
  font-size: 17px;
  padding: 14px 16px 6px;
}

.card-title a {
  color: var(--navy);
}

.playlist-card:hover .card-title a {
  color: var(--amber);
  text-decoration: underline;
}

.card-meta {
  padding: 0 16px 12px;
  font-size: 13px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
}

.card-meta + .card-meta {
  padding-top: 0;
  padding-bottom: 16px;
}

/* 整理记录 */
.record-section {
  margin-bottom: 34px;
}

.record-month {
  margin-top: 16px;
}

.month-title {
  font-size: 15px;
  color: var(--navy);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
  font-family: var(--font-mono);
}

.record-list {
  display: grid;
  gap: 8px;
}

/* 摘要区 */
.summary-section {
  margin-bottom: 34px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.summary-col {
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.summary-more {
  margin-top: 12px;
  font-size: 14px;
}

.summary-more a {
  color: var(--amber);
}

/* 站内索引 */
.index-section {
  margin-bottom: 20px;
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.index-col {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.index-col .block-title a {
  color: var(--navy);
}

.index-col .block-title a:hover {
  color: var(--amber);
}

.index-col p {
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------
   pages · 内页通用布局
   --------------------------------------------------------- */

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  gap: 32px;
  align-items: start;
}

.page-layout.layout-shell {
  grid-template-columns: minmax(0, 1fr) minmax(0, 280px);
}

.page-content,
.page-main,
.layout-main {
  min-width: 0;
}

.page-aside,
.page-sidebar,
.layout-aside {
  min-width: 0;
  position: sticky;
  top: 20px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* 频道方向页 */
.channel-list-section,
.channel-figure-section,
.channel-field-section,
.channel-boundary-section,
.related-section {
  margin-bottom: 30px;
}

.channel-table {
  min-width: 760px;
}

.channel-row td {
  vertical-align: top;
}

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.scene-figure img {
  aspect-ratio: 16 / 10;
}

.field-explain-table {
  min-width: 560px;
}

.boundary-list {
  margin-top: 12px;
}

/* 专题片单页 */
.playlist-index,
.playlist-detail,
.playlist-notes,
.related-entry {
  margin-bottom: 30px;
}

.playlist-table {
  min-width: 720px;
}

.playlist-group {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.group-head {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}

.group-cover {
  border-radius: var(--radius-sm);
}

.group-cover img {
  aspect-ratio: 16 / 9;
}

.group-meta {
  min-width: 0;
}

.group-title {
  font-size: 17px;
  color: var(--navy);
  margin-bottom: 6px;
}

.group-desc {
  font-size: 14px;
  color: var(--ink-soft);
}

.playlist-group .table-wrap {
  border: 0;
  border-radius: 0;
}

.entry-table {
  min-width: 700px;
}

.entry-table tbody tr:hover td {
  background: #fbf7f1;
}

/* 浏览指引页 */
.guide-steps,
.guide-faq,
.guide-fallback {
  margin-bottom: 30px;
}

.guide-steps h2,
.guide-faq h2,
.guide-fallback h2,
.related-entry h2 {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 8px;
}

.guide-figure {
  max-width: 760px;
  margin-bottom: 18px;
}

.guide-figure img {
  aspect-ratio: 21 / 9;
}

.step-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  counter-reset: guide-step;
}

.step-item {
  position: relative;
  padding: 18px 16px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--amber);
  border-radius: var(--radius);
  counter-increment: guide-step;
}

.step-item::before {
  content: "0" counter(guide-step);
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
  margin-bottom: 6px;
}

.step-name {
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 8px;
}

.step-field,
.step-desc,
.step-done {
  font-size: 14px;
  color: var(--ink-soft);
}

.step-field {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}

.step-done {
  margin-top: 8px;
  color: var(--ok);
  font-size: 13px;
}

.faq-group {
  margin-top: 16px;
}

.faq-group-title {
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 8px;
}

.fallback-list {
  margin-top: 12px;
}

.fallback-case {
  font-size: 15px;
  color: var(--navy);
  margin-bottom: 4px;
}

.fallback-path {
  color: var(--ink-soft);
  font-size: 14px;
}

/* 字段说明页 */
.section-field-map,
.section-field-table,
.section-completeness,
.section-limits,
.section-related {
  margin-bottom: 30px;
}

.field-map-figure {
  max-width: 760px;
}

.field-map-figure img {
  aspect-ratio: 21 / 9;
}

.field-table {
  min-width: 760px;
}

.rule-list,
.limit-list {
  margin-top: 12px;
}

/* ---------------------------------------------------------
   pages · 404
   --------------------------------------------------------- */

.error-main {
  padding-top: 24px;
}

.error-hero {
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--amber);
  margin-bottom: 8px;
}

.error-hero h1 {
  font-size: 30px;
  color: var(--navy);
  margin-bottom: 12px;
}

.error-lead {
  max-width: var(--read);
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  background: var(--amber);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 15px;
}

.button-primary:hover {
  background: #a9631a;
  color: #fff;
  text-decoration: none;
}

.button-plain {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--navy);
  font-size: 15px;
}

.button-plain:hover {
  border-color: var(--amber);
  color: var(--amber);
  text-decoration: none;
}

.error-paths,
.error-note {
  margin-bottom: 28px;
}

.error-paths h2,
.error-note h2 {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 12px;
}

.error-path-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.error-path-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
}

.error-path-list a {
  font-weight: 700;
  color: var(--navy);
}

.error-path-list span {
  font-size: 14px;
  color: var(--ink-soft);
}

.error-note-list {
  display: grid;
  gap: 10px;
}

.error-note-list li {
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------
   responsive
   --------------------------------------------------------- */

@media (max-width: 960px) {
  .site-header {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    order: 3;
    width: 100%;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0 4px;
    border-top: 1px solid var(--line);
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list li:not(.nav-group-title) {
    display: block;
  }

  .nav-list a {
    display: flex;
    min-height: 44px;
    padding: 0 4px;
    border-bottom: 1px solid var(--line);
  }

  .nav-list a.is-current {
    border-bottom-color: var(--amber);
  }

  .nav-group-title {
    padding: 10px 4px 4px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .tool-grid,
  .status-grid,
  .index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-layout,
  .page-layout.layout-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .page-aside,
  .page-sidebar,
  .layout-aside {
    position: static;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .topline p {
    padding: 8px 16px;
  }

  .site-header {
    padding: 12px 16px;
    gap: 10px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    font-size: 18px;
  }

  .header-entry {
    padding: 0 12px;
    font-size: 13px;
  }

  .site-main {
    padding: 18px 16px 44px;
  }

  .page-title,
  .hero-intro .page-title,
  .error-hero h1 {
    font-size: 23px;
  }

  .inner-main .page-title {
    font-size: 22px;
  }

  .section-title,
  .guide-steps h2,
  .guide-faq h2,
  .guide-fallback h2,
  .related-entry h2,
  .error-paths h2,
  .error-note h2 {
    font-size: 18px;
  }

  .tool-grid,
  .status-grid,
  .index-grid,
  .summary-grid,
  .playlist-grid,
  .figure-grid,
  .step-list,
  .error-path-list,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .group-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .record-item,
  .note-item,
  .issue-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .data-table {
    min-width: 560px;
  }

  .channel-table {
    min-width: 620px;
  }

  .overview-table,
  .playlist-table,
  .entry-table,
  .field-table {
    min-width: 620px;
  }

  .version-actions {
    margin-left: 0;
    width: 100%;
  }

  .footer-grid {
    padding: 26px 16px 18px;
    gap: 20px;
  }

  .footer-copy {
    padding: 12px 16px 22px;
  }
}
