:root {
  --cream: #F5F1E8;
  --deep-gray-blue: #2B3A4A;
  --dark-purple: #3D2B4F;
  --card-orange: #E7583A;
  --card-green: #39B58A;
  --card-yellow: #F5C242;
  --accent-orange: #FF6B4A;
  --status-green: #2ECC71;
  --status-red: #E74C3C;
  --status-gray: #7F8C8D;
  --text-dark: #222222;
  --text-light: #FFFFFF;
  --border-light: #D5CCB8;
  --tag-blue: #3498DB;
  --tag-purple: #9B59B6;
  --font-headline: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", monospace;
  --container-max: 1280px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-card: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-raised: 0 12px 28px rgba(0, 0, 0, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--text-dark);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headline);
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

ul, ol {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-orange);
}

:focus-visible {
  outline: 3px solid var(--accent-orange);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  background: var(--dark-purple);
  color: var(--text-light);
  padding: 8px 24px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 3000;
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateX(-50%) translateY(0);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.btn-primary {
  background: var(--accent-orange);
  color: var(--text-light);
}

.btn-primary:hover {
  background: var(--card-orange);
  color: var(--text-light);
}

.btn-ghost {
  background: transparent;
  border-color: currentColor;
  color: currentColor;
}

.btn-ghost:hover {
  background: currentColor;
  color: var(--cream);
}

/* 头部 */
.site-header {
  background: var(--deep-gray-blue);
  color: var(--text-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-md);
  line-height: 1.2;
}

.brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--card-yellow);
  color: var(--dark-purple);
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: 1.4rem;
  border-radius: 14px;
  box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.2);
}

.brand__name {
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.brand__sub {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--card-yellow);
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--dark-purple);
  border: 2px solid var(--card-yellow);
  color: var(--text-light);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  position: relative;
}

.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  position: absolute;
  left: 0;
}

.nav-toggle__bar::before {
  top: -5px;
}

.nav-toggle__bar::after {
  top: 5px;
}

.header-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-list__item {
  margin: 0;
}

.nav-link {
  display: inline-block;
  color: var(--text-light);
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 16px;
  border-radius: 999px;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--card-yellow);
}

.nav-link[aria-current="page"] {
  background: var(--card-yellow);
  color: var(--deep-gray-blue);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  .header-nav {
    position: fixed;
    top: 72px;
    right: 16px;
    width: 260px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    background: var(--dark-purple);
    border: 2px solid var(--card-yellow);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-raised);
    padding: 12px;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 2000;
  }

  .header-nav[data-open] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .nav-link {
    display: block;
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  .brand__sub {
    display: none;
  }

  .header-nav {
    right: 12px;
    left: 12px;
    width: auto;
  }
}

/* 页脚 */
.site-footer {
  background: var(--text-dark);
  color: var(--text-light);
  font-family: var(--font-body);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
  padding-top: 56px;
  padding-bottom: 48px;
}

.brand--footer {
  color: var(--text-light);
}

.brand--footer .brand__logo {
  background: var(--card-green);
  color: var(--text-dark);
}

.footer-icp {
  font-family: var(--font-mono);
  color: var(--border-light);
  font-size: 0.85rem;
  margin: 16px 0 8px;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  color: var(--border-light);
}

.footer-contact a:hover {
  color: var(--card-yellow);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.footer-links__title {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--card-yellow);
  margin-bottom: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-links__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links__list a {
  color: var(--text-light);
  font-size: 0.95rem;
  display: inline-block;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.footer-links__list a:hover {
  color: var(--card-yellow);
  border-bottom-color: var(--card-yellow);
}

.footer-bottom {
  background: #151515;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 0;
}

.footer-bottom__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: #aaa;
}

.footer-bottom__note {
  font-family: var(--font-mono);
  color: #aaa;
}

@media (max-width: 700px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-links {
    grid-template-columns: 1fr 1fr;
  }

  .footer-bottom__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 通用区块与版面工具 */
.section-band {
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  margin-bottom: 24px;
}

.section-band--darkgray {
  background: var(--deep-gray-blue);
  color: var(--text-light);
}

.section-band--darkpurple {
  background: var(--dark-purple);
  color: var(--text-light);
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}

.section-title__index {
  font-family: var(--font-mono);
  color: var(--accent-orange);
  font-size: 0.85rem;
}

.section-title__name {
  font-size: 1.6rem;
  margin: 0;
}

.section-title__extra {
  margin-left: auto;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.section-title--dark .section-title__name {
  color: var(--text-dark);
}

.section-title--dark .section-title__extra {
  color: var(--text-dark);
  opacity: 0.7;
}

/* 网格 */
.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 960px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* 卡片墙 */
.card-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.media-card {
  background: var(--card-yellow);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;
}

.media-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-raised);
}

.media-card:nth-child(3n + 2) {
  background: var(--card-green);
}

.media-card:nth-child(3n) {
  background: var(--card-orange);
}

.media-card__cover {
  aspect-ratio: 16 / 10;
  background: var(--deep-gray-blue);
  border-radius: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

.media-card__cover--green {
  background: var(--card-green);
}

.media-card__cover--orange {
  background: var(--card-orange);
}

.media-card__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.media-card__title {
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0;
}

.media-card__meta {
  font-size: 0.82rem;
  color: rgba(0, 0, 0, 0.72);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-family: var(--font-mono);
  margin-top: auto;
}

/* 磁贴矩阵 */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.tile {
  background: var(--card-orange);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  color: var(--text-light);
  position: relative;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s, background-color 0.2s;
}

.tile:nth-child(3n + 2) {
  background: var(--card-green);
  color: var(--text-dark);
}

.tile:nth-child(3n) {
  background: var(--card-yellow);
  color: var(--text-dark);
}

.tile:hover {
  transform: scale(1.02);
}

.tile__label {
  font-family: var(--font-headline);
  font-weight: 900;
  font-size: 1rem;
}

.tile__count {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  padding: 2px 8px;
  border-radius: 999px;
  align-self: flex-start;
}

/* 条目列表行 */
.list-table {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--cream);
}

.list-table__row {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.2s;
  min-width: 0;
}

.list-table__row:last-child {
  border-bottom: none;
}

.list-table__row:hover {
  background: rgba(245, 194, 66, 0.2);
}

.row-index {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-orange);
  font-size: 1rem;
}

.row-title {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tag-blue);
  color: var(--text-light);
  white-space: nowrap;
}

.tag--purple {
  background: var(--tag-purple);
}

.tag--yellow {
  background: var(--card-yellow);
  color: var(--text-dark);
}

.tag--darklight {
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
}

/* 状态徽标 */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  background: var(--status-gray);
  color: var(--text-light);
}

.status-badge--updated {
  background: var(--status-green);
}

.status-badge--hot {
  background: var(--status-red);
}

.status-badge--finished {
  background: var(--status-gray);
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* 指标条 */
.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 16px 0;
}

.metric {
  background: var(--cream);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  min-width: 130px;
  border-left: 6px solid var(--accent-orange);
}

.metric__value {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.1;
}

.metric__label {
  font-size: 0.85rem;
  color: var(--text-dark);
  opacity: 0.75;
}

.metric--dark {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border-left-color: var(--card-yellow);
}

.metric--dark .metric__label {
  color: var(--text-light);
}

/* 索引条 */
.index-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0;
}

.index-bar__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: background-color 0.2s, color 0.2s;
}

.index-bar__item:hover {
  background: var(--card-yellow);
  color: var(--text-dark);
}

.index-bar__item.is-current {
  background: var(--card-yellow);
  color: var(--deep-gray-blue);
  font-weight: 700;
}

.index-bar--dark .index-bar__item {
  background: var(--cream);
  color: var(--text-dark);
}

.index-bar--dark .index-bar__item:hover,
.index-bar--dark .index-bar__item.is-current {
  background: var(--accent-orange);
  color: var(--text-light);
}

/* 横向滑轨容器 */
.rail-track {
  overflow: hidden;
  margin: 0 -24px;
  padding: 0 24px;
}

.rail-track__inner {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 16px;
}

.rail-track__inner > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 240px;
}

/* 内容工具条 */
.content-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-tool {
  background: transparent;
  border: 2px solid var(--deep-gray-blue);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  color: var(--deep-gray-blue);
}

.btn-tool:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.btn-tool.is-active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
  color: var(--text-light);
}

/* 普通正文容器 */
.prose {
  max-width: 720px;
  font-size: 1rem;
  line-height: 1.8;
}

.prose h2 {
  font-size: 1.4rem;
  margin-top: 2em;
}

.prose h3 {
  font-size: 1.15rem;
  margin-top: 1.5em;
}

.prose ul {
  margin: 1em 0 1em 1.2em;
}

.prose li {
  list-style: disc;
  margin-bottom: 0.3em;
}

/* 面包屑 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  padding: 12px 0;
}

.breadcrumb a {
  color: var(--deep-gray-blue);
  font-weight: 500;
}

.breadcrumb a:hover {
  color: var(--accent-orange);
}

.breadcrumb__sep {
  color: var(--border-light);
}

/* 时间轴 */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.timeline-group {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.06);
  border-left: 6px solid var(--card-yellow);
  padding: 20px;
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card-yellow);
  color: var(--text-dark);
  font-weight: 900;
  font-family: var(--font-headline);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.85rem;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.1);
}

.timeline-badge__count {
  background: var(--dark-purple);
  color: var(--text-light);
  border-radius: 999px;
  padding: 1px 10px;
  font-family: var(--font-mono);
}

.timeline-items {
  margin-top: 16px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  transition: background-color 0.2s;
}

.timeline-item:hover {
  background: rgba(245, 194, 66, 0.12);
}

.timeline-item__title {
  font-weight: 700;
}

.timeline-item__meta {
  margin-left: auto;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}

/* 对照表 */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
}

.spec-table th,
.spec-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--font-body);
}

.spec-table th {
  background: rgba(0, 0, 0, 0.2);
  font-family: var(--font-headline);
  font-weight: 900;
}

.spec-table tr:last-child td {
  border-bottom: none;
}

/* 返回顶部 */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-orange);
  color: var(--text-light);
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1200;
  box-shadow: var(--shadow-raised);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s, background-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--card-orange);
}
