/* =============================================================================
   CipherSec 巡析 · 官网样式
   -----------------------------------------------------------------------------
   设计令牌与客户端保持一致（docs/15）：Carbon 浅色、0 圆角、IBM Blue 60。
   ★ 硬规则：**蓝底上的文字只能是白色**（`--on-brand`）。
     灰黑字压在蓝底上"看不清"——这是客户端 2026-10-24 修过的真实缺陷，
     官网沿用同一条规则；web/tests/smoke_site.py 会自动核对。
   ========================================================================== */

:root {
  --brand: #0f62fe;
  --brand-hover: #0043ce;
  --brand-pressed: #002d9c;
  --on-brand: #ffffff;

  --bg: #ffffff;
  --layer: #f4f4f4;
  --layer-hover: #e8e8e8;
  --line: #e0e0e0;
  --line-strong: #8d8d8d;
  --text: #161616;
  --text-muted: #525252;
  --text-dim: #6f6f6f;

  --ok: #24a148;
  --warn: #b26a00;
  --danger: #da1e28;

  --font: "Inter", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei UI",
          "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "Courier New", monospace;

  --wrap: 1200px;
  --gutter: 24px;
  --header-h: 64px;
}

/* ------------------------------------------------------------------ 基础 */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre { font-family: var(--mono); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.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: 12px; top: -48px; z-index: 50;
  background: var(--brand); color: var(--on-brand);
  padding: 10px 16px; transition: top .15s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ------------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }

/* 蓝底 → 白字（每一个态都显式写 color，不依赖继承） */
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--on-brand); }
.btn-primary:active { background: var(--brand-pressed); border-color: var(--brand-pressed); color: var(--on-brand); }
.btn-primary[aria-disabled="true"] {
  background: var(--layer); border-color: var(--line); color: var(--text-dim);
  cursor: not-allowed;
}

.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: var(--layer); color: var(--text); }
.btn-ghost:active { background: var(--layer-hover); color: var(--text); }

/* ------------------------------------------------------------------ 顶栏 */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: var(--brand); color: var(--on-brand);
  font: 600 13px/1 var(--font); letter-spacing: .04em;
}
.brand-text { display: inline-flex; align-items: baseline; gap: 8px; }
.brand-text strong { font-size: 17px; font-weight: 600; }
.brand-text small { color: var(--text-dim); font-size: 12px; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--text-muted); font-size: 15px; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav .btn { color: var(--on-brand); }

.nav-toggle {
  display: none; margin-left: auto;
  width: 40px; height: 36px;
  background: transparent; border: 1px solid var(--line);
  cursor: pointer; padding: 0;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block; width: 18px; height: 2px; background: var(--text);
  margin: 0 auto; position: relative;
}
.nav-toggle-bar::before,
.nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }

/* ------------------------------------------------------------------ Hero */
.hero {
  padding: 88px 0 72px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, #ffffff 0%, #ffffff 55%, var(--layer) 100%);
}
.hero-kicker {
  display: inline-block;
  margin-bottom: 18px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
}
.hero h1 {
  max-width: 22ch;
  font-size: clamp(30px, 4.4vw, 52px);
  letter-spacing: -.02em;
}
.hero-sub {
  max-width: 60ch;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 18px;
}
.hero-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-top: 30px;
}
.hero-badge { color: var(--text-dim); font-size: 14px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 56px;
  background: var(--line);
  border: 1px solid var(--line);
  list-style: none;
}
.stats li {
  background: var(--bg);
  padding: 18px 20px;
}
.stats strong { display: block; font-size: 26px; font-weight: 600; line-height: 1.2; }
.stats span { color: var(--text-muted); font-size: 14px; }

/* ------------------------------------------------------------------ 区块 */
.section { padding: 76px 0; }
/* 锚点跳转要给吸顶导航留位置，否则标题会被顶栏吃掉 */
section[id] { scroll-margin-top: calc(var(--header-h) + 12px); }
.section-alt { background: var(--layer); }
.section-title { font-size: clamp(24px, 2.6vw, 32px); }
.section-sub {
  max-width: 68ch;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 16px;
}

/* ------------------------------------------------------------------ 卡片 */
.cards-3,
.cards-2 {
  display: grid;
  gap: 20px;
  margin-top: 34px;
}
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card,
.feature {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  padding: 22px 22px 24px;
}
.card h3,
.feature h3 { font-size: 17px; }
.card p,
.feature p { margin-top: 10px; color: var(--text-muted); font-size: 15px; }
.section-alt .card,
.section-alt .feature { background: var(--bg); }

/* ------------------------------------------------------------------ 产品 */
.product-group { margin-top: 44px; }
.product-group:first-of-type { margin-top: 36px; }
.group-head {
  display: flex; align-items: baseline; gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}
.group-head h3 { font-size: 18px; }
.group-head p { color: var(--text-muted); font-size: 14px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-top: none;
}
.product {
  background: var(--bg);
  padding: 20px 22px 22px;
}
.product-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.code {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; height: 22px; padding: 0 8px;
  background: var(--brand); color: var(--on-brand);
  font: 600 12px/1 var(--mono); letter-spacing: .06em;
}
.en { color: var(--text-dim); font: 12px/1 var(--mono); }
.product h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.product .summary {
  margin-top: 8px;
  color: var(--text);
  font-size: 15px;
}
.product .scenario {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 14px;
}
.product .scenario b { color: var(--text-muted); font-weight: 600; }
.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 14px;
  list-style: none;
}
.chips li {
  padding: 2px 8px;
  border: 1px solid var(--line);
  background: var(--layer);
  color: var(--text-muted);
  font: 12px/1.7 var(--mono);
}

/* ------------------------------------------------------------------ 下载 */
.download {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 34px;
}
.download-main,
.download-side {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 24px;
}
.download-lead { margin-top: 12px; color: var(--text-muted); font-size: 15px; }

.download-note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  background: var(--layer);
  color: var(--text-muted);
  font-size: 14px;
}

.meta {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  gap: 10px 16px;
  margin: 22px 0 0;
  font-size: 14px;
}
.meta dt { color: var(--text-muted); }
.meta dd { margin: 0; word-break: break-all; }
.meta dd code {
  background: var(--layer);
  padding: 2px 6px;
  font-size: 12.5px;
}
.copy {
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}
.copy:hover { background: var(--layer); }

.download-side h3 { font-size: 16px; }
.steps {
  margin-top: 14px;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 14px;
}
.steps li { margin-bottom: 12px; }
.steps strong { display: block; color: var(--text); font-size: 14px; }
.steps code {
  background: var(--layer);
  padding: 1px 5px;
  font-size: 12.5px;
}

.verify {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.verify-title { color: var(--text-muted); font-size: 13px; }
.verify pre {
  margin: 8px 0 0;
  padding: 12px 14px;
  background: var(--text);
  color: #f4f4f4;
  font-size: 12.5px;
  overflow-x: auto;
}
.verify-hint { margin-top: 8px; color: var(--text-dim); font-size: 12.5px; }

/* ------------------------------------------------------------------ 合规 */
.compliance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 34px;
}
.notice {
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--danger);
  padding: 20px 22px;
}
.notice[data-topic="data"] { border-left-color: var(--brand); }
.notice[data-topic="license"] { border-left-color: var(--warn); }
.notice h3 { font-size: 16px; }
.notice p { margin-top: 8px; color: var(--text-muted); font-size: 14.5px; }
.notice strong { color: var(--text); }

/* ------------------------------------------------------------------ 团队 */
.team {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.team-lead {
  display: inline-block;
  margin-top: 16px;
  padding: 3px 10px;
  background: var(--brand);
  color: var(--on-brand);
  font-size: 13px;
  font-weight: 600;
}
.team p { margin-top: 12px; color: var(--text-muted); max-width: 62ch; }
.team-meta { font-size: 14.5px; }
.team-meta a { font-weight: 500; }
.team-points {
  list-style: none;
  border-top: 1px solid var(--line-strong);
  padding-top: 8px;
}
.team-points li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 14.5px;
}

/* ------------------------------------------------------------------ 页脚 */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: 28px 0 36px;
}
.footer-inner { display: grid; gap: 6px; }
.site-footer p { color: var(--text-muted); font-size: 13.5px; }
.footer-meta { color: var(--text-dim); }

/* ------------------------------------------------------------------ 响应式 */
@media (max-width: 1000px) {
  .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .download { grid-template-columns: minmax(0, 1fr); }
  .team { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 820px) {
  :root { --gutter: 18px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: var(--header-h);
    display: none;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 12px; border-bottom: none; }
  .hero { padding: 56px 0 48px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-2 { grid-template-columns: minmax(0, 1fr); }
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .compliance { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 56px 0; }
}

@media (max-width: 560px) {
  .cards-3 { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn { width: 100%; }
  .meta { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .meta dd { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---- 产品族首页的三张入口卡（2026-10-24 三产品改版）---- */
.suite-card { display: flex; flex-direction: column; gap: 8px; }
.suite-card h3 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.suite-tagline { color: var(--c-primary, #0f62fe); font-weight: 600; }
.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 500; line-height: 18px;
  color: #525252; background: #f4f4f4; border: 1px solid #e0e0e0;
}
.suite-points { margin: 4px 0 12px; padding-left: 18px; color: #525252; }
.suite-points li { margin: 2px 0; }
.suite-card .btn { margin-top: auto; align-self: flex-start; }
