/* sanbucun.cc — 自研软件站 */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-card: #ffffff;
  --fg: #16191d;
  --fg-muted: #5b636e;
  --fg-faint: #868e99;
  --border: #e3e6ea;
  --border-strong: #cdd2d9;
  --accent: #1f6feb;
  --accent-soft: #e8f0fe;
  --accent-2: #0f766e;
  --accent-2-soft: #e2f3f1;
  --code-bg: #f2f4f7;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.18);
  --radius: 12px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --bg-soft: #131922; --bg-card: #161c26;
    --fg: #e7ebf0; --fg-muted: #9aa4b2; --fg-faint: #6e7885;
    --border: #242c38; --border-strong: #343e4d;
    --accent: #5b9dff; --accent-soft: #16253d;
    --accent-2: #37b9a8; --accent-2-soft: #102a27;
    --code-bg: #1b2230;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --bg-soft: #131922; --bg-card: #161c26;
  --fg: #e7ebf0; --fg-muted: #9aa4b2; --fg-faint: #6e7885;
  --border: #242c38; --border-strong: #343e4d;
  --accent: #5b9dff; --accent-soft: #16253d;
  --accent-2: #37b9a8; --accent-2-soft: #102a27;
  --code-bg: #1b2230;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
code { font-family: var(--mono); font-size: .875em; background: var(--code-bg);
       padding: .15em .4em; border-radius: 5px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { font-weight: 650; font-size: 16px; color: var(--fg); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 22px; margin-left: auto; font-size: 14.5px; }
.nav-links a { color: var(--fg-muted); }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--fg); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: 88px 0 64px; }
.hero.center { text-align: center; }
.eyebrow {
  display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); padding: 5px 12px; border-radius: 999px;
  margin-bottom: 20px;
}
.eyebrow.alt { color: var(--accent-2); background: var(--accent-2-soft); }
h1 { font-size: clamp(32px, 5.2vw, 52px); line-height: 1.18; letter-spacing: -.025em;
     font-weight: 700; margin: 0 0 20px; }
.lede { font-size: clamp(17px, 2vw, 19.5px); color: var(--fg-muted); margin: 0 0 32px; max-width: 640px; }
.hero.center .lede { margin-left: auto; margin-right: auto; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.hero.center .btn-row { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 9px; font-size: 15px; font-weight: 550;
  border: 1px solid transparent; cursor: pointer; transition: .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--border-strong); color: var(--fg); background: var(--bg-card); }
.btn-ghost:hover { border-color: var(--fg-faint); }
.hero-note { margin-top: 18px; font-size: 13.5px; color: var(--fg-faint); }

/* ---------- sections ---------- */
section { padding: 64px 0; }
section.soft { background: var(--bg-soft); border-block: 1px solid var(--border); }
h2 { font-size: clamp(24px, 3.2vw, 32px); line-height: 1.3; letter-spacing: -.02em;
     font-weight: 680; margin: 0 0 14px; }
h3 { font-size: 18px; font-weight: 640; margin: 0 0 8px; letter-spacing: -.01em; }
.section-lede { color: var(--fg-muted); margin: 0 0 40px; max-width: 640px; font-size: 16.5px; }
.center-head { text-align: center; }
.center-head .section-lede { margin-left: auto; margin-right: auto; }

/* ---------- grids / cards ---------- */
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow);
}
.card p { color: var(--fg-muted); margin: 0; font-size: 15px; }
.card .ico { font-size: 22px; line-height: 1; margin-bottom: 12px; display: block; }

/* product chooser on home */
.product-card {
  display: block; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; box-shadow: var(--shadow);
  transition: .18s; color: inherit;
}
.product-card:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-3px); }
.product-card .tag {
  font-size: 12.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px;
}
.product-card.b .tag { color: var(--accent-2); background: var(--accent-2-soft); }
.product-card h3 { font-size: 26px; margin: 18px 0 10px; letter-spacing: -.02em; }
.product-card p { color: var(--fg-muted); margin: 0 0 20px; }
.product-card ul { margin: 0 0 22px; padding-left: 18px; color: var(--fg-muted); font-size: 14.5px; }
.product-card li { margin-bottom: 5px; }
.more { font-weight: 560; font-size: 15px; color: var(--accent); }
.product-card.b .more { color: var(--accent-2); }

/* ---------- feature list ---------- */
.feat { border-top: 1px solid var(--border); padding-top: 22px; }
.feat h3 { display: flex; align-items: baseline; gap: 9px; }
.feat p { color: var(--fg-muted); font-size: 15px; margin: 0; }

/* ---------- callout ---------- */
.callout {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 26px 28px;
}
.callout.alt { border-left-color: var(--accent-2); }
.callout h3 { font-size: 20px; margin-bottom: 10px; }
.callout p { color: var(--fg-muted); margin: 0 0 12px; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- table ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
th, td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 620; font-size: 13.5px; letter-spacing: .02em; color: var(--fg-muted);
     text-transform: uppercase; background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: none; }
td.muted { color: var(--fg-muted); }

/* ---------- faq ---------- */
details { border-bottom: 1px solid var(--border); padding: 16px 0; }
details summary { cursor: pointer; font-weight: 560; font-size: 16px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; display: inline-block; width: 20px;
  color: var(--accent); font-weight: 700; }
details[open] summary::before { content: "\2212"; }
details p { color: var(--fg-muted); margin: 10px 0 0 20px; font-size: 15px; }

/* ---------- contact ---------- */
.contact-box { display: grid; gap: 14px; }
.contact-row { display: flex; align-items: center; gap: 12px; font-size: 15.5px; }
.contact-row .k { color: var(--fg-faint); min-width: 76px; font-size: 14px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 56px;
  color: var(--fg-faint); font-size: 14px; background: var(--bg-soft); }
.footer-in { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; }
.footer-in a { color: var(--fg-muted); }
.site-footer .copy { margin-left: auto; }

@media (max-width: 640px) {
  .hero { padding: 60px 0 44px; }
  section { padding: 48px 0; }
  .nav { gap: 16px; }
  .nav-links { gap: 16px; font-size: 14px; }
  .card, .product-card { padding: 22px; }
}

/* ---------- language switch ---------- */
.lang-switch { display: inline-flex; align-items: center; gap: 1px; margin-left: 18px;
  border: 1px solid var(--border); border-radius: 7px; overflow: hidden; background: var(--bg-card); }
.lang-switch a { padding: 3px 10px; font-size: 13px; color: var(--fg-muted); line-height: 1.6; }
.lang-switch a:hover { background: var(--bg-soft); color: var(--fg); text-decoration: none; }
.lang-switch a[aria-current] { background: var(--accent); color: #fff; }
@media (max-width: 640px) { .lang-switch { margin-left: 10px; } .lang-switch a { padding: 3px 8px; } }

/* ---------- 写作训练（writing.html）：暖色强调 + 竖版视频 ---------- */
.product-card.c .tag { color: #8a5a2b; background: #f4ead9; }
.product-card.c .more { color: #8a5a2b; }
body.wg { --accent: #8a5a2b; --accent-soft: #f4ead9; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .product-card.c .tag { color: #e0b47e; background: #3a2c1f; }
  :root:not([data-theme="light"]) .product-card.c .more { color: #e0b47e; }
  :root:not([data-theme="light"]) body.wg { --accent: #e0b47e; --accent-soft: #3a2c1f; }
}
.wg .btn-primary { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wg .btn-primary { color: #1b140d; } }
.wg-hero { display: grid; grid-template-columns: 1fr 320px; gap: 56px; align-items: center; }
.wg-why { display: grid; grid-template-columns: 300px 1fr; gap: 56px; align-items: center; }
.wg-why .section-lede { margin-bottom: 18px; }
.wg-video { margin: 0; }
.wg-video video { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 16px; background: #f1ebdd;
  box-shadow: var(--shadow); border: 1px solid var(--border); }
.wg-video figcaption { margin-top: 10px; font-size: 13.5px; color: var(--fg-faint); text-align: center; }
.wg-n { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center;
  background: var(--accent); color: var(--bg); font-size: 14px; font-weight: 700; flex: none; }
@media (max-width: 820px) {
  .wg-hero, .wg-why { grid-template-columns: 1fr; gap: 36px; }
  .wg-video { max-width: 300px; margin: 0 auto; width: 100%; }
}
/* 导航项多了以后，窄屏收掉页内锚点链接 */
.nav-links a { white-space: nowrap; }
@media (max-width: 560px) {
  .nav-links .opt { display: none; }
  .nav { gap: 12px; }
  .nav-links { gap: 12px; min-width: 0; }
  .lang-switch { margin-left: 4px; }
}
@media (max-width: 400px) { .brand { font-size: 15px; } .nav-links { gap: 10px; font-size: 13.5px; } .lang-switch a { padding: 3px 6px; } }
