/* ==========================================================================
   羞羞漫画 · 全站样式表
   技术工作台风格：中性浅灰底、深墨文字、低饱和青蓝主色
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BASE — 变量、重置、排版、通用骨架
   -------------------------------------------------------------------------- */

:root {
  --bg-page: #f4f5f7;
  --bg-panel: #ffffff;
  --bg-subtle: #eceef1;
  --text-main: #1f2429;
  --text-sub: #5b6570;
  --accent: #2f7d8c;
  --accent-dark: #245f6b;
  --accent-soft: #e3eef0;
  --line: #d8dde2;
  --warn: #c2410c;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --container: 1120px;
  --gutter: 20px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --shadow-card: 0 1px 2px rgba(31, 36, 41, 0.05);
  --header-height: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.site-body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  min-width: 320px;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.35;
  color: var(--text-main);
  font-weight: 600;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.16s ease;
}

a:hover,
a:focus-visible {
  color: var(--accent-dark);
  text-decoration: underline;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 60;
  padding: 10px 16px;
  background-color: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  transition: top 0.16s ease;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   2. LAYOUT — 容器、页头、主导航、主内容、页脚骨架
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 20px;
}

/* 品牌标识 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  flex-shrink: 0;
}

.brand:hover,
.brand:focus-visible {
  color: var(--text-main);
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  background-color: var(--accent);
  position: relative;
  flex-shrink: 0;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background-color: #fff;
  border-radius: 1px;
}

.brand-mark::before {
  left: 7px;
  top: 8px;
  width: 16px;
  height: 3px;
}

.brand-mark::after {
  left: 7px;
  top: 15px;
  width: 10px;
  height: 3px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.brand-slogan {
  font-size: 12px;
  color: var(--text-sub);
}

/* 主导航 */
.site-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-list a {
  display: block;
  padding: 8px 12px;
  font-size: 15px;
  color: var(--text-sub);
  border-radius: var(--radius-md);
  border-bottom: 2px solid transparent;
}

.nav-list a:hover,
.nav-list a:focus-visible {
  color: var(--accent);
  background-color: var(--bg-subtle);
  text-decoration: none;
}

.nav-list a.is-current {
  color: var(--accent);
  font-weight: 600;
  border-bottom-color: var(--accent);
  background-color: transparent;
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background-color: var(--bg-panel);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 1px;
}

.nav-toggle:hover {
  border-color: var(--accent);
}

/* 主内容区 */
.site-main {
  display: block;
}

.inner-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px var(--gutter) 56px;
}

.home-main {
  padding-bottom: 48px;
}

/* 通用页脚 */
.site-footer {
  background-color: var(--bg-panel);
  border-top: 1px solid var(--line);
  margin-top: 40px;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 36px var(--gutter) 20px;
}

.footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.footer-brand-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
}

.footer-brand-desc {
  margin-top: 6px;
  max-width: 46ch;
  font-size: 14px;
  color: var(--text-sub);
}

.footer-cta {
  flex-shrink: 0;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  padding: 24px 0;
}

.footer-col-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.footer-list li + li {
  margin-top: 8px;
}

.footer-list a {
  font-size: 14px;
  color: var(--text-sub);
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.footer-copy {
  font-size: 13px;
  color: var(--text-sub);
}

.back-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 13px;
  color: var(--text-sub);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.back-top::before {
  content: "↑";
  font-size: 14px;
  line-height: 1;
}

.back-top:hover,
.back-top:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.btn-primary {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background-color: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--line);
  color: var(--text-main);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* 通用链接 */
.link-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.link-more::after {
  content: "→";
  font-size: 13px;
}

.link-more:hover,
.link-more:focus-visible {
  color: var(--accent-dark);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   3. COMPONENTS — 通用区块、面包屑、页面标题区、锚点导航、侧栏
   -------------------------------------------------------------------------- */

.section {
  margin-top: 44px;
}

.section:first-child {
  margin-top: 0;
}

.section-head {
  margin-bottom: 18px;
}

.section-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-main);
}

.section-desc {
  margin-top: 8px;
  max-width: 62ch;
  font-size: 15px;
  color: var(--text-sub);
}

.section-foot {
  margin-top: 16px;
}

.section-footnote {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-sub);
}

.section-footnote a {
  margin-right: 12px;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 14px;
}

.breadcrumb a {
  color: var(--text-sub);
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--accent);
}

.breadcrumb-sep {
  color: var(--line);
}

.breadcrumb-current {
  color: var(--text-main);
}

/* 页面标题区 */
.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 30px;
  font-weight: 600;
  color: var(--text-main);
}

.page-description {
  margin-top: 12px;
  max-width: 68ch;
  font-size: 16px;
  color: var(--text-sub);
}

/* 页内锚点导航 */
.anchor-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 16px;
  margin-bottom: 28px;
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.anchor-nav-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}

.anchor-nav-list,
.anchor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.anchor-nav-list a,
.anchor-list a {
  display: inline-block;
  padding: 6px 0;
  font-size: 14px;
  color: var(--accent);
}

.anchor-nav > a {
  display: inline-block;
  padding: 6px 0;
  font-size: 14px;
}

/* 页面布局：默认主内容在前，aside 在后 */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.page-layout.layout-shell,
.page-layout.layout-main-aside {
  grid-template-columns: minmax(0, 1fr) 300px;
}

/* 侧栏在前的布局 */
.sidebar-left .page-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.page-content,
.layout-main,
.layout-primary {
  min-width: 0;
}

.page-aside,
.layout-aside {
  min-width: 0;
}

/* 侧栏通用块 */
.aside-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.aside-desc,
.aside-text,
.aside-note {
  font-size: 14px;
  color: var(--text-sub);
}

.aside-note {
  margin-top: 14px;
}

.aside-panel,
.aside-block {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.aside-panel + .aside-panel,
.aside-block + .aside-block {
  margin-top: 16px;
}

.aside-toc li + li,
.aside-list li + li {
  margin-top: 4px;
}

.aside-toc a,
.aside-list a {
  display: block;
  padding: 8px 0;
  font-size: 14px;
  color: var(--text-sub);
  border-bottom: 1px dashed var(--line);
}

.aside-toc a:hover,
.aside-list a:hover,
.aside-toc a:focus-visible,
.aside-list a:focus-visible {
  color: var(--accent);
  text-decoration: none;
}

.aside-steps {
  counter-reset: aside-step;
}

.aside-steps li {
  position: relative;
  padding-left: 26px;
  font-size: 14px;
  color: var(--text-sub);
}

.aside-steps li + li {
  margin-top: 10px;
}

.aside-steps li::before {
  counter-increment: aside-step;
  content: counter(aside-step);
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  color: var(--accent);
  background-color: var(--accent-soft);
  border-radius: var(--radius-sm);
}

/* 标签与状态 */
.tag {
  display: inline-block;
  padding: 1px 8px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--accent);
  background-color: var(--accent-soft);
  border-radius: var(--radius-sm);
}

.status {
  display: inline-block;
  padding: 1px 8px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-sub);
  background-color: var(--bg-subtle);
  border-radius: var(--radius-sm);
}

.status-new {
  color: var(--warn);
  background-color: #fbeae1;
}

/* 双栏说明块 */
.rule-columns,
.basis-grid,
.boundary-grid,
.guide-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.rule-col,
.basis-col,
.boundary-col,
.guide-col {
  min-width: 0;
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.rule-col-title,
.basis-col h3,
.boundary-title,
.guide-col-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.rule-list li,
.basis-list li,
.boundary-list li,
.guide-point-list li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  color: var(--text-sub);
}

.rule-list li + li,
.basis-list li + li,
.boundary-list li + li,
.guide-point-list li + li {
  margin-top: 8px;
}

.rule-list li::before,
.basis-list li::before,
.boundary-list li::before,
.guide-point-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 5px;
  height: 5px;
  background-color: var(--accent);
  border-radius: 50%;
}

.guide-point-list {
  margin-bottom: 14px;
}

/* 封面与图片容器 */
.entry-cover,
.rank-cover,
.topic-cover,
.topic-figure,
.hero-figure,
.media-figure {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-color: var(--bg-subtle);
}

.entry-cover img,
.rank-cover img,
.topic-cover img,
.topic-figure img,
.hero-figure img,
.media-figure img,
.update-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
   4. PAGES — 首页、题材分类、最近更新、人气榜单、专题合集、阅读说明、404
   -------------------------------------------------------------------------- */

/* ---------- 首页：顶部事实条 ---------- */
.site-factbar {
  background-color: var(--text-main);
  color: #dfe3e6;
  font-size: 13px;
  text-align: center;
  padding: 8px var(--gutter);
}

/* ---------- 首页：首屏任务面板 ---------- */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 36px var(--gutter) 0;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 32px;
  align-items: start;
}

.hero-main {
  min-width: 0;
}

.hero-kicker {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background-color: var(--accent-soft);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.hero-title {
  font-size: 30px;
  font-weight: 600;
  color: var(--text-main);
  max-width: 20ch;
}

.hero-lead {
  margin-top: 14px;
  max-width: 46ch;
  font-size: 16px;
  color: var(--text-sub);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.hero-side {
  min-width: 0;
}

.hero-figure img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.hero-figure figcaption {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-sub);
  background-color: var(--bg-panel);
  border-top: 1px solid var(--line);
}

.hero-updates {
  margin-top: 16px;
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.hero-updates-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 10px;
}

.hero-update-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.hero-update-item:last-child {
  border-bottom: 0;
}

.hero-update-name {
  color: var(--text-main);
}

.hero-update-meta {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-sub);
}

.hero-updates .link-more {
  margin-top: 10px;
}

/* ---------- 首页：题材分类总览 ---------- */
.genre-row-list {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.genre-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 120px 72px;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.16s ease;
}

.genre-row:last-child {
  border-bottom: 0;
}

.genre-row:hover {
  background-color: var(--bg-subtle);
}

.genre-no {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.genre-body {
  min-width: 0;
}

.genre-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.genre-scope {
  margin-top: 2px;
  font-size: 14px;
  color: var(--text-sub);
}

.genre-count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-sub);
}

.genre-link {
  justify-self: end;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 首页：最近更新记录 ---------- */
.update-day-group {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.update-day-group + .update-day-group {
  margin-top: 14px;
}

.update-day {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.update-day-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 96px;
  gap: 16px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.update-day-item:last-child {
  border-bottom: 0;
}

.update-name {
  color: var(--text-main);
}

.update-genre {
  font-size: 13px;
  color: var(--text-sub);
}

.update-state {
  justify-self: end;
  font-size: 13px;
  color: var(--accent);
}

/* ---------- 首页：人气榜单入口 ---------- */
.rank-list {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.rank-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 110px 72px;
  align-items: center;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.16s ease;
}

.rank-row:last-child {
  border-bottom: 0;
}

.rank-row:hover {
  background-color: var(--bg-subtle);
}

.rank-no {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.rank-name {
  min-width: 0;
  color: var(--text-main);
}

.rank-genre {
  font-size: 13px;
  color: var(--text-sub);
}

.rank-link {
  justify-self: end;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 首页：专题合集入口 ---------- */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.topic-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.16s ease;
}

.topic-card:hover {
  border-color: var(--accent);
}

.topic-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.topic-body {
  padding: 16px;
}

.topic-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
}

.topic-angle {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-sub);
}

.topic-count {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
}

.topic-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 首页：阅读说明与反馈入口 ---------- */
.guide-columns {
  align-items: start;
}

/* ---------- 首页：站内栏目索引 ---------- */
.index-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.index-cell a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color 0.16s ease, color 0.16s ease;
}

.index-cell a:hover,
.index-cell a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

/* ---------- 题材分类页 ---------- */
.genres-aside {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.genre-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: 14px;
}

.genre-table thead th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  background-color: var(--bg-subtle);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.genre-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-sub);
  vertical-align: top;
}

.genre-table tbody tr:last-child td {
  border-bottom: 0;
}

.genre-table tbody tr:hover {
  background-color: var(--bg-subtle);
}

.genre-table td.genre-name {
  font-weight: 600;
  color: var(--text-main);
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.entry-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding-bottom: 14px;
  transition: border-color 0.16s ease;
}

.entry-card:hover {
  border-color: var(--accent);
}

.entry-cover img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.entry-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin: 12px 14px 0;
}

.entry-meta {
  margin: 8px 14px 0;
  font-size: 13px;
  color: var(--text-sub);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tip-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tip-item {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.tip-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.tip-text {
  font-size: 14px;
  color: var(--text-sub);
}

/* ---------- 最近更新页 ---------- */
.update-group {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

.update-group + .update-group {
  margin-top: 14px;
}

.update-date {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.update-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 160px;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}

.update-row:last-child {
  border-bottom: 0;
}

.update-thumb {
  width: 56px;
  height: 74px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
}

.update-body {
  min-width: 0;
}

.update-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.update-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-sub);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.update-row .update-state {
  justify-self: end;
  font-size: 13px;
  color: var(--accent);
}

.rhythm-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.rhythm-item {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.rhythm-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.rhythm-text {
  font-size: 14px;
  color: var(--text-sub);
}

/* ---------- 人气榜单页 ---------- */
.ranking-list {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ranking-item {
  display: grid;
  grid-template-columns: 44px 64px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.16s ease;
}

.ranking-item:last-child {
  border-bottom: 0;
}

.ranking-item:hover {
  background-color: var(--bg-subtle);
}

.rank-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
}

.rank-cover {
  width: 64px;
  height: 84px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--bg-subtle);
}

.rank-body {
  min-width: 0;
}

.rank-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.rank-tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
}

.rank-state {
  font-size: 13px;
  color: var(--accent);
}

.update-note-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.update-note {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.update-note h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.update-note p {
  font-size: 14px;
  color: var(--text-sub);
}

/* ---------- 专题合集页 ---------- */
.topic-list-section .topic-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.topic-meta {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-sub);
}

.topic-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.topic-thumbs img {
  width: 48px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
}

.order-list {
  counter-reset: topic-order;
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 8px 18px;
}

.order-item {
  position: relative;
  padding: 14px 0 14px 34px;
  border-bottom: 1px dashed var(--line);
}

.order-item:last-child {
  border-bottom: 0;
}

.order-item::before {
  counter-increment: topic-order;
  content: counter(topic-order);
  position: absolute;
  left: 0;
  top: 16px;
  width: 22px;
  height: 22px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  color: var(--accent);
  background-color: var(--accent-soft);
  border-radius: var(--radius-sm);
}

.order-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.order-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-sub);
}

.more-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.more-item {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.more-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.more-desc {
  font-size: 14px;
  color: var(--text-sub);
}

/* ---------- 阅读说明页 ---------- */
.guide-aside {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.media-figure img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.media-caption {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-sub);
  background-color: var(--bg-panel);
  border-top: 1px solid var(--line);
}

.field-table {
  margin-top: 20px;
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.field-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.field-row:last-child {
  border-bottom: 0;
}

.field-row-head {
  background-color: var(--bg-subtle);
}

.field-cell {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-sub);
}

.field-name {
  font-weight: 600;
  color: var(--text-main);
  border-right: 1px solid var(--line);
}

.field-row-head .field-cell {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}

.step-list {
  counter-reset: guide-step;
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 8px 18px;
}

.step-item {
  position: relative;
  padding: 14px 0 14px 40px;
  border-bottom: 1px dashed var(--line);
}

.step-item:last-child {
  border-bottom: 0;
}

.step-item::before {
  counter-increment: guide-step;
  content: counter(guide-step);
  position: absolute;
  left: 0;
  top: 16px;
  width: 24px;
  height: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 24px;
  text-align: center;
  color: var(--accent);
  background-color: var(--accent-soft);
  border-radius: var(--radius-sm);
}

.step-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

.step-desc {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-sub);
}

.faq-list {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item:last-child {
  border-bottom: 0;
}

.faq-question {
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "＋";
  float: right;
  font-size: 14px;
  color: var(--accent);
}

.faq-item[open] .faq-question::after {
  content: "－";
}

.faq-question:hover {
  color: var(--accent);
}

.faq-answer {
  padding: 0 18px 16px;
  font-size: 14px;
  color: var(--text-sub);
}

.next-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.next-item {
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.next-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.next-desc {
  font-size: 14px;
  color: var(--text-sub);
}

/* ---------- 404 页 ---------- */
.error-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px var(--gutter) 72px;
}

.error-panel {
  max-width: 620px;
  background-color: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.error-code {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}

.error-panel h1 {
  margin-top: 14px;
  font-size: 26px;
  font-weight: 600;
  color: var(--text-main);
}

.error-desc {
  margin-top: 12px;
  font-size: 15px;
  color: var(--text-sub);
}

.error-hint-list {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.error-hint-list a {
  font-size: 14px;
  font-weight: 600;
}

.error-cta {
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   5. RESPONSIVE — 900px / 600px 两档断点
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 14px;
    margin-left: 0;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list a {
    padding: 12px 10px;
    min-height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .nav-list a.is-current {
    border-bottom-color: var(--accent);
  }

  .header-inner {
    position: relative;
  }

  .hero {
    padding-top: 28px;
  }

  .hero-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .page-layout,
  .page-layout.layout-shell,
  .page-layout.layout-main-aside,
  .sidebar-left .page-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .sidebar-left .page-aside {
    order: 2;
  }

  .sidebar-left .page-content {
    order: 1;
  }

  .entry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .index-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tip-list,
  .rhythm-list,
  .more-list,
  .next-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  :root {
    --gutter: 16px;
  }

  body.site-body {
    font-size: 15px;
  }

  .brand-slogan {
    display: none;
  }

  .page-title {
    font-size: 24px;
  }

  .hero-title {
    font-size: 24px;
    max-width: none;
  }

  .section-title {
    font-size: 20px;
  }

  .section {
    margin-top: 34px;
  }

  .inner-main {
    padding: 20px var(--gutter) 44px;
  }

  .anchor-nav {
    gap: 8px 14px;
    padding: 10px 12px;
  }

  .genre-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 14px;
  }

  .genre-count {
    grid-column: 2;
  }

  .genre-link {
    grid-column: 2;
    justify-self: start;
  }

  .update-day-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .update-state {
    justify-self: start;
  }

  .rank-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 6px 12px;
    padding: 13px 14px;
  }

  .rank-genre {
    grid-column: 2;
  }

  .rank-link {
    grid-column: 2;
    justify-self: start;
  }

  .topic-grid,
  .topic-list-section .topic-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-columns,
  .rule-columns,
  .basis-grid,
  .boundary-grid,
  .update-note-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .index-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .tip-list,
  .rhythm-list,
  .more-list,
  .next-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .update-row {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px 12px;
  }

  .update-thumb {
    width: 48px;
    height: 64px;
  }

  .update-row .update-state {
    grid-column: 2;
    justify-self: start;
  }

  .ranking-item {
    grid-template-columns: 34px 52px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .rank-cover {
    width: 52px;
    height: 68px;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .field-name {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background-color: var(--bg-subtle);
  }

  .step-item {
    padding-left: 34px;
  }

  .footer-top {
    flex-direction: column;
  }

  .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .error-main {
    padding: 40px var(--gutter) 56px;
  }

  .error-panel {
    padding: 24px 18px;
  }

  .error-code {
    font-size: 32px;
  }

  .error-panel h1 {
    font-size: 22px;
  }
}

/* 尊重用户减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
