/* 稳心 SteadyHeart 官网样式（由 theme.py 生成，请勿手改）。
   移动优先、WCAG AA 对比度、语义化、支持 prefers-color-scheme。*/
:root {
  --teal: #14758F;
  --teal-soft: #E8F7FA;
  --orange: #EB6B0A;
  --danger: #C72929;
  --ink: #1B2B30;
  --bg: #ffffff;
  --surface: #f4fafb;
  --border: #d3e3e7;
  --text: #1B2B30;
  --heading: #1B2B30;
  --text-muted: #48606a;
  --link: #0f5d73;
  --accent-text: #14758F;
  --on-accent: #ffffff;
  --secondary-button-bg: #1B2B30;
  --disabled-bg: #dbe6e9;
  --disabled-text: #5c6b70;
  --footer-bg: #1B2B30;
  --footer-text: #d7e2e5;
  --footer-muted: #a9bcc1;
  --footer-link: #bfe6ef;
  --footer-border: #33474d;
  --callout-bg: #E8F7FA;
  --focus: #b8480a;
  --radius: 16px;
  --maxw: 1080px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans", "Noto Sans CJK SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.3; color: var(--heading); }
h1 { font-size: 1.9rem; margin: 0 0 .6em; }
h2 { font-size: 1.4rem; margin: 1.8em 0 .5em; }
h3 { font-size: 1.15rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li { margin: .3em 0; }
.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: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--teal); color: var(--on-accent); padding: 12px 18px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* --- 页头 --- */
.site-header {
  background: var(--bg); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); margin-right: auto; }
.logo-mark { width: 38px; height: 38px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 1.15rem; }
.brand-tagline { font-size: .74rem; color: var(--text-muted); }
.header-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.main-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.main-nav a { text-decoration: none; color: var(--text); font-weight: 500; padding: 6px 2px; }
.main-nav a[aria-current="page"] { color: var(--accent-text); border-bottom: 2px solid var(--accent-text); }
.lang-switcher { display: flex; gap: 6px; align-items: center; }
.lang-link {
  text-decoration: none; font-size: .85rem; padding: 5px 9px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-muted); min-height: 32px;
  display: inline-flex; align-items: center;
}
.lang-link.is-active { background: var(--teal); color: var(--on-accent); border-color: var(--teal); }
.nav-toggle { display: none; }

/* --- 正文 --- */
.site-main { padding: 32px 0 56px; }
.site-main .wrap { max-width: 820px; }
.site-main.full .wrap { max-width: var(--maxw); }

/* 免责横幅 */
.disclaimer-banner {
  max-width: 820px; margin: 0 auto 28px; padding: 14px 18px;
  background: #fff4e6; border: 1px solid #f2c48a; border-left: 5px solid var(--orange);
  border-radius: 12px; display: flex; gap: 12px; align-items: flex-start;
}
.disclaimer-banner p { margin: 0; font-size: .95rem; }
.disclaimer-icon { color: var(--orange); font-size: 1.3rem; line-height: 1.4; }

/* --- 首页板块 --- */
.hero { background: linear-gradient(160deg, var(--teal-soft), #ffffff); border-bottom: 1px solid var(--border); }
.hero-inner { padding: 48px 20px 40px; text-align: center; }
.hero h1 { font-size: 2.3rem; }
.hero .lede { font-size: 1.2rem; color: var(--text-muted); max-width: 640px; margin: 0 auto 1.2em; }
.hero .positioning {
  display: inline-block; background: #fff; border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 18px; font-size: .95rem; color: var(--accent-text);
}
.section { padding: 40px 0; }
.section.alt { background: var(--surface); }
.section > .wrap > h2 { text-align: center; margin-top: 0; }
.grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.card h3 { margin-top: 0; color: var(--accent-text); }
.card p { margin-bottom: 0; color: var(--text-muted); }
.card .card-icon { font-size: 1.6rem; }

/* 下载按钮 */
.downloads { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px;
  border-radius: 12px; font-weight: 600; text-decoration: none; min-height: 48px;
}
.btn-primary { background: var(--teal); color: var(--on-accent); }
.btn-primary:hover { background: #0f5d73; color: var(--on-accent); }
.btn-secondary { background: var(--secondary-button-bg); color: var(--on-accent); }
.btn-secondary:hover { color: var(--on-accent); opacity: .92; }
.btn.is-disabled { background: var(--disabled-bg); color: var(--disabled-text); cursor: default; pointer-events: none; }
.btn-note { font-size: .85rem; color: var(--text-muted); text-align: center; margin-top: 10px; }

/* 长文（法务/隐私）*/
.legal .meta { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5em; }
.legal h2 { border-top: 1px solid var(--border); padding-top: 1em; }
.legal .toc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; }
.legal .toc ul { margin: .3em 0 0; }
table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .95rem; }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--surface); }
.callout { background: var(--callout-bg); border-radius: 12px; padding: 14px 18px; margin: 1em 0; }

/* FAQ */
details { border: 1px solid var(--border); border-radius: 12px; padding: 4px 16px; margin: 10px 0; background: var(--bg); }
details[open] { background: var(--surface); }
summary { cursor: pointer; font-weight: 600; padding: 10px 0; }

/* 页脚 */
.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 40px; }
.site-footer a { color: var(--footer-link); }
.site-footer h2 { font-size: 1rem; color: var(--on-accent); margin: 0 0 .6em; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; padding: 40px 20px 20px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: .4em 0; }
.footer-brand .logo-mark { width: 46px; height: 46px; }
.footer-disclaimer { font-size: .85rem; color: var(--footer-muted); margin-top: 10px; }
.footer-operator { font-size: .82rem; color: var(--footer-muted); }
.footer-bottom { border-top: 1px solid var(--footer-border); padding: 16px 20px; font-size: .82rem; color: var(--footer-muted); }

/* 404 */
.notfound { text-align: center; padding: 60px 20px; }

@media (min-width: 700px) {
  .grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* 移动端汉堡 */
@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--bg); cursor: pointer;
  }
  .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    content: ""; display: block; width: 20px; height: 2px; background: var(--heading); position: relative;
  }
  .nav-toggle-bar::before { position: absolute; top: -6px; }
  .nav-toggle-bar::after { position: absolute; top: 6px; }
  .header-nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: 12px; }
  .header-nav.is-open { display: flex; }
  .main-nav { flex-direction: column; gap: 10px; }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10191c; --surface: #16242a; --border: #2c4148; --text: #e7f0f2;
    --heading: #eaf4f6; --text-muted: #b8cbd0; --link: #8cdeef; --accent-text: #8cdeef;
    --secondary-button-bg: #356b78; --disabled-bg: #26363c; --disabled-text: #b6c5c9;
    --footer-bg: #0b1215; --footer-text: #d7e2e5; --footer-muted: #b8c7cb;
    --footer-link: #8cdeef; --footer-border: #3a5057; --callout-bg: #17333b;
  }
  body { background: var(--bg); color: var(--text); }
  h1, h2, h3 { color: var(--heading); }
  .hero { background: linear-gradient(160deg, #14323a, #10191c); }
  .hero .positioning { background: #16242a; color: var(--accent-text); }
  .card, details, .btn.is-disabled { background: #16242a; }
  .card h3 { color: var(--accent-text); }
  .disclaimer-banner { background: #3a2a12; border-color: #7a5217; color: #f4e4cc; }
  .lang-link.is-active { background: var(--teal); color: var(--on-accent); }
  .site-header { background: var(--bg); }
  th { background: #16242a; }
}

/* 高对比度偏好 */
@media (prefers-contrast: more) {
  :root { --text-muted: var(--text); --border: #000; }
  a { text-decoration: underline; }
}

@media (prefers-color-scheme: dark) and (prefers-contrast: more) {
  :root { --border: #ffffff; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
