/* ==========================================================================
   午夜TV · 全站样式表
   结构：base → layout → components → pages → responsive
   ========================================================================== */

/* --------------------------------------------------------------------------
   base
   -------------------------------------------------------------------------- */

:root {
  --bg-page: #f6f7f8;
  --bg-card: #ffffff;
  --bg-subtle: #eef0f2;
  --text-main: #1f2328;
  --text-sub: #5b6570;
  --line: #dfe3e7;
  --line-strong: #c6ccd2;
  --state-ok: #1f8a5f;
  --state-ok-bg: #e8f3ed;
  --state-warn: #9a5b1a;
  --state-warn-bg: #f7efe4;
  --radius: 6px;
  --shell: 1120px;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.35;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--text-main);
  text-decoration: none;
}

a:hover {
  color: var(--state-ok);
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

button {
  font: inherit;
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   layout · 全站骨架
   -------------------------------------------------------------------------- */

.site-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-card);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--text-main);
}

.brand:hover {
  color: var(--text-main);
}

.brand-mark {
  width: 22px;
  height: 22px;
  border: 1px solid var(--text-main);
  border-radius: 4px;
  background:
    linear-gradient(var(--text-main), var(--text-main)) 4px 6px / 2px 10px no-repeat,
    linear-gradient(var(--text-main), var(--text-main)) 9px 6px / 2px 10px no-repeat,
    linear-gradient(var(--state-ok), var(--state-ok)) 14px 6px / 2px 10px no-repeat;
}

.brand-text {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
}

.site-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-list li {
  display: flex;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 15px;
  color: var(--text-sub);
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  color: var(--text-main);
}

.nav-link.is-current {
  color: var(--text-main);
  font-weight: 600;
  border-bottom-color: var(--state-ok);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-main);
}

.site-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 24px 64px;
}

.inner-main {
  padding-top: 24px;
}

.clue-bar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}

.clue-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 10px 24px;
}

.clue-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-sub);
}

.clue-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--state-ok-bg);
  color: var(--state-ok);
  border: 1px solid #cfe6da;
}

/* 面包屑与页面标题区 */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--text-sub);
}

.breadcrumb a:hover {
  color: var(--state-ok);
}

.breadcrumb-sep {
  color: var(--line-strong);
}

.breadcrumb-current {
  font-family: var(--font-mono);
  color: var(--text-main);
}

.page-header {
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.page-title {
  font-size: 30px;
  font-weight: 600;
  color: var(--text-main);
}

.page-description {
  margin-top: 12px;
  max-width: 760px;
  font-size: 16px;
  color: var(--text-sub);
}

/* 通用 section */

.section {
  margin-bottom: 56px;
}

.section-head {
  margin-bottom: 20px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
}

.section-desc,
.section-intro,
.section-lead {
  margin-top: 8px;
  max-width: 760px;
  font-size: 15px;
  color: var(--text-sub);
}

.section-foot,
.section-note,
.section-next {
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-sub);
}

.section-foot a,
.section-note a,
.section-next a {
  color: var(--state-ok);
  border-bottom: 1px solid #cfe6da;
}

.section-foot a:hover,
.section-note a:hover,
.section-next a:hover {
  color: var(--text-main);
  border-bottom-color: var(--line-strong);
}

.section-next a + a {
  margin-left: 18px;
}

.sub-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   components · 通用组件
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  font-size: 15px;
  font-weight: 600;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn-primary {
  background: var(--text-main);
  border-color: var(--text-main);
  color: #ffffff;
}

.btn-primary:hover {
  background: #333a41;
  border-color: #333a41;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--bg-card);
  color: var(--text-main);
}

.btn-ghost:hover {
  border-color: var(--text-main);
  color: var(--text-main);
  transform: translateY(-1px);
}

/* 数据表格 */

.table-wrap,
.channel-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}

.data-table,
.channel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.table-caption {
  caption-side: top;
  text-align: left;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-sub);
  border-bottom: 1px solid var(--line);
}

.data-table thead th,
.channel-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-table tbody td,
.channel-table tbody td,
.channel-table tbody th {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text-main);
  vertical-align: top;
}

.data-table tbody tr:last-child td,
.channel-table tbody tr:last-child td,
.channel-table tbody tr:last-child th {
  border-bottom: 0;
}

.data-table tbody tr:hover,
.channel-table tbody tr:hover {
  background: #fafbfc;
}

/* 编号 / 状态标注 */

.code,
.channel-code,
.collection-code,
.detail-code,
.time-code,
.record-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-sub);
}

.channel-code {
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
}

.status-add,
.status-edit,
.status-note,
.record-type {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-add,
.record-type-add {
  background: var(--state-ok-bg);
  color: var(--state-ok);
  border-color: #cfe6da;
}

.status-edit,
.record-type-adjust {
  background: var(--state-warn-bg);
  color: var(--state-warn);
  border-color: #ecd9bd;
}

.status-note,
.record-type-archive {
  background: var(--bg-subtle);
  color: var(--text-sub);
  border-color: var(--line);
}

/* 字段定义列表 */

.field-list,
.field-desc-list,
.detail-list,
.type-detail-list {
  margin: 0;
}

.field-list {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 16px;
}

.field-list dt,
.field-list dd {
  margin: 0;
  padding: 10px 0;
}

.field-list dt {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.field-list dd {
  font-size: 15px;
  color: var(--text-sub);
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.field-list dd:last-of-type {
  border-bottom: 0;
  padding-bottom: 10px;
}

/* 记录条目 */

.record-list {
  display: flex;
  flex-direction: column;
}

.record-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.record-item:last-child {
  border-bottom: 0;
}

.record-target {
  font-size: 15px;
  color: var(--text-main);
}

/* 边界条目 */

.boundary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.boundary-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.boundary-title {
  font-size: 17px;
  margin-bottom: 8px;
}

.boundary-text {
  font-size: 15px;
  color: var(--text-sub);
}

/* 锚点目录 */

.anchor-nav {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 40px;
}

.anchor-nav-title {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-sub);
  margin-bottom: 10px;
}

.anchor-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.anchor-nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: var(--text-main);
  border-bottom: 1px solid transparent;
}

.anchor-nav-list a:hover {
  color: var(--state-ok);
  border-bottom-color: #cfe6da;
}

/* FAQ */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.faq-item[open] {
  border-color: var(--line-strong);
}

.faq-question {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 20px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "展开";
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--state-ok);
  padding: 2px 8px;
  border: 1px solid #cfe6da;
  border-radius: 4px;
}

.faq-item[open] .faq-question::after {
  content: "收起";
}

.faq-answer {
  padding: 0 20px 18px;
  font-size: 15px;
  color: var(--text-sub);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* 页脚 */

.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--line);
  color: var(--text-main);
}

.footer-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-brand {
  min-width: 0;
}

.footer-logo {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 600;
}

.footer-slogan {
  margin-top: 6px;
  font-size: 14px;
  color: var(--state-ok);
}

.footer-intro {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-sub);
}

.footer-title {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-sub);
  margin-bottom: 12px;
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-list a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  font-size: 14px;
  color: var(--text-main);
}

.footer-list a:hover {
  color: var(--state-ok);
}

.footer-text {
  font-size: 14px;
  color: var(--text-sub);
}

.footer-text + .footer-text {
  margin-top: 8px;
}

.footer-bottom {
  border-top: 1px solid var(--line);
}

.footer-copy {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 16px 24px;
  font-size: 13px;
  color: var(--text-sub);
}

/* --------------------------------------------------------------------------
   pages · 首页
   -------------------------------------------------------------------------- */

.home-main {
  padding-top: 40px;
}

.hero {
  margin-bottom: 56px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.hero-copy {
  min-width: 0;
}

.hero-kicker {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--state-ok);
  margin-bottom: 12px;
}

.hero-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-main);
}

.hero-lead {
  margin-top: 16px;
  max-width: 640px;
  font-size: 16px;
  color: var(--text-sub);
}

.hero-note {
  margin-top: 12px;
  max-width: 640px;
  font-size: 14px;
  color: var(--text-sub);
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-figure {
  margin: 0;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.hero-figure img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-subtle);
}

.hero-caption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-sub);
}

/* 频道总览表 */

.section-channels .data-table {
  table-layout: fixed;
}

.section-channels .data-table th:nth-child(1),
.section-channels .data-table td:nth-child(1) {
  width: 96px;
}

.section-channels .data-table th:nth-child(2),
.section-channels .data-table td:nth-child(2) {
  width: 24%;
}

.section-channels .data-table th:nth-child(3),
.section-channels .data-table td:nth-child(3) {
  width: 22%;
}

/* 专题片单卡 */

.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.collection-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.collection-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.collection-figure,
.collection-cover {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.collection-figure img,
.collection-cover img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--bg-subtle);
}

.collection-body {
  padding: 16px 20px 20px;
  min-width: 0;
}

.collection-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
}

.collection-name {
  font-size: 17px;
  margin: 8px 0 10px;
}

.collection-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 14px;
  color: var(--text-sub);
}

.collection-desc {
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-sub);
}

/* 字段说明两栏 */

.field-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.field-col {
  min-width: 0;
}

/* 整理记录速览 */

.record-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.record-group {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}

.record-month {
  font-size: 16px;
  margin-bottom: 10px;
}

/* 站内栏目索引 */

.site-index {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.index-col {
  min-width: 0;
}

.index-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.index-link:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.index-name {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
}

.index-desc {
  font-size: 14px;
  color: var(--text-sub);
}

/* --------------------------------------------------------------------------
   pages · 频道分类
   -------------------------------------------------------------------------- */

.section-channels-table .channel-table {
  table-layout: fixed;
}

.channel-table .channel-code {
  width: 96px;
  text-align: left;
}

.channel-table th.channel-direction,
.channel-table td.channel-direction {
  width: 26%;
}

.channel-table td.channel-neighbor {
  width: 22%;
}

.channel-figure {
  margin: 24px 0 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.channel-figure img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-subtle);
}

.channel-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-sub);
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
}

.field-col-title {
  font-size: 17px;
  margin-bottom: 12px;
}

.field-name-list {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 16px;
}

.field-name-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.field-name-item:last-child {
  border-bottom: 0;
}

.field-name-item code {
  font-size: 14px;
  font-weight: 600;
}

.field-desc-list {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 16px;
}

.field-desc-list dt {
  padding-top: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.field-desc-list dd {
  margin: 6px 0 0;
  padding-bottom: 12px;
  font-size: 15px;
  color: var(--text-sub);
  border-bottom: 1px solid var(--line);
}

.field-desc-list dd:last-of-type {
  border-bottom: 0;
}

.field-desc-list dd a {
  color: var(--state-ok);
  border-bottom: 1px solid #cfe6da;
}

.neighbor-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.neighbor-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}

.neighbor-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.neighbor-text {
  font-size: 15px;
  color: var(--text-sub);
}

/* --------------------------------------------------------------------------
   pages · 专题片单
   -------------------------------------------------------------------------- */

.collections-overview .collection-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.collections-overview .collection-meta {
  flex-direction: column;
  gap: 4px;
}

.meta-label {
  display: inline-block;
  min-width: 68px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
}

.meta-value {
  font-size: 14px;
  color: var(--text-main);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
}

.detail-identity {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}

.detail-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
}

.detail-code {
  margin-top: 6px;
  font-weight: 600;
  color: var(--text-main);
}

.detail-name {
  font-size: 18px;
  margin: 10px 0 12px;
}

.detail-summary {
  font-size: 15px;
  color: var(--text-sub);
}

.detail-content {
  min-width: 0;
}

.detail-subtitle {
  font-size: 17px;
  margin-bottom: 12px;
}

.detail-subtitle + .detail-text {
  margin-top: 4px;
}

.detail-list {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 16px;
  margin-bottom: 24px;
}

.detail-list dt {
  padding-top: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.detail-list dd {
  margin: 6px 0 0;
  padding-bottom: 12px;
  font-size: 15px;
  color: var(--text-sub);
  border-bottom: 1px solid var(--line);
}

.detail-list dd:last-of-type {
  border-bottom: 0;
}

.detail-text {
  font-size: 15px;
  color: var(--text-sub);
  max-width: 760px;
}

.detail-text a {
  color: var(--state-ok);
  border-bottom: 1px solid #cfe6da;
}

.order-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  counter-reset: order-step;
}

.order-step {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}

.step-index {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--state-ok);
  background: var(--state-ok-bg);
  border: 1px solid #cfe6da;
  border-radius: 4px;
  padding: 1px 8px;
  margin-bottom: 10px;
}

.step-name {
  font-size: 16px;
  margin-bottom: 8px;
}

.step-text {
  font-size: 15px;
  color: var(--text-sub);
}

.time-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.time-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.time-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.time-code {
  font-weight: 600;
  color: var(--text-main);
}

.time-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-sub);
}

.time-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--state-ok);
  background: var(--state-ok-bg);
  border: 1px solid #cfe6da;
  border-radius: 4px;
  padding: 1px 8px;
}

.time-text {
  margin-top: 8px;
  font-size: 15px;
  color: var(--text-sub);
}

/* --------------------------------------------------------------------------
   pages · 浏览指引
   -------------------------------------------------------------------------- */

.guide-steps,
.guide-fields,
.guide-misread,
.guide-boundary {
  margin-bottom: 56px;
}

.section-lead a {
  color: var(--state-ok);
  border-bottom: 1px solid #cfe6da;
}

.section-lead a + a {
  margin-left: 14px;
}

.step-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.step-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}

.step-figure {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.step-figure img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--bg-subtle);
}

.step-caption {
  padding: 8px 16px 0;
  font-size: 12px;
  color: var(--text-sub);
}

.step-body {
  padding: 12px 16px 18px;
  min-width: 0;
}

.step-title {
  font-size: 16px;
  margin-bottom: 8px;
}

.step-body .step-text {
  font-size: 15px;
  color: var(--text-sub);
}

.field-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.checklist-col {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}

.checklist-title {
  font-size: 16px;
  margin-bottom: 12px;
}

.checklist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  color: var(--text-sub);
}

.checklist-list .field-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-main);
  background: var(--bg-subtle);
  border-radius: 4px;
  padding: 1px 8px;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   pages · 整理记录
   -------------------------------------------------------------------------- */

.records-section,
.record-types-section,
.record-links-section {
  margin-bottom: 56px;
}

.record-month {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.record-month-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.record-month-title {
  font-size: 17px;
}

.record-month-meta {
  font-size: 13px;
  color: var(--text-sub);
}

.record-month .record-list {
  counter-reset: record-item;
}

.record-month .record-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 6px 14px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}

.record-month .record-item:last-child {
  border-bottom: 0;
}

.record-month .record-note {
  grid-column: 2 / -1;
  font-size: 15px;
  color: var(--text-sub);
}

.record-types-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
}

.record-types-names,
.record-types-detail {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}

.subsection-title {
  font-size: 16px;
  margin-bottom: 12px;
}

.type-name-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.type-name {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-main);
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.type-name:last-child {
  border-bottom: 0;
}

.type-detail-list dt {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  padding-top: 12px;
}

.type-detail-list dd {
  margin: 6px 0 0;
  padding-bottom: 12px;
  font-size: 15px;
  color: var(--text-sub);
  border-bottom: 1px solid var(--line);
}

.type-detail-list dd:last-of-type {
  border-bottom: 0;
}

.record-figure {
  margin: 0 0 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.record-figure img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-subtle);
}

.record-figure-caption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-sub);
}

.record-link-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.record-link-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  min-width: 0;
}

.record-link-text {
  font-size: 15px;
  color: var(--text-sub);
}

.record-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--state-ok);
  border-bottom: 1px solid #cfe6da;
}

.record-link:hover {
  color: var(--text-main);
  border-bottom-color: var(--line-strong);
}

/* --------------------------------------------------------------------------
   pages · 404
   -------------------------------------------------------------------------- */

.error-main {
  padding-top: 64px;
}

.error-hero {
  max-width: 760px;
  margin-bottom: 48px;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--state-warn);
  background: var(--state-warn-bg);
  border: 1px solid #ecd9bd;
  border-radius: 4px;
  display: inline-block;
  padding: 2px 10px;
  margin-bottom: 16px;
}

.error-hero h1 {
  font-size: 30px;
  font-weight: 600;
}

.error-text {
  margin-top: 12px;
  font-size: 16px;
  color: var(--text-sub);
}

.error-text + .error-text {
  margin-top: 8px;
}

.error-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.error-help {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.error-help h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.error-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.error-item a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--bg-page);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 15px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.error-item a:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  color: var(--state-ok);
}

/* --------------------------------------------------------------------------
   responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .header-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    margin: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(31, 35, 40, 0.06);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    display: none;
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list li {
    display: block;
  }

  .nav-link {
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    border-left: 3px solid transparent;
  }

  .nav-link.is-current {
    border-bottom-color: var(--line);
    border-left-color: var(--state-ok);
  }

  .clue-inner,
  .site-main,
  .footer-inner,
  .footer-copy {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-main {
    padding-bottom: 48px;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .hero-figure {
    order: -1;
  }

  .hero-figure img {
    height: 240px;
  }

  .hero-title {
    font-size: 26px;
  }

  .collection-grid,
  .collections-overview .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-layout,
  .field-grid,
  .detail-layout,
  .record-types-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .record-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step-track,
  .field-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .neighbor-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
  }

  .site-main {
    padding-bottom: 40px;
  }

  .page-title,
  .hero-title,
  .error-hero h1 {
    font-size: 24px;
  }

  .section-title {
    font-size: 19px;
  }

  .section {
    margin-bottom: 40px;
  }

  .clue-text {
    font-size: 13px;
  }

  .collection-grid,
  .collections-overview .collection-grid,
  .record-groups,
  .site-index,
  .step-track,
  .field-checklist,
  .boundary-list,
  .error-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-figure img {
    height: 200px;
  }

  .collection-figure img,
  .collection-cover img {
    height: 160px;
  }

  .channel-figure img,
  .record-figure img {
    height: 200px;
  }

  .step-figure img {
    height: 170px;
  }

  /* 表格在窄屏切换为字段卡片视图，字段顺序保持不变 */
  .table-wrap,
  .channel-table-wrap {
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .data-table,
  .channel-table {
    display: block;
    width: 100%;
  }

  .data-table thead,
  .channel-table thead,
  .table-caption,
  .channel-table caption {
    display: none;
  }

  .data-table tbody,
  .channel-table tbody {
    display: block;
  }

  .data-table tbody tr,
  .channel-table tbody tr {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 16px;
    margin-bottom: 14px;
  }

  .data-table tbody tr:hover,
  .channel-table tbody tr:hover {
    background: var(--bg-card);
  }

  .data-table tbody td,
  .channel-table tbody td,
  .channel-table tbody th {
    display: block;
    width: auto !important;
    padding: 10px 0;
    border-bottom: 1px dashed var(--line);
  }

  .data-table tbody td:last-child,
  .channel-table tbody td:last-child,
  .channel-table tbody th:last-child {
    border-bottom: 0;
  }

  .data-table tbody td::before,
  .channel-table tbody td::before,
  .channel-table tbody th::before {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-sub);
    margin-bottom: 4px;
  }

  .section-channels .data-table tbody td:nth-child(1)::before {
    content: "频道编号";
  }

  .section-channels .data-table tbody td:nth-child(2)::before {
    content: "题材方向";
  }

  .section-channels .data-table tbody td:nth-child(3)::before {
    content: "相邻频道";
  }

  .section-channels .data-table tbody td:nth-child(4)::before {
    content: "收录边界";
  }

  .section-channels-table .channel-table tbody th.channel-code::before {
    content: "频道编号";
  }

  .section-channels-table .channel-table tbody td.channel-direction::before {
    content: "题材方向";
  }

  .section-channels-table .channel-table tbody td.channel-neighbor::before {
    content: "相邻频道";
  }

  .section-channels-table .channel-table tbody td.channel-scope::before {
    content: "收录边界";
  }

  .record-month .record-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .record-month .record-note {
    grid-column: 1;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
