/* ============================================================
   base.css —— 设计变量 / 重置 / 排版 / 全局工具
   Longlivepeople.cn · 人民万岁 · 为人民服务
   ============================================================ */

:root {
  /* 主色板：中国红 + 金 + 象牙白 */
  --red-900: #6d0b16;
  --red-800: #8f0f1e;
  --red-700: #a5192e;
  --red-600: #c8102e;
  --red-500: #e0243c;
  --gold-600: #b8860b;
  --gold-500: #d4a537;
  --gold-400: #f0c060;
  --gold-300: #ffe0a0;
  --ink-900: #14060a;
  --ink-800: #1f0a10;
  --ink-700: #2b0e16;
  --cream: #f7f1e6;
  --cream-dim: #e8ddc9;
  --white: #ffffff;

  /* 字体栈（系统字体，无外部依赖） */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", "WenQuanYi Micro Hei",
    sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC",
    "Source Han Serif SC", Georgia, serif;

  /* 尺寸 */
  --container: 1200px;
  --header-h: 64px;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-red: 0 10px 34px rgba(200, 16, 46, 0.35);

  /* 过渡 */
  --ease-out: cubic-bezier(0.22, 0.8, 0.26, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.44, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--cream);
  background: var(--ink-900);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.3;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: 0.04em;
}

p { margin: 0 0 1em; }

a {
  color: var(--gold-400);
  text-decoration: none;
  transition: color 0.25s var(--ease-out);
}
a:hover { color: var(--gold-300); }

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul { margin: 0; padding: 0; list-style: none; }

::selection {
  background: var(--red-600);
  color: var(--white);
}

/* 焦点可见性（无障碍） */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-800); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--red-700), var(--red-800));
  border-radius: 8px;
}

/* ---------- 容器与栅格 ---------- */
.container {
  width: min(var(--container), 100% - 2.4rem);
  margin-inline: auto;
}

.section {
  position: relative;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0;
}

.section-head {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3.4rem);
}

.section-head h2 {
  font-size: clamp(1.8rem, 4.5vw, 2.9rem);
  margin-bottom: 0.35em;
}

.section-head .sub {
  color: var(--cream-dim);
  opacity: 0.85;
  font-size: clamp(0.95rem, 2.2vw, 1.12rem);
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- 排版装饰 ---------- */
/* 流光渐变文字 */
.text-shimmer {
  background: linear-gradient(
    100deg,
    var(--gold-300) 0%,
    var(--gold-400) 22%,
    var(--white) 38%,
    var(--gold-400) 54%,
    var(--gold-300) 76%,
    var(--gold-400) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmer-slide 7s linear infinite;
}

@keyframes shimmer-slide {
  0% { background-position: 220% 0; }
  100% { background-position: -220% 0; }
}

/* 金色小徽记 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.38em 1.15em;
  border: 1px solid rgba(240, 192, 96, 0.45);
  border-radius: 999px;
  color: var(--gold-400);
  font-size: 0.86rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  background: rgba(240, 192, 96, 0.08);
  backdrop-filter: blur(4px);
}

.eyebrow::before,
.eyebrow::after {
  content: "★";
  font-size: 0.7em;
  color: var(--red-500);
}

/* 标题下划线金纹 */
.gold-rule {
  width: 84px;
  height: 3px;
  margin: 1.1rem auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-400), transparent);
  position: relative;
}
.gold-rule::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--red-500);
  box-shadow: 0 0 12px rgba(224, 36, 60, 0.9);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 0.85em 2.1em;
  border-radius: 999px;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-out),
    background-color 0.3s, color 0.3s;
  will-change: transform;
}

.btn-primary {
  color: var(--white);
  background: linear-gradient(135deg, var(--red-600), var(--red-800));
  box-shadow: var(--shadow-red), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(200, 16, 46, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: var(--white);
}

.btn-ghost {
  color: var(--gold-300);
  border: 1px solid rgba(240, 192, 96, 0.55);
  background: rgba(240, 192, 96, 0.07);
}
.btn-ghost:hover {
  transform: translateY(-3px);
  background: rgba(240, 192, 96, 0.16);
  color: var(--gold-300);
  box-shadow: 0 14px 34px rgba(212, 165, 55, 0.25);
}

.btn:active { transform: translateY(0) scale(0.98); }

/* ---------- 工具类 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 300;
  padding: 0.7em 1.3em;
  background: var(--red-600);
  color: #fff;
  border-radius: 0 0 10px 10px;
  transition: top 0.3s;
}
.skip-link:focus { top: 0; }

.text-center { text-align: center; }
.muted { color: var(--cream-dim); opacity: 0.78; }

/* 分隔：红绸渐变带 */
.silk-divider {
  height: 6px;
  border: none;
  margin: 0;
  background: linear-gradient(
    90deg,
    transparent,
    var(--red-700) 18%,
    var(--gold-500) 50%,
    var(--red-700) 82%,
    transparent
  );
  opacity: 0.65;
}

/* 章节背景光晕 */
.glow-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1100px 480px at 12% -10%, rgba(165, 25, 46, 0.22), transparent 62%),
    radial-gradient(900px 420px at 92% 110%, rgba(212, 165, 55, 0.12), transparent 62%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
}
