/* ============================================================
   共享样式表 common.css
   基于 we0-ui-design-system.md 设计令牌
   适用于本站全部 17 个页面
   ============================================================ */

/* ---------- 字体加载 ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

@font-face {
  font-family: 'Noto Sans SC';
  src: url('libs/fonts/NotoSansSC.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Serif SC';
  src: url('libs/fonts/NotoSerifSC-Regular.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- 设计令牌 ---------- */
:root {
  /* 颜色 - 背景 */
  --color-bg:           #FAF8F5;   /* 页面主背景 暖白 */
  --color-bg-alt:       #F2EFEA;   /* 次级背景 浅米 */
  --color-surface:      #FFFFFF;   /* 卡片表面 */
  --color-surface-2:    #F7F4EF;   /* 次级卡片 */
  --color-dark:         #1A1A1A;   /* 深色区块 */
  --color-dark-2:       #111111;   /* 更深 */

  /* 颜色 - 文字 */
  --color-text:         #1A1A1A;   /* 主标题 */
  --color-text-body:    #333333;   /* 正文 */
  --color-text-muted:   #6B6B6B;   /* 辅助 */
  --color-text-light:   #8A8A8A;   /* 更弱 */
  --color-text-invert:  #FFFFFF;   /* 深色区块反白 */
  --color-text-invert-2:#E5E5E5;

  /* 颜色 - 强调 */
  --color-accent:       #FF6A2C;   /* 主强调 暖橙 */
  --color-accent-hover: #E85A1C;   /* hover */
  --color-accent-soft:  #FFE8DC;   /* 浅态 */
  --color-accent-2:     #FF4D4D;   /* 渐变末端 暖红 */
  --color-cool:         #0E7C7B;   /* 冷色对比（用于对比类页面） */

  /* 颜色 - 边框 */
  --color-border:       #EDEDED;
  --color-border-strong:#E0E0E0;
  --color-divider:      #EEEEEE;

  /* 字体 */
  --font-sans: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* 字号 */
  --text-h1:    56px;
  --text-h2:    36px;
  --text-h3:    22px;
  --text-h4:    18px;
  --text-body:  16px;
  --text-sm:    14px;
  --text-xs:    12px;

  /* 字重 */
  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold:600;
  --weight-bold:    700;
  --weight-extrabold:800;

  /* 行高 */
  --lh-tight:  1.15;
  --lh-snug:   1.3;
  --lh-normal: 1.6;
  --lh-loose:  1.75;

  /* 字间距 */
  --ls-tight:  -0.02em;
  --ls-snug:   -0.01em;
  --ls-normal: 0;

  /* 圆角 */
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-2xl:  32px;
  --radius-full: 9999px;

  /* 间距 */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.10);
  --shadow-xl: 0 24px 60px rgba(0,0,0,0.12);
  --shadow-glow: 0 0 40px rgba(255,106,44,0.25);

  /* 渐变 */
  --gradient-accent: linear-gradient(135deg, #FF6A2C 0%, #FF4D4D 100%);
  --gradient-dark: linear-gradient(180deg, #1A1A1A 0%, #111111 100%);
  --gradient-bg-soft: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(255,106,44,0.06) 0%, transparent 60%);

  /* 容器 */
  --container-max: 1200px;
  --container-pad: 24px;

  /* 动效 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 200ms;
  --duration-base: 300ms;

  /* 导航 */
  --nav-height: 64px;
}

/* ---------- 基础重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent) var(--color-bg);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--lh-normal);
  color: var(--color-text-body);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg-alt); }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

/* ---------- 排版基础 ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--color-text);
  font-weight: var(--weight-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
}

h1 { font-size: var(--text-h1); font-weight: var(--weight-extrabold); }
h2 { font-size: var(--text-h2); font-weight: var(--weight-bold); letter-spacing: var(--ls-snug); }
h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); letter-spacing: var(--ls-normal); line-height: var(--lh-snug); }
h4 { font-size: var(--text-h4); font-weight: var(--weight-semibold); line-height: var(--lh-snug); }

p { line-height: var(--lh-normal); color: var(--color-text-body); }

a { color: var(--color-accent); text-decoration: none; transition: color var(--duration-fast) var(--ease); }
a:hover { color: var(--color-accent-hover); }

strong, b { font-weight: var(--weight-semibold); color: var(--color-text); }

ul, ol { line-height: var(--lh-normal); }
code, pre { font-family: var(--font-mono); }

/* ---------- 容器 ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  width: 100%;
}

.container-narrow { max-width: 880px; margin: 0 auto; padding: 0 var(--container-pad); }
.container-wide   { max-width: 1360px; margin: 0 auto; padding: 0 var(--container-pad); }

/* ---------- 区块 ---------- */
.section { padding: var(--space-24) 0; }
.section-sm { padding: var(--space-16) 0; }
.section-lg { padding: var(--space-32) 0; }
.section-dark { background: var(--color-dark); color: var(--color-text-invert-2); }
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: var(--color-text-invert); }
.section-alt { background: var(--color-bg-alt); }

.section-title {
  font-size: var(--text-h2);
  text-align: center;
  margin-bottom: var(--space-4);
}
.section-subtitle {
  font-size: var(--text-body);
  color: var(--color-text-muted);
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-12);
}

/* ---------- 统一顶部导航栏 ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--color-border);
}

.site-nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.site-nav-brand {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: var(--weight-bold);
  color: var(--color-text);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: var(--ls-snug);
}
.site-nav-brand:hover { color: var(--color-accent); }
.site-nav-brand .brand-dot { color: var(--color-accent); }

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.site-nav-links::-webkit-scrollbar { display: none; }

.site-nav-links a {
  display: block;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--color-text-body);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease);
}
.site-nav-links a:hover {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}
.site-nav-links a.active {
  color: var(--color-accent);
  font-weight: var(--weight-semibold);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 12px 24px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-dark);
  color: var(--color-text-invert);
}
.btn-primary:hover {
  background: var(--color-dark-2);
  color: var(--color-text-invert);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background: var(--gradient-accent);
  color: var(--color-text-invert);
  box-shadow: 0 4px 14px rgba(255,106,44,0.30);
}
.btn-accent:hover {
  color: var(--color-text-invert);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255,106,44,0.40);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}
.btn-secondary:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
  background: var(--color-bg-alt);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-body);
}
.btn-ghost:hover {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-base) var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-lg { padding: var(--space-8); border-radius: var(--radius-2xl); }
.card-flat { box-shadow: none; }
.card-accent { border-left: 3px solid var(--color-accent); }

/* ---------- 标签 / Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  line-height: 1.4;
}
.badge-dark { background: var(--color-dark); color: var(--color-text-invert); }
.badge-muted { background: var(--color-bg-alt); color: var(--color-text-muted); }

/* ---------- 统一 footer ---------- */
.site-footer {
  background: var(--color-dark);
  color: var(--color-text-invert-2);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: var(--space-24);
}
.site-footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
.site-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}
.site-footer h4 {
  color: var(--color-text-invert);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-4);
  letter-spacing: var(--ls-normal);
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: var(--space-2); }
.site-footer a {
  color: var(--color-text-invert-2);
  font-size: var(--text-sm);
  opacity: 0.78;
}
.site-footer a:hover { color: var(--color-accent); opacity: 1; }
.site-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-invert-2);
  opacity: 0.6;
}
.site-footer-tag {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: var(--weight-bold);
  color: var(--color-text-invert);
  margin-bottom: var(--space-3);
}
.site-footer-tag .brand-dot { color: var(--color-accent); }
.site-footer-desc { font-size: var(--text-sm); line-height: var(--lh-normal); opacity: 0.7; max-width: 320px; }

/* ---------- 通用辅助 ---------- */
.text-center { text-align: center; }
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }
.text-light { color: var(--color-text-light); }
.bg-accent { background: var(--color-accent); color: var(--color-text-invert); }
.bg-soft { background: var(--color-bg-alt); }
.bg-dark { background: var(--color-dark); color: var(--color-text-invert-2); }

.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }

/* ---------- Hero 通用 ---------- */
.hero {
  position: relative;
  padding: var(--space-24) 0 var(--space-16);
  background: var(--color-bg);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255,106,44,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero-title {
  font-size: var(--text-h1);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  color: var(--color-text);
  margin-bottom: var(--space-5);
}
.hero-subtitle {
  font-size: 20px;
  color: var(--color-text-muted);
  line-height: var(--lh-normal);
  max-width: 680px;
  margin-bottom: var(--space-8);
}
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  :root { --text-h1: 44px; --text-h2: 30px; }
  .site-footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --text-h1: 34px; --text-h2: 26px; --text-h3: 20px; --container-pad: 18px; }
  .section { padding: var(--space-16) 0; }
  .section-lg { padding: var(--space-20) 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .site-footer-grid { grid-template-columns: 1fr; }
  .site-footer-bottom { flex-direction: column; align-items: flex-start; }
  .card { padding: var(--space-5); }
  .hero { padding: var(--space-16) 0 var(--space-12); }
  .hero-subtitle { font-size: 17px; }
}
