/* ============================================================
   book.whatapps-fgd.com.cn — 共享设计系统 & 全局样式
   浅色编辑风 · 克制中性灰阶 · 衬线标题 / 无衬线正文
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  --bg-page: #f7f8fa;
  --bg-surface: #ffffff;
  --bg-elevated: #fafbfc;

  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --border-subtle: #e5e7eb;
  --border-focus: #008069;

  --brand: #008069;
  --brand-hover: #006d5a;
  --brand-light: #ecfdf5;

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 5.5rem;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);

  --font-serif: 'Georgia', 'Noto Serif SC', 'Source Han Serif CN', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
  --max-content: 1120px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.2s ease; }
ul, ol { list-style: none; }

/* ---------- 排版系统 ---------- */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 2.5vw, 2.75rem); margin-bottom: var(--space-md); }
h2 { font-size: clamp(1.5rem, 2vw, 2rem); margin-bottom: var(--space-lg); }
h3 { font-size: clamp(1.15rem, 1.5vw, 1.35rem); margin-bottom: var(--space-sm); }
p { margin-bottom: var(--space-md); color: var(--text-secondary); }
small { font-size: 0.875rem; color: var(--text-muted); }

.container { width: 100%; max-width: var(--max-content); margin: 0 auto; padding: 0 var(--space-lg); }
.section { padding: var(--space-3xl) 0; }
.section-alt { background: var(--bg-surface); border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-subtle); }

/* ---------- 布局组件 ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: var(--space-xl); align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--space-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--space-lg); }

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.card-header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.card-icon { width: 24px; height: 24px; stroke: var(--brand); flex-shrink: 0; }

/* ---------- 按钮 & 链接 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  padding: 0.75rem 1.5rem; border-radius: var(--radius-md); font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all 0.2s ease; font-family: inherit;
}
.btn:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-outline { background: transparent; border-color: var(--border-subtle); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.link-arrow { display: inline-flex; align-items: center; gap: var(--space-2xs); color: var(--brand); font-weight: 500; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- 表格 ---------- */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: var(--space-md); text-align: left; border-bottom: 1px solid var(--border-subtle); }
th { background: var(--bg-elevated); font-weight: 600; color: var(--text-primary); white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td { color: var(--text-secondary); }

/* ---------- FAQ (Details/Summary) ---------- */
.faq-list { display: flex; flex-direction: column; gap: var(--space-md); }
details {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg); transition: box-shadow 0.2s ease;
}
details[open] { box-shadow: var(--shadow-card); }
summary { cursor: pointer; font-weight: 600; color: var(--text-primary); list-style: none; display: flex; align-items: center; justify-content: space-between; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ''; width: 12px; height: 12px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg) translateY(-2px); transition: transform 0.2s ease; flex-shrink: 0; }
details[open] summary::after { transform: rotate(-45deg) translateY(-2px); }
details p { margin-top: var(--space-sm); color: var(--text-secondary); }

/* ---------- 页头 & 页脚 ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-subtle); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: var(--space-sm); font-family: var(--font-serif); font-weight: 700; font-size: 1.1rem; color: var(--text-primary); }
.brand img { height: 32px; width: auto; object-fit: contain; }
.nav { display: flex; gap: var(--space-xl); }
.nav a { font-size: 0.95rem; font-weight: 500; color: var(--text-secondary); padding: var(--space-xs) 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--brand); border-color: var(--brand); }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: var(--space-xs); }
.mobile-toggle svg { width: 24px; height: 24px; stroke: var(--text-primary); }

.site-footer { background: var(--bg-elevated); border-top: 1px solid var(--border-subtle); padding: var(--space-2xl) 0 var(--space-lg); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-xl); margin-bottom: var(--space-xl); }
.footer-col h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: var(--space-md); color: var(--text-primary); }
.footer-col ul { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-col a { font-size: 0.9rem; color: var(--text-muted); }
.footer-col a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--border-subtle); padding-top: var(--space-lg); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-md); font-size: 0.85rem; color: var(--text-muted); }

/* ---------- SVG 动效核心规则 ---------- */
.svg-anim { overflow: visible; }
.orbit-ring { fill: none; stroke-linecap: round; transform-box: fill-box; transform-origin: center; }
.draw-path { pathLength: 1; stroke-dasharray: 1; stroke-dashoffset: 0; }

@keyframes orbitBreathe {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.04); opacity: 1; }
}
@keyframes orbitDraw {
  0%, 100% { stroke-dashoffset: 1; opacity: 0.4; }
  50% { stroke-dashoffset: 0; opacity: 1; }
}
.anim-breathe { animation: orbitBreathe 8s ease-in-out infinite; }
.anim-breathe-delay { animation: orbitBreathe 8s ease-in-out infinite 2s; }
.anim-draw { animation: orbitDraw 6s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .anim-breathe, .anim-breathe-delay, .anim-draw { animation: none !important; transform: scale(1); opacity: 0.8; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-toggle { display: block; }
  .nav.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); padding: var(--space-md); gap: var(--space-md); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: var(--space-2xl) 0; }
}
