/* =========================================================
   揉我胸中文网 · 揉我胸视界
   共享站点样式 / Site Kit
   ========================================================= */

/* ---- 1. 变量与重置 ---- */
:root {
  color-scheme: dark;

  /* 品牌色彩体系 */
  --bg-page: #1E1E28;
  --bg-section-a: #2A2A35;
  --bg-section-b: #3D3D4A;
  --bg-card: #F5F0E6;
  --bg-card-accent: #FFD8B0;
  --accent-yellow: #FFD700;
  --accent-teal: #00CED1;
  --accent-orange: #FF8C00;
  --status-new: #FF4500;
  --status-update: #FF8C00;
  --status-done: #32CD32;
  --text-light: #F0F0F0;
  --text-dark: #1E1E28;
  --line-border: #666677;

  /* 字体 */
  --font-head: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font-body: "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* 间距 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* 阴影与圆角 */
  --shadow-sm: 2px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-card: 4px 4px 0 rgba(0, 0, 0, 0.35);
  --shadow-lg: 8px 8px 0 rgba(0, 0, 0, 0.4);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* 版心 */
  --container-w: 1440px;

  /* 粘性头部偏移 */
  --header-offset: 96px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--bg-page);
  color: var(--text-light);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
}

img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-teal);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

ul,
ol {
  list-style: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent-yellow);
  outline-offset: 2px;
}

.site-nav :focus-visible {
  outline-color: var(--accent-teal);
}

/* ---- 2. 版心与工具类 ---- */
.container {
  width: 100%;
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#main-content {
  scroll-margin-top: calc(var(--header-offset) + var(--sp-4));
}

/* ---- 3. 跳过链接 ---- */
.skip-link {
  position: fixed;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 1000;
  background: var(--accent-yellow);
  color: var(--text-dark);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 0.9rem;
  padding: var(--sp-2) var(--sp-4);
  border: 3px solid var(--text-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  transform: translateY(calc(-100% - var(--sp-7)));
  transition: transform 0.2s ease;
}

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

/* ---- 4. 滚动进度条 ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-yellow) 0%, var(--accent-teal) 100%);
  z-index: 900;
  pointer-events: none;
}

/* ---- 5. 头部 ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 700;
  background: var(--bg-page);
  border-bottom: 4px solid var(--text-dark);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.header-upper {
  background: var(--bg-page);
}

.header-upper-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 480px) auto;
  align-items: center;
  gap: var(--sp-4) var(--sp-5);
  padding-block: var(--sp-3);
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--text-light);
}

.brand-glyph {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--accent-yellow);
  color: var(--text-dark);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.5rem;
  border: 3px solid var(--text-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--text-light);
  white-space: nowrap;
}

.brand-subtitle {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--accent-teal);
  letter-spacing: 0.12em;
}

.brand-vertical {
  writing-mode: vertical-rl;
  max-height: 48px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--line-border);
  border-left: 2px solid var(--line-border);
  padding-left: var(--sp-1);
  margin-left: var(--sp-1);
  overflow: hidden;
  white-space: nowrap;
}

/* 检索 */
.header-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--bg-section-a);
  border: 2px solid var(--line-border);
  border-radius: var(--radius-sm);
  padding: 0 var(--sp-3);
  height: 44px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-search:focus-within {
  border-color: var(--accent-yellow);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.25);
}

.search-glyph {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  display: inline-block;
}

.search-glyph::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--accent-teal);
  border-radius: 50%;
}

.search-glyph::after {
  content: "";
  position: absolute;
  bottom: 1px;
  right: 0;
  width: 6px;
  height: 2px;
  background: var(--accent-teal);
  transform: rotate(45deg);
}

.search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 0.875rem;
  height: 100%;
}

.search-input::placeholder {
  color: #8a8a99;
}

.search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search-input:focus {
  outline: none;
}

/* 头部信息 */
.header-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  justify-content: flex-end;
}

.batch-stamp {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-light);
  background: var(--bg-section-a);
  border: 1px dashed var(--line-border);
  padding: var(--sp-1) var(--sp-3);
  white-space: nowrap;
}

.batch-dot {
  width: 8px;
  height: 8px;
  background: var(--status-done);
  border-radius: 50%;
}

.header-version {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--line-border);
  white-space: nowrap;
}

/* 导航带 */
.site-nav {
  background: var(--accent-yellow);
  border-top: 3px solid var(--text-dark);
  border-bottom: 4px solid var(--text-dark);
}

.nav-track {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--text-dark);
  text-decoration: none;
  border-left: 2px solid rgba(0, 0, 0, 0.15);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:first-child {
  border-left: none;
}

.nav-link-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding-inline: var(--sp-1);
  background: var(--text-dark);
  color: var(--accent-yellow);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 3px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  background: var(--text-dark);
  color: var(--accent-yellow);
}

.nav-link:hover .nav-link-index,
.nav-link[aria-current="page"] .nav-link-index {
  background: var(--accent-yellow);
  color: var(--text-dark);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  pointer-events: none;
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  background: var(--nav-accent, var(--accent-teal));
}

.nav-link:nth-child(1) { --nav-accent: var(--accent-teal); }
.nav-link:nth-child(2) { --nav-accent: var(--accent-orange); }
.nav-link:nth-child(3) { --nav-accent: var(--status-done); }
.nav-link:nth-child(4) { --nav-accent: var(--accent-orange); }
.nav-link:nth-child(5) { --nav-accent: var(--status-new); }
.nav-link:nth-child(6) { --nav-accent: var(--accent-teal); }

.nav-vol {
  margin-left: auto;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: rgba(30, 30, 40, 0.65);
  border: 1px solid rgba(30, 30, 40, 0.4);
  padding: 2px var(--sp-2);
  white-space: nowrap;
}

/* 导航检索降噪 */
.nav-link.is-dimmed {
  opacity: 0.35;
  filter: grayscale(0.6);
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--accent-yellow);
  border: 3px solid var(--text-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  padding: 0;
}

.nav-toggle:hover {
  background: var(--bg-card-accent);
}

.toggle-lines {
  display: block;
}

.toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-dark);
  margin: 3px auto;
  border-radius: 1px;
}

/* 返回顶部 */
.back-top {
  position: fixed;
  right: var(--sp-5);
  bottom: var(--sp-5);
  z-index: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--accent-yellow);
  color: var(--text-dark);
  font-size: 1.2rem;
  font-weight: 900;
  border: 3px solid var(--text-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.back-top:hover {
  background: var(--accent-teal);
  transform: translateY(-2px);
}

.back-top[hidden] {
  display: none;
}

/* ---- 6. 页脚 ---- */
.site-footer {
  flex-shrink: 0;
  background: var(--bg-section-a);
  border-top: 4px solid var(--text-dark);
  margin-top: var(--sp-8);
}

.footer-color-strip {
  height: 6px;
  background: linear-gradient(
    90deg,
    var(--accent-yellow) 0%,
    var(--accent-yellow) 16.6%,
    var(--accent-teal) 16.6%,
    var(--accent-teal) 33.2%,
    var(--bg-card-accent) 33.2%,
    var(--bg-card-accent) 49.8%,
    var(--status-done) 49.8%,
    var(--status-done) 66.4%,
    var(--status-new) 66.4%,
    var(--status-new) 83%,
    var(--line-border) 83%,
    var(--line-border) 100%
  );
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1.2fr;
  gap: var(--sp-6);
  padding-block: var(--sp-7);
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--text-light);
}

.footer-brand-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent-yellow);
  color: var(--text-dark);
  font-size: 1.2rem;
  font-weight: 900;
  border: 3px solid var(--text-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.footer-brand-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

.footer-tagline {
  font-size: 0.78rem;
  color: var(--line-border);
  font-family: var(--font-mono);
}

.footer-archive-no {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-teal);
  border: 1px dashed var(--line-border);
  padding: var(--sp-1) var(--sp-2);
}

.footer-nav {
  min-width: 0;
}

.footer-heading {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--accent-yellow);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--line-border);
  text-transform: uppercase;
}

.footer-link-list li {
  margin-bottom: var(--sp-2);
}

.footer-link-list a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-link-list a:hover {
  color: var(--accent-teal);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-contact {
  min-width: 0;
}

.footer-address {
  font-style: normal;
}

.contact-row {
  display: block;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: var(--sp-2);
  line-height: 1.5;
  word-break: break-all;
}

.footer-bottom {
  background: var(--bg-page);
  border-top: 2px solid var(--line-border);
  padding-block: var(--sp-4);
}

.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #a0a0ad;
}

/* ---- 7. 页面常见区块 ---- */
.site-section {
  padding-block: var(--sp-7);
}

.page-header {
  padding-block: var(--sp-8) var(--sp-6);
  border-bottom: 2px solid var(--line-border);
  margin-bottom: var(--sp-6);
}

.page-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.2;
  color: var(--text-light);
  margin-bottom: var(--sp-2);
}

.page-intro {
  max-width: 680px;
  font-size: 0.95rem;
  color: #a0a0ad;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  border-bottom: 2px solid var(--line-border);
  padding-bottom: var(--sp-2);
}

.section-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  line-height: 1.3;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background: var(--accent-yellow);
  border: 2px solid var(--text-dark);
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.section-link-more {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-teal);
  text-decoration: none;
  white-space: nowrap;
}

.section-link-more:hover {
  text-decoration: underline;
}

/* ---- 8. 面包屑 ---- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--line-border);
  margin-bottom: var(--sp-5);
}

.breadcrumb-item + .breadcrumb-item::before {
  content: "/";
  color: var(--line-border);
  margin-right: var(--sp-2);
}

.breadcrumb-item a {
  color: var(--accent-teal);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  text-decoration: underline;
}

.breadcrumb-item[aria-current="page"] {
  color: var(--accent-yellow);
  font-weight: 700;
}

/* ---- 9. 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-5);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: var(--accent-yellow);
  border: 3px solid var(--text-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--accent-teal);
  transform: translate(-1px, -1px);
}

.btn-dark {
  background: var(--text-dark);
  color: var(--accent-yellow);
}

.btn-dark:hover {
  background: var(--bg-section-b);
}

/* ---- 10. 卡片网格 ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
}

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

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

.card {
  position: relative;
  background: var(--bg-card);
  color: var(--text-dark);
  border: 2px solid var(--text-dark);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--sp-5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

.card-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: var(--sp-2);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--line-border);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid rgba(0, 0, 0, 0.15);
}

.card-link {
  text-decoration: none;
  color: var(--text-dark);
}

.card-link:hover .card-title {
  text-decoration: underline;
  text-decoration-color: var(--accent-teal);
  text-underline-offset: 4px;
}

/* ---- 11. 磁贴矩阵 ---- */
.tile-matrix {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(110px, auto);
  gap: var(--sp-4);
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--bg-section-a);
  color: var(--text-light);
  border: 3px solid var(--text-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  min-height: 110px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tile:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

.tile-featured {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 220px;
  background: var(--bg-card);
  color: var(--text-dark);
}

.tile-skin-accent { background: var(--bg-card-accent); color: var(--text-dark); }
.tile-skin-yellow { background: var(--accent-yellow); color: var(--text-dark); }
.tile-skin-teal { background: var(--accent-teal); color: var(--text-dark); }
.tile-skin-dark-b { background: var(--bg-section-b); color: var(--text-light); }
.tile-skin-new { background: var(--status-new); color: var(--text-dark); }

.tile-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.05rem;
  line-height: 1.35;
}

.tile-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.75;
}

/* ---- 12. 条目列表 ---- */
.entry-list {
  border: 2px solid var(--text-dark);
  border-radius: var(--radius-md);
  background: var(--bg-section-a);
  overflow: hidden;
}

.entry-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-light);
  text-decoration: none;
  border-bottom: 1px solid var(--line-border);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.entry-row:last-child {
  border-bottom: none;
}

.entry-row:hover {
  background: var(--accent-yellow);
  color: var(--text-dark);
}

.entry-index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-teal);
  text-align: center;
}

.entry-row:hover .entry-index {
  color: var(--text-dark);
}

.entry-title {
  font-weight: 700;
  font-size: 0.92rem;
}

.entry-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--line-border);
  display: flex;
  gap: var(--sp-2);
  white-space: nowrap;
}

.entry-row:hover .entry-meta {
  color: var(--text-dark);
}

/* ---- 13. 标签与角标 ---- */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.tag-chip {
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: var(--bg-section-b);
  color: var(--text-light);
  border: 1px solid var(--line-border);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag-chip:hover {
  background: var(--accent-teal);
  color: var(--text-dark);
  border-color: var(--text-dark);
}

.tag-chip-hot {
  background: var(--accent-yellow);
  color: var(--text-dark);
  border-color: var(--text-dark);
  font-weight: 700;
}

.tag-chip-warm {
  background: var(--bg-card-accent);
  color: var(--text-dark);
  border-color: var(--text-dark);
}

.tag-chip-green {
  background: var(--status-done);
  color: var(--text-dark);
  border-color: var(--text-dark);
}

.tag-chip-red {
  background: var(--status-new);
  color: var(--text-dark);
  border-color: var(--text-dark);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  border: 1px solid var(--text-dark);
  border-radius: 3px;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}

.badge-new {
  background: var(--status-new);
  color: var(--text-dark);
}

.badge-updating {
  background: var(--status-update);
  color: var(--text-dark);
}

.badge-complete {
  background: var(--status-done);
  color: var(--text-dark);
}

.index-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  background: var(--text-dark);
  color: var(--accent-yellow);
  border: 2px solid var(--text-dark);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.index-num-teal {
  background: var(--accent-teal);
  color: var(--text-dark);
}

.index-num-orange {
  background: var(--accent-orange);
  color: var(--text-dark);
}

.index-num-red {
  background: var(--status-new);
  color: var(--text-dark);
}

/* ---- 14. 指标条 ---- */
.metric-row {
  display: grid;
  grid-template-columns: 40px minmax(120px, 1fr) minmax(100px, 200px) 48px;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-border);
}

.metric-rank {
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--accent-yellow);
}

.metric-name {
  font-size: 0.9rem;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-bar-wrap {
  height: 10px;
  background: var(--bg-section-b);
  border: 1px solid var(--line-border);
  border-radius: 2px;
  overflow: hidden;
}

.metric-bar-fill {
  display: block;
  height: 100%;
  width: var(--fill-width, 50%);
  background: linear-gradient(90deg, var(--accent-teal), var(--accent-yellow));
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-light);
  text-align: right;
}

/* ---- 15. 索引条 ---- */
.index-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-family: var(--font-mono);
}

.index-strip-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 var(--sp-2);
  background: var(--bg-section-b);
  color: var(--text-light);
  text-decoration: none;
  border: 2px solid var(--text-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.index-strip-link:hover {
  background: var(--accent-yellow);
  color: var(--text-dark);
}

.index-strip-link[aria-current="true"],
.index-strip-link.is-active {
  background: var(--accent-teal);
  color: var(--text-dark);
  font-weight: 700;
}

/* ---- 16. 横向滑轨 ---- */
.track-scroll {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  padding-bottom: var(--sp-3);
  scroll-snap-type: x mandatory;
}

.track-scroll > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.track-scroll > .card {
  width: 280px;
}

.track-scroll > .tile {
  width: 240px;
}

/* ---- 17. 对照表格 ---- */
.table-wrap {
  overflow-x: auto;
  border: 2px solid var(--text-dark);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  background: var(--bg-section-a);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 560px;
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-section-b);
  color: var(--accent-yellow);
  border-bottom: 2px solid var(--text-dark);
  white-space: nowrap;
}

.data-table td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line-border);
  color: var(--text-light);
}

.data-table tr:hover td {
  background: rgba(255, 215, 0, 0.12);
}

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

/* ---- 18. 纵向旁注 ---- */
.vertical-note {
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  color: var(--accent-teal);
  text-transform: uppercase;
  max-height: 140px;
  overflow: hidden;
}

/* ---- 19. 平板适配 ---- */
@media (max-width: 1024px) {
  .header-upper-grid {
    grid-template-columns: minmax(220px, 1fr) minmax(200px, 320px) auto;
    gap: var(--sp-3);
  }

  .brand-vertical {
    display: none;
  }

  .header-version {
    display: none;
  }

  .nav-link {
    padding: var(--sp-2) var(--sp-3);
    font-size: 0.85rem;
  }

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

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-5);
  }
}

/* ---- 20. 手机适配 ---- */
@media (max-width: 768px) {
  .container {
    padding-inline: var(--sp-4);
  }

  .header-upper-grid {
    grid-template-columns: 1fr auto;
    padding-block: var(--sp-3);
  }

  .header-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .batch-stamp {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
  }

  .site-nav[data-open] {
    display: block;
  }

  .nav-track {
    flex-direction: column;
  }

  .nav-link {
    width: 100%;
    border-left: none;
    border-bottom: 2px solid rgba(0, 0, 0, 0.2);
    padding: var(--sp-3) var(--sp-4);
  }

  .nav-link:first-child {
    border-left: none;
  }

  .nav-link::after {
    bottom: -2px;
    height: 2px;
  }

  .nav-vol {
    display: none;
  }

  .card-grid,
  .card-grid-3,
  .card-grid-2,
  .tile-matrix {
    grid-template-columns: 1fr;
  }

  .tile-featured {
    grid-column: span 1;
    grid-row: span 1;
    min-height: 140px;
  }

  .entry-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
  }

  .entry-meta .entry-category {
    display: none;
  }

  .metric-row {
    grid-template-columns: 32px minmax(100px, 1fr) 44px;
  }

  .metric-bar-wrap {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
  }

  .back-top {
    right: var(--sp-4);
    bottom: var(--sp-4);
  }
}

/* ---- 21. 小屏适配 ---- */
@media (max-width: 480px) {
  .brand-title {
    font-size: 1rem;
  }

  .brand-subtitle {
    font-size: 0.62rem;
  }

  .brand-glyph {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .header-meta {
    gap: var(--sp-2);
  }

  .tile-matrix {
    grid-auto-rows: minmax(100px, auto);
  }
}

/* ---- 22. 减少动效 ---- */
@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;
  }

  .card,
  .tile,
  .btn,
  .back-top,
  .nav-link,
  .nav-link-index,
  .entry-row,
  .tag-chip,
  .index-strip-link {
    transform: none !important;
    transition: none !important;
  }
}
