/* =========================================
   全局设计变量与基础重置
   ========================================= */
:root {
  /* 色板 */
  --color-dark: #371B1B;
  --color-paper: #F5F0E5;
  --color-body: #231515;
  --color-brand: #BA2C2C;
  --color-accent: #ABB6E3;

  /* 结构与尺寸 */
  --radius-card: 24px;
  --radius-btn: 999px;
  --card-border: 1px solid rgba(35, 21, 21, 0.16);
  --card-shadow: none;
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --gap: clamp(1rem, 2vw, 1.75rem);
  --content-max: 1120px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--color-paper);
  color: var(--color-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* =========================================
   排版系统
   ========================================= */
.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.6em;
}
.surface-dark .badge { color: var(--color-accent); }
.surface-light .badge { color: var(--color-brand); }

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: 1.2em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.8em; }
p { margin-bottom: 1em; max-width: 38em; }
.hl { color: var(--color-brand); }
.surface-dark .hl { color: var(--color-accent); }

/* 链接与强调 */
.link-accent { color: var(--color-brand); font-weight: 600; transition: opacity 0.2s; }
.link-accent:hover { opacity: 0.8; }
.surface-dark .link-accent { color: var(--color-accent); }

/* =========================================
   组件：按钮
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  border: none;
}
.btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-dark);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(171, 182, 227, 0.35); }
.btn-secondary {
  background: transparent;
  border: 1px solid var(--color-body);
  color: var(--color-body);
}
.surface-dark .btn-secondary {
  border-color: var(--color-paper);
  color: #231515;
}
.btn-secondary:hover { transform: translateY(-2px); opacity: 0.85; }
.btn-icon { width: 20px; height: 20px; flex-shrink: 0; }

/* =========================================
   组件：卡片与面板
   ========================================= */
.card {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-2px); }
.surface-dark .card { background: rgba(245, 240, 229, 0.08); border-color: rgba(245, 240, 229, 0.12); }
.panel {
  background: var(--color-dark);
  border-radius: var(--radius-card);
  padding: var(--gap);
  position: relative;
  overflow: hidden;
}
.surface-light-panel {
  background: var(--color-paper);
  border: var(--card-border);
  border-radius: var(--radius-card);
  padding: var(--gap);
}

/* =========================================
   组件：表格
   ========================================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius-card); border: var(--card-border); }
table { width: 100%; border-collapse: collapse; min-width: 320px; }
th, td { padding: 12px 16px; text-align: left; border-bottom: var(--card-border); }
th { background: rgba(35, 21, 21, 0.04); font-weight: 600; }
td:first-child { font-weight: 600; width: 35%; }
tr:last-child td { border-bottom: none; }

/* =========================================
   组件：FAQ
   ========================================= */
.faq-list details {
  border: var(--card-border);
  border-radius: 12px;
  margin-bottom: 12px;
  background: var(--color-paper);
  overflow: hidden;
}
.faq-list summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 1.2rem; transition: transform 0.2s; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list .answer { padding: 0 20px 16px; line-height: 1.7; }

/* =========================================
   布局与区块
   ========================================= */
section { padding-top: var(--section-y); padding-bottom: var(--section-y); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--gap); }
.flex-row { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: center; }
.mt-2 { margin-top: 2em; }

/* 图文交错行 */
.row-alt { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: center; }
.row-alt.reverse .text-col { order: 2; }
.row-alt.reverse .visual-col { order: 1; }

/* 步骤徽标 */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--color-accent);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 8px;
  margin-right: 12px;
  flex-shrink: 0;
}

/* 胶囊特性 */
.capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(35, 21, 21, 0.06);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
}
.surface-dark .capsule { background: rgba(245, 240, 229, 0.1); }
.capsule-icon { width: 18px; height: 18px; stroke: currentColor; }

/* =========================================
   页头与页脚
   ========================================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 240, 229, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(35, 21, 21, 0.08);
}
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; object-fit: contain; }
.nav { display: flex; gap: 24px; }
.nav a { font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--color-brand); }
.surface-dark .nav a { color: var(--color-paper); }
.surface-dark .nav a:hover, .surface-dark .nav a[aria-current="page"] { color: var(--color-accent); }

.site-footer {
  padding: 48px 0;
  border-top: 1px solid rgba(35, 21, 21, 0.08);
  margin-top: var(--section-y);
  font-size: 0.9rem;
  color: rgba(35, 21, 21, 0.6);
}
.footer-inner { display: flex; flex-direction: column; gap: 24px; align-items: center; text-align: center; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a { transition: color 0.2s; }
.footer-links a:hover { color: var(--color-brand); }

/* =========================================
   SVG 动效系统
   ========================================= */
svg.animated-svg { width: 100%; height: auto; }
svg.animated-svg path, svg.animated-svg circle, svg.animated-svg rect { transition: all 0.3s ease; }

/* 波浪起伏 */
@keyframes wave-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.wave-line { animation: wave-drift 6s ease-in-out infinite; }
.wave-line:nth-child(2) { animation-delay: -1.5s; }
.wave-line:nth-child(3) { animation-delay: -3s; }
.wave-line:nth-child(4) { animation-delay: -4.5s; }

/* 气泡浮现与漂浮 */
@keyframes bubble-rise {
  0%, 100% { transform: translateY(0); opacity: 0.8; }
  50% { transform: translateY(-8px); opacity: 1; }
}
.msg-bubble { animation: bubble-rise 5s ease-in-out infinite; }
.msg-bubble.delay-1 { animation-delay: -1s; }
.msg-bubble.delay-2 { animation-delay: -2.5s; }

/* 输入呼吸点 */
@keyframes dot-breathe {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}
.typing-dot { animation: dot-breathe 2s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: -0.4s; }
.typing-dot:nth-child(3) { animation-delay: -0.8s; }

/* 描边流动 */
@keyframes dash-flow {
  to { stroke-dashoffset: -1; }
}
.flow-path {
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: dash-flow 4s linear infinite;
}

/* 通知滑入 */
@keyframes notif-slide {
  0%, 100% { transform: translateX(0); opacity: 1; }
  10%, 90% { transform: translateX(4px); opacity: 0.9; }
  50% { transform: translateX(-2px); opacity: 1; }
}
.notif-card { animation: notif-slide 7s 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;
    animation: none !important;
  }
  .wave-line, .msg-bubble, .typing-dot, .flow-path, .notif-card {
    animation: none !important;
  }
}

/* =========================================
   响应式适配
   ========================================= */
@media (max-width: 768px) {
  .row-alt { grid-template-columns: 1fr; }
  .row-alt.reverse .text-col { order: unset; }
  .row-alt.reverse .visual-col { order: unset; }
  .nav { display: none; } /* 移动端简化导航，实际项目可加汉堡菜单 */
  .header-inner .btn { display: none; }
  .header-inner .brand { flex: 1; }
  .grid-3 { grid-template-columns: 1fr; }
}
/* factory-contrast-width */
@layer factory-contrast {
[data-fc="ink"], [data-fc="ink"] * {
  color: #231515 !important;
    -webkit-text-fill-color: #231515 !important;
}
}
