/* SmartCalcu 官网样式。色板与间距取自 apps/design/smartcalcu.tokens.json，
   保证官网视觉与 App 内一致。纯 CSS，无构建步骤。 */

:root {
  --brand: #6c7cff;
  --brand-deep: #4c5ce6;
  --brand-soft: #e9ecff;
  --accent: #ff7aa2;
  --success: #4cd4a0;

  --bg-top: #f7f8ff;
  --bg-bottom: #eff1ff;
  --surface: #ffffff;
  --surface-muted: #f3f5ff;

  --text-strong: #1d2340;
  --text-default: #3b4267;
  --text-muted: #7a80a6;
  --text-faint: #b8bdda;
  --border: #e1e4f5;

  --radius-card: 24px;
  --radius-control: 14px;
  --shadow-card: 0 12px 24px rgba(70, 76, 187, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-soft: 0 4px 10px rgba(70, 76, 187, 0.06);

  --max-width: 1080px;
  --max-width-doc: 780px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(760px 420px at 12% -10%, rgba(162, 180, 255, 0.2), transparent 70%),
    radial-gradient(720px 400px at 92% 4%, rgba(245, 164, 255, 0.18), transparent 70%),
    linear-gradient(160deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  color: var(--text-default);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

a {
  color: var(--brand-deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  color: var(--text-strong);
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin: 0 0 12px;
}

h1 {
  font-size: 40px;
  font-weight: 800;
}

h2 {
  font-size: 26px;
  font-weight: 800;
}

h3 {
  font-size: 19px;
  font-weight: 700;
}

p {
  margin: 0 0 14px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ---------- 布局容器 ---------- */

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.wrap-doc {
  max-width: var(--max-width-doc);
}

/* ---------- 顶栏 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 248, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(225, 228, 245, 0.8);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-strong);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 10px;
}

.nav a:hover {
  color: var(--brand-deep);
  background: var(--brand-soft);
  text-decoration: none;
}

.nav a[aria-current="page"] {
  color: var(--brand-deep);
  background: var(--brand-soft);
}

.lang-switch {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-deep);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 5px 12px;
  border-radius: 999px;
}

.lang-switch:hover {
  text-decoration: none;
  border-color: var(--brand);
}

/* ---------- 首页 Hero ---------- */

.hero {
  padding: 72px 0 40px;
  text-align: center;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(32px, 6vw, 52px);
  font-weight: 900;
  letter-spacing: -1px;
}

.hero .lede {
  max-width: 640px;
  margin: 0 auto 28px;
  font-size: 18px;
  color: var(--text-muted);
}

.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 26px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 18px rgba(108, 124, 255, 0.2);
}

.btn-primary:hover {
  background: var(--brand-deep);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text-default);
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}

/* ---------- 通用区块 ---------- */

.section {
  padding: 44px 0;
}

.section-head {
  text-align: center;
  margin-bottom: 28px;
}

.section-head p {
  color: var(--text-muted);
  margin: 0;
}

.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.card h3 {
  margin-bottom: 8px;
}

.card p:last-child {
  margin-bottom: 0;
}

.card .ico {
  font-size: 24px;
  line-height: 1;
  display: block;
  margin-bottom: 12px;
}

.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

.pill {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
}

.notice {
  background: var(--brand-soft);
  border: 1px solid rgba(108, 124, 255, 0.28);
  border-radius: var(--radius-control);
  padding: 16px 18px;
  color: var(--text-default);
}

.notice strong {
  color: var(--brand-deep);
}

/* ---------- 文档页 ---------- */

.doc {
  padding: 44px 0 24px;
}

.doc-title {
  margin-bottom: 6px;
}

.doc-meta {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.doc-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 32px;
}

.doc-body h2 {
  font-size: 21px;
  margin-top: 32px;
}

.doc-body h2:first-child {
  margin-top: 0;
}

.doc-body h3 {
  font-size: 17px;
  margin-top: 22px;
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.doc-body li {
  margin-bottom: 6px;
}

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 15px;
}

.doc-body th,
.doc-body td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.doc-body th {
  background: var(--surface-muted);
  color: var(--text-strong);
  font-weight: 700;
}

.toc {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 14px 18px;
  margin-bottom: 26px;
  font-size: 15px;
}

.toc ol {
  margin: 0;
  padding-left: 20px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text-strong);
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "＋";
  color: var(--brand);
  font-weight: 800;
  margin-right: 8px;
}

.faq-item[open] summary::before {
  content: "－";
}

.faq-item .answer {
  padding-top: 10px;
  color: var(--text-default);
}

.contact-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 18px;
  margin-bottom: 8px;
}

.contact-box div {
  min-width: 200px;
}

.contact-box .label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.contact-box .value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-strong);
}

/* ---------- 页脚 ---------- */

.site-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  padding: 30px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 22px;
}

.footer-grid h4 {
  font-size: 14px;
  color: var(--text-strong);
  margin-bottom: 8px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 6px;
}

.footer-grid a {
  color: var(--text-muted);
}

.footer-grid a:hover {
  color: var(--brand-deep);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .hero {
    padding: 48px 0 28px;
  }

  .doc-body {
    padding: 22px;
  }

  .nav a {
    padding: 6px 8px;
  }
}
