/* ============================================================
   AI记账宝 · 共享设计系统 site.css
   混合主题：深色 Hero / 深色导航 + 浅色正文
   设计令牌来自 App 真实值，禁止自造颜色
   ============================================================ */

/* ===== 设计令牌（Design Tokens）—— Claude 奶油暖意风 ===== */
:root {
  /* --- 品牌色（保留品牌蓝用于关键数据，主强调改珊瑚橙） --- */
  --primary: #004ac6;
  --primary-container: #2563eb;
  --primary-fixed: #dbe1ff;
  --primary-fixed-dim: #b4c5ff;
  --secondary: #006c49;
  --secondary-container: #6cf8bb;
  --tertiary: #784b00;
  --tertiary-fixed-dim: #ffb95f;
  --error: #ba1a1a;
  --danger: #EF4444;

  /* --- 奶油暖意正文区（Claude 风） --- */
  --bg: #faf9f5;              /* 奶油白，纸质 */
  --surface: #ffffff;         /* 纯白卡片浮起 */
  --surface-2: #f5f0e8;       /* 暖燕麦 */
  --surface-3: #ebe6df;       /* 暖灰 */
  --line: #e6dfd8;            /* 暖发丝线 */
  --line-strong: #d6cec2;     /* 暖强线 */
  --text: #141413;            /* 墨黑 */
  --text-muted: #3d3d3a;      /* 暖灰 */
  --text-faint: #6c6a64;      /* 暖浅灰 */
  --outline: #6c6a64;

  /* --- 深色卡片区（用于截图/数据卡） --- */
  --dark-bg: #1A1614;         /* 深棕黑（非纯黑） */
  --dark-surface: #252019;
  --dark-surface-2: #2f2820;
  --dark-line: rgba(255, 255, 255, .08);
  --dark-line-strong: rgba(255, 255, 255, .14);
  --dark-text: rgba(255, 255, 255, .92);
  --dark-text-muted: #d4c4b0; /* 暖米 */

  /* --- 珊瑚橙强调（CTA/关键交互） --- */
  --coral: #cc785c;
  --coral-deep: #a9583e;
  --coral-soft: #f0ddd4;
  --gold: #E1AD01;            /* 芥末金（图表点缀） */

  /* --- 字体 --- */
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* --- 圆角（暖意风更大更柔） --- */
  --r-control: 14px;
  --r-card: 20px;
  --r-card-lg: 28px;
  --r-sheet: 32px;
  --r-full: 9999px;

  /* --- 阴影（暖意：更柔更浅） --- */
  --shadow-e1: 0 2px 8px rgba(20, 20, 19, .04);
  --shadow-e2: 0 4px 16px rgba(20, 20, 19, .06);
  --shadow-e3: 0 12px 40px rgba(20, 20, 19, .08);
  --shadow-brand: 0 6px 20px rgba(204, 120, 92, .28);
  --shadow-overlay: 0 20px 60px rgba(0, 0, 0, .18);

  /* --- 间距 --- */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-xxl: 32px;
  --sp-huge: 48px;

  /* --- 兼容旧名映射 --- */
  --accent: var(--coral);
  --accent-soft: var(--coral-soft);
  --muted: var(--text-muted);
  --faint: var(--text-faint);
  --panel: var(--surface);
  --panel-2: var(--surface-2);
  --pos: var(--secondary);
  --neg: var(--danger);
  --r-lg: var(--r-card);
  --r-md: var(--r-control);
  --r-sm: 10px;
  --shadow-sm: var(--shadow-e1);
  --shadow-md: var(--shadow-e2);
  --shadow-lg: var(--shadow-e3);
}

/* ===== 基础重置 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  /* 防御：动画/resize 边角情况下的横向溢出兜底（clip 不破坏 sticky） */
  overflow-x: clip;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  padding-top: 64px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul, ol { list-style-position: outside; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }

/* ===== 通用容器：版心 1200px ===== */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap--narrow { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* ===== 排版：标题衬线，正文无衬线（editorial 风） ===== */
h1, h2, h3, h4 { color: var(--text); letter-spacing: 0; line-height: 1.25; font-weight: 600; font-family: var(--font-serif); }
h1 { font-size: 56px; font-weight: 500; letter-spacing: -0.02em; }
h2 { font-size: 36px; font-weight: 500; letter-spacing: -0.01em; }
h3 { font-size: 20px; font-weight: 600; font-family: var(--font-sans); }
h4 { font-size: 16px; font-weight: 600; font-family: var(--font-sans); }
@media (max-width: 767px) {
  h1 { font-size: 36px; }
  h2 { font-size: 26px; }
}
p { margin-bottom: 14px; }
p:last-child { margin-bottom: 0; }
strong, b { font-weight: 600; }
small { font-size: 0.85em; }

/* ===== 分区：padding 80px（移动 56px），hairline 分隔 ===== */
section { padding: 56px 0; }
@media (min-width: 768px) {
  section { padding: 80px 0; }
}
main > section ~ section { border-top: 1px solid var(--line); }

/* ===== 顶部导航（全站深色毛玻璃） ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 30;
  background: rgba(250, 249, 245, .78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0;
  color: var(--text);
  transition: opacity 0.18s ease;
}
.logo:hover { opacity: 0.85; }
.logo img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex: none;
}
.nav-links {
  display: none;
  gap: 28px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}
.nav-links a {
  position: relative;
  padding: 4px 0;
  transition: color 0.18s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}
.nav-links a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -20px;
  height: 2px;
  background: var(--coral);
  border-radius: 1px;
}
@media (min-width: 768px) {
  .nav-links { display: flex; }
}

/* 移动端菜单按钮（nav.js 注入） */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.nav-toggle:hover { background: var(--surface-2); border-color: var(--line-strong); }
@media (min-width: 768px) { .nav-toggle { display: none; } }
.nav-menu-mobile {
  display: none;
  padding: 12px 24px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 249, 245, .96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.nav-menu-mobile.open { display: block; }
.nav-menu-mobile a {
  display: block;
  padding: 10px 0;
  font-size: 15px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
  transition: color 0.18s ease;
}
.nav-menu-mobile a:last-child { border-bottom: 0; }
.nav-menu-mobile a:hover { color: var(--text); }
@media (min-width: 768px) { .nav-menu-mobile { display: none !important; } }

/* ===== 回到顶部按钮 ===== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(250, 249, 245, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 25;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: rgba(250, 249, 245, .98);
  border-color: var(--line-strong);
}
@media (max-width: 767px) {
  .back-to-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}

/* ===== Footer（奶油底） ===== */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 44px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--surface);
}
.foot-in {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: center;
  justify-content: space-between;
}
.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
}
.foot-brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.foot-links a { color: var(--text-muted); transition: color 0.18s ease; }
.foot-links a:hover { color: var(--text); }
.foot-copy { color: var(--dark-text-muted); opacity: 0.7; }

/* ===== 奶油头段（子页面顶部，与首页 Hero 呼应） ===== */
.page-head-dark {
  background: var(--bg);
  color: var(--text);
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 767px) {
  .page-head-dark { padding: 36px 0 32px; }
}
.page-head-dark .breadcrumb {
  padding: 0 0 14px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}
.page-head-dark .breadcrumb a { color: var(--text-muted); transition: color 0.18s ease; }
.page-head-dark .breadcrumb a:hover { color: var(--text); }
.page-head-dark .breadcrumb span.sep {
  margin: 0 8px;
  color: var(--text-muted);
  opacity: 0.6;
}
.page-head-dark .breadcrumb .current { color: var(--text); font-weight: 600; }
.page-head-dark .eyebrow { color: var(--coral); }
.page-head-dark h1 {
  color: var(--text);
  font-size: 40px;
  letter-spacing: -0.02em;
  font-weight: 500;
  line-height: 1.25;
  font-family: var(--font-serif);
}
@media (max-width: 767px) {
  .page-head-dark h1 { font-size: 30px; }
}
.page-head-dark p {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 16px;
  max-width: 38em;
  line-height: 1.7;
}
.page-head-dark .updated {
  margin-top: 10px;
  color: var(--text-muted);
  opacity: 0.7;
  font-size: 14px;
}

/* ===== 兼容旧面包屑（已迁入 page-head-dark 内时使用深色；裸用则浅色） ===== */
.breadcrumb {
  padding: 24px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}
.breadcrumb a { color: var(--text-muted); transition: color 0.18s ease; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span.sep {
  margin: 0 8px;
  color: var(--text-faint);
  opacity: 0.7;
}
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ===== 通用浅色页面头（保留兼容，子页面已迁 page-head-dark） ===== */
.page-head { padding: 32px 0 24px; }
.page-head h1 {
  font-size: 40px;
  letter-spacing: 0;
  font-weight: 600;
  line-height: 1.25;
}
@media (max-width: 767px) {
  .page-head h1 { font-size: 30px; }
}
.page-head p {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 16px;
  max-width: 38em;
  line-height: 1.7;
}
.page-head .updated {
  margin-top: 10px;
  color: var(--text-faint);
  font-size: 14px;
}

/* ===== 章节标题（首页分区，居中） ===== */
.sec-head { text-align: center; }
.sec-head h2 { font-size: 32px; }
@media (max-width: 767px) {
  .sec-head h2 { font-size: 26px; }
}
.sec-head p {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 16px;
  max-width: 38em;
  margin-left: auto;
  margin-right: auto;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ===== 通用卡片（浅色：白卡 + hairline + e1） ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 24px;
  box-shadow: var(--shadow-e1);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}
.card:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-e2);
}

/* ===== 通用按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--r-control);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease, box-shadow 0.18s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--text-faint); }
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--coral);
  border-color: var(--coral);
  color: #ffffff;
  box-shadow: var(--shadow-brand);
}
.btn--primary:hover {
  background: var(--coral-deep);
  border-color: var(--coral-deep);
  box-shadow: 0 8px 20px rgba(204, 120, 92, .36);
}
.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover { background: var(--surface-2); border-color: var(--text-faint); }
/* 深色 Hero 内的 ghost：深色边框 + 深色字 */
.btn--ghost-dark {
  background: transparent;
  border-color: var(--dark-line-strong);
  color: var(--dark-text);
}
.btn--ghost-dark:hover {
  background: var(--dark-surface);
  border-color: var(--dark-text-muted);
}
.btn[aria-disabled="true"] { pointer-events: none; opacity: 0.72; }

/* ===== 链接样式 ===== */
.link {
  color: var(--primary);
  font-weight: 600;
  transition: color 0.18s ease;
}
.link:hover { color: var(--primary-container); text-decoration: underline; text-underline-offset: 3px; }
.link-arrow::after {
  content: " →";
  transition: transform 0.18s ease;
  display: inline-block;
}
.link-arrow:hover::after { transform: translateX(2px); }

/* ===== 标签 / Chip ===== */
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.chip--brand {
  color: var(--primary);
  background: var(--primary-fixed);
  border-color: var(--primary-fixed-dim);
}

/* ===== 提示框 ===== */
.callout {
  background: var(--primary-fixed);
  border: 1px solid var(--primary-fixed-dim);
  border-radius: var(--r-control);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 15px;
  color: var(--text);
  line-height: 1.7;
}
.callout strong { color: var(--primary); font-weight: 600; }
.callout--warn {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.30);
}
.callout--warn strong { color: var(--danger); }

/* ===== 相关链接卡片（多页面共用） ===== */
.related { padding: 0 0 64px; }
.related h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: 0;
}
.related-links {
  display: grid;
  gap: 12px;
}
@media (min-width: 768px) {
  .related-links { grid-template-columns: 1fr 1fr; }
}
.related-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  box-shadow: var(--shadow-e1);
  transition: border-color 0.18s ease, transform 0.15s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.related-links a:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  background: var(--surface-2);
  box-shadow: var(--shadow-e2);
}
.related-links svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex: none;
}

/* ===== 文章正文（about / faq / features / privacy / terms 共用） ===== */
.article {
  padding: 8px 0 56px;
  max-width: 720px;   /* 正文行宽 ≤ 720px */
}
.article h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0;
  margin-top: 40px;
  margin-bottom: 14px;
  color: var(--text);
}
.article h3 {
  font-size: 18px;
  font-weight: 600;
  margin-top: 26px;
  margin-bottom: 10px;
  color: var(--text);
}
.article p {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.article p.lead {
  color: var(--text);
  font-size: 17px;
  line-height: 1.7;
  font-weight: 400;
}
.article ul, .article ol {
  margin-bottom: 16px;
  padding-left: 22px;
}
.article li {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 8px;
  line-height: 1.7;
}
.article a {
  color: var(--primary);
  font-weight: 600;
  transition: color 0.18s ease;
}
.article a:hover { color: var(--primary-container); text-decoration: underline; text-underline-offset: 3px; }
.article strong { color: var(--text); font-weight: 600; }

/* ===== 步骤卡片（features 页面共用，浅色） ===== */
.steps {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-control);
  padding: 18px 22px;
  box-shadow: var(--shadow-e1);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.step:hover { border-color: var(--line-strong); background: var(--surface-2); box-shadow: var(--shadow-e2); }
.step .n {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.step h3 { margin-top: 6px; font-size: 17px; color: var(--text); }
.step p { margin-bottom: 0; font-size: 15px; color: var(--text-muted); }

/* ===== 减弱动效 ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== 响应式微调 ===== */
@media (max-width: 767px) {
  .wrap, .wrap--narrow { padding: 0 20px; }
  .nav-in { padding: 0 20px; }
  .foot-in { padding: 0 20px; }
}
