/* ==========================================================================
   喵趣漫画 · 全站样式
   命令行工具风：深灰底 + 等宽标签 + 细边框容器 + 成功绿强调
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. base —— 变量、重置、排版基线
   -------------------------------------------------------------------------- */

:root {
  --bg: #12151a;
  --surface: #1a1f26;
  --surface-2: #1f252d;
  --line: #2b323c;
  --line-soft: #232a33;
  --text: #d7dde5;
  --text-dim: #8f9aa8;
  --text-mute: #6d7886;
  --green: #3fbf7f;
  --link: #6fb3ff;
  --radius: 6px;
  --radius-sm: 4px;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
  --pad: 24px;
  --gap: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  font-weight: 400;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 600;
  line-height: 1.35;
  color: #eef2f7;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

a:hover {
  color: #9ccbff;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
}

strong {
  color: #eef2f7;
  font-weight: 600;
}

.visually-hidden {
  position: absolute !important;
  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;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   2. layout —— 骨架：终端条、页头、导航、主容器、页脚
   -------------------------------------------------------------------------- */

/* 终端式信息条 */
.term-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 24px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 10px var(--pad);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line-soft);
}

.term-bar-text {
  color: var(--text-dim);
}

.term-bar-text::before {
  content: "$ ";
  color: var(--green);
}

.term-bar-meta {
  color: var(--text-mute);
}

/* 页头 */
.site-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px var(--pad);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex: 0 0 auto;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand-name {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  color: #eef2f7;
}

.brand-slogan {
  font-size: 12px;
  color: var(--text-mute);
}

/* 主导航 */
.site-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.nav-item {
  display: block;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text-dim);
}

.nav-link:hover {
  color: var(--text);
  border-color: var(--line);
  background-color: var(--surface);
}

.nav-link.is-current {
  color: var(--green);
  border-color: var(--line);
  background-color: var(--surface);
  box-shadow: inset 0 -2px 0 0 var(--green);
}

/* 汉堡按钮：桌面隐藏 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text-dim);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* 主内容容器 */
.site-main {
  display: block;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 32px var(--pad) 8px;
}

.inner-main {
  padding-top: 20px;
}

/* 页脚 */
.site-footer {
  max-width: var(--wrap);
  margin: 48px auto 0;
  padding: 32px var(--pad) 24px;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 32px;
}

.footer-col {
  min-width: 0;
}

.footer-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: none;
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-list li {
  min-width: 0;
}

.footer-list a {
  display: inline-block;
  min-height: 24px;
  font-size: 14px;
  color: var(--text-dim);
}

.footer-list a:hover {
  color: var(--green);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.footer-brand {
  color: var(--text-dim);
}

.footer-note {
  color: var(--text-mute);
}

.footer-copy {
  color: var(--text-mute);
}

/* --------------------------------------------------------------------------
   3. components —— 通用组件：标题区、按钮、卡片、列表、表格、FAQ
   -------------------------------------------------------------------------- */

/* 区块标题组 */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 20px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}

.section-title {
  font-size: 22px;
  color: #eef2f7;
}

.section-title::before {
  content: "#";
  margin-right: 8px;
  color: var(--green);
  font-weight: 600;
}

.section-note,
.section-lead {
  font-size: 13.5px;
  color: var(--text-dim);
  max-width: 720px;
}

.section-lead {
  margin-bottom: 18px;
}

.section-intro {
  margin-bottom: 18px;
  font-size: 14.5px;
  color: var(--text-dim);
  max-width: 840px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  background-color: var(--surface);
  color: var(--text);
}

.btn-primary {
  border-color: rgba(63, 191, 127, 0.5);
  color: var(--green);
  background-color: rgba(63, 191, 127, 0.08);
}

.btn-primary:hover {
  color: #0f1318;
  background-color: var(--green);
  border-color: var(--green);
}

.btn-ghost {
  color: var(--text-dim);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-mute);
  background-color: var(--surface-2);
}

/* 标签 */
.tag,
.update-tag,
.rank-tag {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--link);
  background-color: var(--surface-2);
  white-space: nowrap;
}

/* 封面卡（首页封面墙 / 首屏书架） */
.cover-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  overflow: hidden;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.cover-card:hover {
  border-color: rgba(63, 191, 127, 0.45);
  background-color: var(--surface-2);
  transform: translateY(-2px);
}

.cover-figure {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background-color: var(--surface-2);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}

.cover-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
}

.cover-name {
  font-size: 15px;
  color: #eef2f7;
}

.cover-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
}

.cover-progress {
  color: var(--green);
}

.cover-desc {
  font-size: 13.5px;
  color: var(--text-dim);
}

.cover-link {
  align-self: flex-start;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--link);
}

.cover-link::after {
  content: " →";
}

.cover-link:hover {
  color: var(--green);
}

/* 面板标题（首页并列区） */
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-title {
  font-size: 16px;
  color: #eef2f7;
}

.panel-title::before {
  content: "> ";
  color: var(--green);
}

.panel-more {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
}

.panel-more:hover {
  color: var(--green);
}

/* 更新记录行（首页） */
.update-list {
  display: flex;
  flex-direction: column;
}

.update-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  transition: background-color 0.18s ease;
}

.update-row:hover {
  background-color: var(--surface-2);
}

.update-row:last-child {
  border-bottom: 0;
}

.update-date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.update-name {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.update-name:hover {
  color: var(--green);
}

.update-tag {
  color: var(--text-dim);
}

.update-progress {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--green);
  white-space: nowrap;
}

/* 榜单位次行（首页） */
.rank-list {
  display: flex;
  flex-direction: column;
}

.rank-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  transition: background-color 0.18s ease;
}

.rank-row:hover {
  background-color: var(--surface-2);
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-no {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-mute);
  text-align: center;
}

.rank-row:nth-child(-n+3) .rank-no {
  color: var(--green);
}

.rank-name {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-tag {
  color: var(--text-dim);
}

/* 专题卡 */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.topic-card:hover {
  border-color: rgba(63, 191, 127, 0.45);
  background-color: var(--surface-2);
}

.topic-name {
  font-size: 16px;
  color: #eef2f7;
}

.topic-scope {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.topic-desc {
  font-size: 13.5px;
  color: var(--text-dim);
}

.topic-link {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--link);
}

.topic-link::after {
  content: " →";
}

.topic-link:hover {
  color: var(--green);
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.breadcrumb a {
  color: var(--text-dim);
}

.breadcrumb a:hover {
  color: var(--green);
}

.breadcrumb-sep {
  color: var(--text-mute);
}

.breadcrumb-sep::before {
  content: "/";
}

.breadcrumb-current {
  color: var(--text-dim);
}

/* 内页页面标题区 */
.page-header {
  margin-bottom: 32px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.page-title {
  font-size: 34px;
  line-height: 1.3;
  color: #eef2f7;
}

.page-description {
  margin-top: 10px;
  max-width: 860px;
  font-size: 14.5px;
  color: var(--text-dim);
}

.page-description a {
  color: var(--link);
}

/* 字段口径表 */
.field-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.field-table {
  min-width: 560px;
  font-size: 14px;
}

.field-table-caption {
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}

.field-table th,
.field-table td {
  padding: 11px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}

.field-table thead th {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-mute);
  background-color: var(--surface-2);
}

.field-table tbody tr:last-child th,
.field-table tbody tr:last-child td {
  border-bottom: 0;
}

.field-table .field-name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  white-space: nowrap;
}

.field-table td:last-child {
  color: var(--text-dim);
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  overflow: hidden;
}

.faq-item[open] {
  border-color: rgba(63, 191, 127, 0.4);
}

.faq-question {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::before {
  content: "+";
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 700;
}

.faq-item[open] .faq-question::before {
  content: "−";
}

.faq-question:hover {
  color: var(--green);
}

.faq-answer {
  padding: 0 16px 14px 42px;
  font-size: 14px;
  color: var(--text-dim);
}

/* 站内栏目索引 */
.index-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--gap);
}

.index-col {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.index-col:hover {
  border-color: rgba(63, 191, 127, 0.45);
  background-color: var(--surface-2);
}

.index-name {
  font-size: 15px;
  color: #eef2f7;
}

.index-name a {
  color: inherit;
}

.index-name a:hover {
  color: var(--green);
}

.index-desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

/* 说明型列表（阅读摘要 / 口径 / 范围） */
.read-list,
.scope-list,
.rule-list,
.col-list,
.basis-list,
.diff-list,
.error-link-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.read-item,
.scope-item,
.rule-item,
.col-list li,
.basis-item,
.diff-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-dim);
}

.read-item::before,
.scope-item::before,
.rule-item::before,
.col-list li::before,
.basis-item::before,
.diff-list li::before {
  content: "·";
  position: absolute;
  left: 4px;
  top: 0;
  color: var(--green);
  font-weight: 700;
}

/* 滚动出现动画（默认可见，仅做增强） */
@media (prefers-reduced-motion: no-preference) {
  .cover-card,
  .topic-card,
  .editor-card,
  .genre-block,
  .update-day {
    animation: fade-up 0.42s ease both;
  }
}

@keyframes fade-up {
  from {
    transform: translateY(8px);
  }
  to {
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   4. pages —— 首页
   -------------------------------------------------------------------------- */

.home-main {
  padding-top: 28px;
}

/* 首屏 */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.hero-intro {
  min-width: 0;
}

.hero-kicker {
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
}

.hero-kicker::before {
  content: "// ";
  color: var(--text-mute);
}

.hero-title {
  font-size: 34px;
  line-height: 1.3;
  color: #eef2f7;
}

.hero-lead {
  margin-top: 14px;
  max-width: 640px;
  font-size: 15px;
  color: var(--text-dim);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.hero-genres {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.hero-genres-title {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  color: #eef2f7;
}

.hero-genres-title::before {
  content: "> ";
  color: var(--green);
}

.genre-quick-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.genre-quick-item {
  min-width: 0;
}

.genre-quick-item a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text-dim);
}

.genre-quick-item a::before {
  content: "›";
  margin-right: 8px;
  color: var(--green);
}

.genre-quick-item a:hover {
  color: var(--text);
  border-color: var(--line);
  background-color: var(--surface-2);
}

/* 首屏书架 */
.front-shelf {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.shelf-grid {
  display: grid;
  gap: var(--gap);
}

.shelf-grid-front {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shelf-grid-wall {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 封面墙：三行不等高，按行微调封面比例 */
.shelf-grid-wall .cover-card:nth-child(3n + 2) .cover-figure {
  aspect-ratio: 4 / 5;
}

.shelf-grid-wall .cover-card:nth-child(3n + 3) .cover-figure {
  aspect-ratio: 2 / 3;
}

/* 题材方向总览 */
.genre-overview {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.genre-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.genre-col:hover {
  border-color: rgba(63, 191, 127, 0.45);
  background-color: var(--surface-2);
}

.genre-name {
  font-size: 16px;
  color: #eef2f7;
}

.genre-orient {
  font-size: 13.5px;
  color: var(--text-dim);
}

.genre-scope,
.genre-pick {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.genre-link {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--link);
}

.genre-link::after {
  content: " →";
}

.genre-link:hover {
  color: var(--green);
}

/* 封面墙区 */
.cover-wall {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

/* 最近更新 + 人气榜单并列区 */
.split-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 28px;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.split-col {
  min-width: 0;
}

/* 专题汇编 */
.topic-entry {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

/* 阅读方式与收录范围摘要 */
.read-summary {
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.read-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 16px;
}

.read-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.read-col-title {
  font-size: 15px;
  color: #eef2f7;
}

.read-link {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--link);
}

.read-link::after {
  content: " →";
}

.read-link:hover {
  color: var(--green);
}

/* 站内栏目索引 */
.site-index {
  padding: 32px 0 8px;
}

/* --------------------------------------------------------------------------
   5. pages —— 题材分类
   -------------------------------------------------------------------------- */

.genres-overview {
  margin-bottom: 40px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.overview-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.overview-item:hover {
  border-color: rgba(63, 191, 127, 0.45);
  background-color: var(--surface-2);
}

.overview-name {
  font-size: 16px;
  color: #eef2f7;
}

.overview-name a {
  color: inherit;
}

.overview-name a:hover {
  color: var(--green);
}

.overview-desc {
  font-size: 13.5px;
  color: var(--text-dim);
}

.overview-count {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.genre-blocks {
  margin-bottom: 40px;
}

.genre-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  margin-bottom: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  scroll-margin-top: 24px;
}

.genre-block:last-child {
  margin-bottom: 0;
}

.genre-intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.genre-figure {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  overflow: hidden;
}

.genre-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.genre-figure figcaption {
  display: none;
}

.genre-text {
  font-size: 14px;
  color: var(--text-dim);
}

.genre-meta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}

.genre-meta dt {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.genre-meta dd {
  margin: 0;
  color: var(--text-dim);
}

.genre-list {
  min-width: 0;
}

.genre-list-title {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  color: var(--text-mute);
}

.entry-list {
  display: flex;
  flex-direction: column;
}

.entry-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  transition: background-color 0.18s ease;
}

.entry-item:last-child {
  border-bottom: 0;
}

.entry-item:hover {
  background-color: var(--surface-2);
}

.entry-name {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-genre {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
  white-space: nowrap;
}

.entry-progress {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--green);
  white-space: nowrap;
}

.genre-scope {
  margin-bottom: 40px;
}

.scope-list {
  margin-top: 4px;
}

.genre-diff {
  margin-bottom: 8px;
}

.diff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.diff-col {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.diff-title {
  margin-bottom: 12px;
  font-size: 15px;
  color: #eef2f7;
}

/* --------------------------------------------------------------------------
   6. pages —— 最近更新
   -------------------------------------------------------------------------- */

.update-overview {
  margin-bottom: 40px;
}

.overview-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 20px 32px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.overview-text {
  min-width: 0;
  font-size: 14px;
  color: var(--text-dim);
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  gap: 10px 24px;
}

.overview-stat {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stat-value {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--green);
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-mute);
}

.update-groups {
  margin-bottom: 40px;
}

.update-day {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.update-day:last-child {
  margin-bottom: 0;
}

.update-day .update-date {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  font-weight: 600;
  color: #eef2f7;
}

.update-day .update-date::before {
  content: "#";
  margin-right: 8px;
  color: var(--green);
}

.update-day .update-list {
  display: flex;
  flex-direction: column;
}

.update-day .update-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.update-day .update-row:last-child {
  border-bottom: 0;
}

.update-day .update-row:hover {
  background-color: var(--surface-2);
}

.update-thumb {
  width: 72px;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  overflow: hidden;
}

.update-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.update-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  min-width: 0;
}

.update-day .update-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}

.update-day .update-name:hover {
  color: var(--green);
}

.update-genre {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.update-day .update-progress {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--green);
}

.update-status {
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}

.status-ongoing {
  color: var(--green);
  border-color: rgba(63, 191, 127, 0.4);
  background-color: rgba(63, 191, 127, 0.08);
}

.status-completed {
  color: var(--text-dim);
  background-color: var(--surface-2);
}

.update-note {
  flex: 1 1 100%;
  font-size: 13px;
  color: var(--text-dim);
}

.status-explain {
  margin-bottom: 40px;
}

.status-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.status-col {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.col-title {
  margin-bottom: 10px;
  font-size: 15px;
  color: #eef2f7;
}

.col-text {
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text-dim);
}

.record-note {
  margin-bottom: 8px;
}

.note-text {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-dim);
  max-width: 900px;
}

.note-text:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   7. pages —— 人气榜单
   -------------------------------------------------------------------------- */

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: start;
}

.layout-main {
  min-width: 0;
}

.rank-list-section,
.editor-section,
.basis-section,
.rank-note-section {
  margin-bottom: 40px;
}

.rank-note-section {
  margin-bottom: 0;
}

/* 榜单位次列表（内页） */
.rank-list-section .rank-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  overflow: hidden;
}

.rank-list-section .rank-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  transition: background-color 0.18s ease;
}

.rank-list-section .rank-row:last-child {
  border-bottom: 0;
}

.rank-list-section .rank-row:hover {
  background-color: var(--surface-2);
}

.rank-list-section .rank-row-top {
  grid-template-columns: 48px 84px minmax(0, 1fr);
}

.rank-index {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-mute);
  text-align: center;
  padding-top: 2px;
}

.rank-row-top .rank-index {
  color: var(--green);
}

.rank-cover {
  width: 84px;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background-color: var(--surface-2);
  overflow: hidden;
}

.rank-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  min-width: 0;
}

.rank-body .rank-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.rank-genre {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.rank-progress,
.rank-status {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--green);
}

.rank-meta {
  flex: 1 1 100%;
  font-size: 13.5px;
  color: var(--text-dim);
}

/* 编辑选题 */
.editor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}

.editor-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.editor-card:hover {
  border-color: rgba(63, 191, 127, 0.45);
  background-color: var(--surface-2);
}

.editor-name {
  font-size: 16px;
  color: #eef2f7;
}

.editor-desc {
  font-size: 13.5px;
  color: var(--text-dim);
}

.editor-meta {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.editor-link {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--link);
}

.editor-link::after {
  content: " →";
}

.editor-link:hover {
  color: var(--green);
}

/* 排序依据 */
.basis-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.basis-col {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.basis-title {
  margin-bottom: 12px;
  font-size: 15px;
  color: #eef2f7;
}

/* 榜单口径 */
.rank-note-body {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.rank-note-body p {
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-dim);
}

.rank-note-body p:last-child {
  margin-bottom: 0;
}

/* 侧栏 */
.rank-aside {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.aside-block {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.aside-title {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  color: #eef2f7;
}

.aside-title::before {
  content: "> ";
  color: var(--green);
}

.aside-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aside-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  font-size: 13.5px;
}

.aside-stat-label {
  color: var(--text-dim);
}

.aside-stat-value {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
}

.aside-text {
  font-size: 13.5px;
  color: var(--text-dim);
}

.aside-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aside-links li {
  min-width: 0;
}

.aside-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}

.aside-links a::before {
  content: "›";
  margin-right: 8px;
  color: var(--green);
}

.aside-links a:hover {
  color: var(--text);
  border-color: var(--line);
  background-color: var(--surface-2);
}

/* --------------------------------------------------------------------------
   8. pages —— 阅读说明
   -------------------------------------------------------------------------- */

.guide-section {
  margin-bottom: 40px;
}

.guide-section:last-child {
  margin-bottom: 0;
}

.guide-figure {
  width: 100%;
  max-width: 720px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface-2);
  overflow: hidden;
}

.guide-figure img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
}

.figure-caption {
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-mute);
}

.rule-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.rule-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
}

.rule-title {
  font-size: 15px;
  color: #eef2f7;
}

.rule-note {
  font-size: 13.5px;
  color: var(--text-dim);
}

.guide-scope .scope-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  counter-reset: scope;
}

.guide-scope .scope-item {
  padding-left: 34px;
  counter-increment: scope;
}

.guide-scope .scope-item::before {
  content: counter(scope, decimal-leading-zero);
  left: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--green);
}

.scope-note {
  margin-top: 16px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.guide-related .related-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
}

.related-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.related-item:hover {
  border-color: rgba(63, 191, 127, 0.45);
  background-color: var(--surface-2);
}

.related-item a {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--link);
}

.related-item a:hover {
  color: var(--green);
}

.related-desc {
  font-size: 13px;
  color: var(--text-dim);
}

/* --------------------------------------------------------------------------
   9. pages —— 404
   -------------------------------------------------------------------------- */

.error-main {
  padding-top: 48px;
  padding-bottom: 16px;
}

.error-hero {
  max-width: 640px;
  margin-bottom: 40px;
}

.error-code {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
}

.error-code::before {
  content: "// ";
  color: var(--text-mute);
}

.error-hero h1 {
  margin-top: 10px;
  font-size: 34px;
  line-height: 1.3;
  color: #eef2f7;
}

.error-text {
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-dim);
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.error-links h2 {
  margin-bottom: 14px;
  font-size: 18px;
  color: #eef2f7;
}

.error-link-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.error-link-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--surface);
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text-dim);
}

.error-link-list a:hover {
  color: var(--green);
  border-color: rgba(63, 191, 127, 0.45);
  background-color: var(--surface-2);
}

/* --------------------------------------------------------------------------
   10. responsive —— 900px / 600px 两档断点
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  :root {
    --pad: 18px;
    --gap: 16px;
  }

  .site-main {
    padding-top: 24px;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .hero-title {
    font-size: 28px;
  }

  .shelf-grid-front,
  .shelf-grid-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .genre-grid,
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .topic-grid,
  .editor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .index-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .page-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .rank-aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .genre-block {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .genre-figure {
    max-width: 260px;
  }

  .overview-bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .overview-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .error-link-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-title,
  .error-hero h1 {
    font-size: 28px;
  }

  .section-title {
    font-size: 20px;
  }
}

@media (max-width: 600px) {
  :root {
    --pad: 14px;
    --gap: 14px;
  }

  body {
    font-size: 14.5px;
  }

  /* 页头与移动导航 */
  .site-header {
    gap: 10px;
    padding: 12px var(--pad);
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    flex: 1 1 100%;
    margin-left: 0;
    order: 3;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px 0 4px;
    border-top: 1px solid var(--line-soft);
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 0 12px;
    font-size: 14px;
  }

  .nav-link.is-current {
    box-shadow: inset 2px 0 0 0 var(--green);
  }

  /* 首屏 */
  .hero-title {
    font-size: 26px;
  }

  .hero-lead {
    font-size: 14.5px;
  }

  .hero-actions .btn {
    flex: 1 1 auto;
  }

  .shelf-grid-front,
  .shelf-grid-wall {
    grid-template-columns: minmax(0, 1fr);
  }

  .shelf-grid-wall .cover-card:nth-child(3n + 2) .cover-figure,
  .shelf-grid-wall .cover-card:nth-child(3n + 3) .cover-figure {
    aspect-ratio: 3 / 4;
  }

  .genre-grid,
  .overview-grid,
  .topic-grid,
  .editor-grid,
  .read-summary-grid,
  .diff-grid,
  .status-columns,
  .basis-columns,
  .rule-columns,
  .guide-related .related-list,
  .index-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rank-aside {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 首页更新行与榜单行 */
  .split-col-updates .update-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
  }

  .split-col-updates .update-date {
    grid-column: 1 / -1;
  }

  .split-col-updates .update-tag {
    display: none;
  }

  .split-col-rankings .rank-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
  }

  .split-col-rankings .rank-tag {
    grid-column: 2 / -1;
  }

  /* 内页标题与面包屑 */
  .page-title,
  .error-hero h1 {
    font-size: 26px;
  }

  .page-header {
    margin-bottom: 24px;
  }

  .section-title {
    font-size: 19px;
  }

  /* 更新页 */
  .update-day {
    padding: 14px;
  }

  .update-day .update-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .update-day .update-row.is-featured {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .update-thumb {
    width: 60px;
  }

  /* 榜单页 */
  .rank-list-section .rank-row {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .rank-list-section .rank-row-top {
    grid-template-columns: 32px 64px minmax(0, 1fr);
  }

  .rank-cover {
    width: 64px;
  }

  .rank-index {
    font-size: 14px;
  }

  /* 题材分类页 */
  .genre-block {
    padding: 16px;
  }

  .entry-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
  }

  .entry-genre {
    grid-column: 1 / -1;
  }

  /* 页脚 */
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* 字段表与说明 */
  .field-table {
    min-width: 480px;
  }

  .faq-answer {
    padding-left: 16px;
  }
}
