/* =========================================================
   爱赢官网 · 共享样式 /assets/site.css
   骨架：侧边轨道导航 + 蓝图网格 + 玻璃层/纸白层并置
   ========================================================= */

/* ---------- 1. 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ol, ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
}

img,
svg,
video,
picture {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

a {
  color: inherit;
}

/* ---------- 2. 变量 ---------- */
:root {
  /* 品牌色 */
  --red: #D7261E;
  --red-deep: #8F1512;
  --red-bright: #FF5A4E;
  --ink: #0B1220;
  --ink-2: #16233A;
  --line: #24344F;
  --gold: #E8B344;
  --gold-soft: #F6E3B4;
  --paper: #F7F6F3;
  --paper-2: #E5E2DB;
  --black: #08090C;
  --muted: #6B7A90;
  --ok: #2FA98C;

  /* 尺幅 */
  --rail-w: 220px;
  --bar-h: 64px;
  --pad: clamp(18px, 4vw, 64px);
  --maxw: 1240px;

  /* 字体 */
  --font-sans: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, "Courier New", monospace;
}

::selection {
  background: var(--red);
  color: #fff;
}

/* ---------- 3. 中文排版基线 ---------- */
body {
  min-height: 100%;
  background-color: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  padding-left: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(40px, 6vw, 96px);
  line-height: 1.02;
}

h2 {
  font-size: clamp(28px, 3.6vw, 48px);
}

h3 {
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 500;
  letter-spacing: -0.01em;
}

p {
  max-width: 34em;
}

strong,
b {
  font-weight: 900;
}

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

/* ---------- 4. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--gold);
  color: var(--black);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 2px;
  transform: translateY(-240%);
  transition: transform 180ms ease-out;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

/* ---------- 5. 侧边轨道页头 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 26px 18px 22px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background-color: var(--ink);
  background-image:
    linear-gradient(180deg, rgba(11, 18, 32, 0.94) 0%, rgba(22, 35, 58, 0.94) 100%),
    linear-gradient(to right, rgba(36, 52, 79, 0.85) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(36, 52, 79, 0.85) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.read-progress {
  position: fixed;
  top: 0;
  left: var(--rail-w);
  width: 0;
  height: 3px;
  z-index: 90;
  background: linear-gradient(90deg, var(--red-bright), var(--gold));
  pointer-events: none;
}

/* 品牌 */
.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--paper);
}

.brand__glyph {
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  background: var(--red);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  border-radius: 2px;
  box-shadow: inset 0 -3px 0 var(--red-deep);
  transition: transform 200ms ease;
}

.brand:hover .brand__glyph {
  transform: scale(1.03);
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.brand__name {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.brand__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--gold);
}

/* 移动菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--paper);
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.nav-toggle:hover {
  border-color: var(--red-bright);
  background: rgba(255, 255, 255, 0.06);
}

.nav-toggle__bars {
  display: grid;
  gap: 4px;
  width: 18px;
}

.nav-toggle__bars i {
  display: block;
  height: 1.5px;
  background: var(--paper);
  transition: transform 200ms ease;
}

.site-header[data-open] .nav-toggle__bars i:first-child {
  transform: translateY(2.75px) rotate(45deg);
}

.site-header[data-open] .nav-toggle__bars i:last-child {
  transform: translateY(-2.75px) rotate(-45deg);
}

/* 轨道导航 */
.rail-nav {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.rail-nav__caption {
  max-width: none;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.rail-nav__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
}

.rail-nav__item {
  list-style: none;
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-left: 2px solid transparent;
  color: var(--paper);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.rail-link__idx {
  flex: 0 0 22px;
  width: 22px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.rail-link__label {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.rail-link:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.04);
  border-left-color: var(--red-bright);
}

.rail-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.rail-link[aria-current="page"] {
  opacity: 1;
  background: rgba(215, 38, 30, 0.16);
  border-left-color: var(--red);
}

.rail-link[aria-current="page"] .rail-link__label {
  font-weight: 900;
}

/* 账户区入口块 */
.rail-nav__foot {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.account-block {
  position: relative;
  display: block;
  padding: 13px 14px 15px;
  overflow: hidden;
  border-radius: 2px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  text-decoration: none;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.account-block::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transform: rotate(45deg);
  pointer-events: none;
}

.account-block__idx {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  opacity: 0.85;
}

.account-block__title {
  display: block;
  margin-top: 3px;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.account-block__note {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.85;
}

.account-block:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(215, 38, 30, 0.3);
}

.account-block:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- 6. 移动端抽屉 ---------- */
@media (max-width: 1023px) {
  body {
    padding-top: var(--bar-h);
  }

  .site-header {
    top: 0;
    right: 0;
    bottom: auto;
    left: 0;
    width: 100%;
    height: var(--bar-h);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    padding: 0 16px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background-image: linear-gradient(180deg, rgba(11, 18, 32, 0.97), rgba(22, 35, 58, 0.97));
    background-size: auto;
  }

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

  .rail-nav {
    position: fixed;
    top: var(--bar-h);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    flex: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 22px 20px 34px;
    border-top: 1px solid var(--line);
    background-color: var(--ink);
    background-image:
      linear-gradient(180deg, rgba(11, 18, 32, 0.96), rgba(22, 35, 58, 0.96)),
      linear-gradient(to right, rgba(36, 52, 79, 0.8) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(36, 52, 79, 0.8) 1px, transparent 1px);
    background-size: auto, 32px 32px, 32px 32px;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1), visibility 220ms;
  }

  .site-header[data-open] .rail-nav {
    transform: translateX(0);
    visibility: visible;
  }

  .rail-link {
    padding: 14px 12px;
    border-left-width: 3px;
  }

  .rail-link__label {
    font-size: 17px;
  }

  .rail-nav__foot {
    margin-top: 30px;
  }

  .read-progress {
    left: 0;
  }

  body.nav-open {
    overflow: hidden;
  }
}

@media (min-width: 1024px) {
  body {
    padding-left: var(--rail-w);
  }
}

/* ---------- 7. 容器与网格 ---------- */
.container {
  width: min(calc(100% - 2 * var(--pad)), var(--maxw));
  margin-inline: auto;
}

.section {
  padding-block: clamp(48px, 8vw, 110px);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}

@media (max-width: 900px) {
  .grid-12 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .grid-12 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- 8. 文字组件 ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.kicker::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--gold);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: clamp(24px, 4vw, 44px);
}

.section-title {
  max-width: 22ch;
  font-size: clamp(30px, 4vw, 56px);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.section-title strong,
.section-title b {
  font-weight: 900;
}

.lead {
  max-width: 34em;
  font-size: 17px;
  line-height: 1.85;
  color: var(--paper);
}

.muted-text {
  color: var(--muted);
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

/* ---------- 9. 面板层 ---------- */
.surface {
  position: relative;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(22, 35, 58, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.surface--paper {
  background: var(--paper);
  border-color: var(--paper-2);
  color: var(--black);
}

.surface--paper h1,
.surface--paper h2,
.surface--paper h3,
.surface--paper h4 {
  color: var(--black);
}

.surface--paper p {
  color: #2A3040;
}

.surface--paper .kicker {
  color: var(--red-deep);
}

.surface--paper .kicker::before {
  background: var(--red-deep);
}

/* ---------- 10. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(232, 179, 68, 0.34);
  border-radius: 999px;
  background: rgba(232, 179, 68, 0.14);
  color: var(--gold-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.tag--ok {
  border-color: rgba(47, 169, 140, 0.34);
  background: rgba(47, 169, 140, 0.14);
  color: #9BE7D5;
}

.tag--red {
  border-color: rgba(255, 90, 78, 0.34);
  background: rgba(215, 38, 30, 0.16);
  color: #FFC9C4;
}

/* ---------- 11. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.btn--primary {
  background: var(--red);
  color: #fff;
}

.btn--primary:hover {
  background: var(--red-bright);
  transform: translateY(-1px);
}

.btn--ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--paper);
}

.btn--ghost:hover {
  border-color: var(--red-bright);
  color: #fff;
}

.btn--paper {
  background: var(--paper);
  color: var(--black);
}

.btn--paper:hover {
  background: var(--gold-soft);
}

/* ---------- 12. 面包屑 ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--line);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

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

.breadcrumb [aria-current="page"] {
  color: var(--gold);
}

/* ---------- 13. 图片容器 ---------- */
.figure {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--ink-2);
}

.figure > img,
.figure > svg,
.figure > picture,
.figure > canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.figure--16-9 {
  aspect-ratio: 16 / 9;
}

.figure--4-3 {
  aspect-ratio: 4 / 3;
}

.figure--1-1 {
  aspect-ratio: 1 / 1;
}

.figure--3-4 {
  aspect-ratio: 3 / 4;
}

.figure__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(8, 9, 12, 0.72);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.figure__caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- 14. 章节索引 ---------- */
.toc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc__title {
  max-width: none;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.toc-link {
  display: block;
  padding: 7px 0 7px 12px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease;
}

.toc-link:hover {
  color: var(--paper);
}

.toc-link[aria-current="true"] {
  color: var(--gold);
  border-left-color: var(--gold);
}

/* ---------- 15. 显现 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 240ms ease-out, transform 240ms ease-out;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 16. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(48px, 8vw, 110px);
  padding: clamp(38px, 6vw, 76px) var(--pad) 26px;
  border-top: 1px solid var(--line);
  background-color: var(--black);
  background-image:
    linear-gradient(to right, rgba(36, 52, 79, 0.5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(36, 52, 79, 0.5) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--paper);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 180px;
  height: 2px;
  background: var(--red);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: clamp(24px, 3vw, 48px);
}

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

.footer-brand {
  max-width: none;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.footer-claim {
  max-width: 26ch;
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--paper);
}

.footer-index {
  max-width: none;
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.footer-col__title {
  max-width: none;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 9px;
  list-style: none;
}

.footer-links li {
  list-style: none;
}

.footer-links a {
  color: var(--paper);
  font-size: 14.5px;
  line-height: 1.6;
  text-decoration: none;
  opacity: 0.78;
  transition: opacity 180ms ease, color 180ms ease;
}

.footer-links a:hover {
  opacity: 1;
  color: var(--red-bright);
}

.footer-meta {
  max-width: 30ch;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  word-break: break-word;
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 28px;
  margin-top: clamp(32px, 4vw, 56px);
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.footer-copy,
.footer-icp {
  max-width: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

@media (max-width: 900px) {
  .site-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .site-footer__base {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- 17. 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
