/* ==========================================================================
   Gomail Design System
   参照 https://gopay.gogo198.cn/ 的同套 token（中性基底 + 品牌蓝）
   双主题 · 响应式（手机 / 平板 / 桌面）
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;

  --bg:            #f4f5f7;
  --bg-soft:       #eef0f3;
  --surface:       #ffffff;
  --surface-2:     #f8f9fb;
  --surface-3:     #f1f3f6;
  --border:        #e5e8ec;
  --border-strong: #d3d8df;
  --text:          #14181f;
  --text-2:        #4b5563;
  --muted:         #8b94a3;

  --brand:         #2b5cff;
  --brand-600:     #1f47e0;
  --brand-soft:    #eef2ff;
  --brand-ring:    rgba(43, 92, 255, .18);

  --success:       #0f9d58;
  --success-soft:  #e7f6ee;
  --warn:          #b7791f;
  --warn-soft:     #fdf5e3;
  --danger:        #d33b3b;
  --danger-soft:   #fdecec;
  --info:          #0e7490;
  --info-soft:     #e4f4f8;

  --r-xs: 6px;  --r-sm: 8px;  --r: 12px;  --r-lg: 16px;  --r-xl: 22px;
  --sh-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --sh:    0 1px 3px rgba(16, 24, 40, .05), 0 1px 2px rgba(16, 24, 40, .04);
  --sh-md: 0 4px 14px rgba(16, 24, 40, .07), 0 1px 3px rgba(16, 24, 40, .05);
  --sh-lg: 0 18px 50px rgba(16, 24, 40, .10);

  --content-max: 1180px;
  --nav-h: 60px;
}

html[data-theme="dark"] {
  --bg:            #0e1116;
  --bg-soft:       #12161d;
  --surface:       #161b23;
  --surface-2:     #1b212b;
  --surface-3:     #212834;
  --border:        #262d38;
  --border-strong: #333c4a;
  --text:          #e7eaee;
  --text-2:        #b7bdc7;
  --muted:         #838c99;

  --brand:         #6d92ff;
  --brand-600:     #8aa6ff;
  --brand-soft:    rgba(109, 146, 255, .14);
  --brand-ring:    rgba(109, 146, 255, .28);

  --success:       #35c48a;
  --success-soft:  rgba(53, 196, 138, .14);
  --warn:          #e0a93b;
  --warn-soft:     rgba(224, 169, 59, .14);
  --danger:        #f0685f;
  --danger-soft:   rgba(240, 104, 95, .14);
  --info:          #4cc3db;
  --info-soft:     rgba(76, 195, 219, .14);

  --sh-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --sh:    0 1px 3px rgba(0, 0, 0, .35);
  --sh-md: 0 6px 18px rgba(0, 0, 0, .4);
  --sh-lg: 0 22px 60px rgba(0, 0, 0, .5);
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
code, pre, .mono { font-family: var(--font-mono); font-size: 12.5px; }
::selection { background: var(--brand-ring); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 3. 工具类 ---------- */
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 4. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  font-size: 13.5px; font-weight: 500; line-height: 1.2;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: var(--sh-sm);
}
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 5. 导航 ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--content-max); margin: 0 auto; padding: 0 20px;
  height: var(--nav-h); display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 2px 8px var(--brand-ring);
}
.brand-text { font-size: 16px; letter-spacing: .2px; }
.brand-text small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; line-height: 1; }
.nav-links { display: flex; gap: 4px; margin-left: 12px; }
.nav-links a {
  padding: 7px 12px; border-radius: var(--r-sm); color: var(--text-2); font-size: 13.5px; font-weight: 500;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--brand); background: var(--brand-soft); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: none; }

/* ---------- 6. Hero ---------- */
.hero { padding: 56px 20px 24px; }
.hero-inner { max-width: var(--content-max); margin: 0 auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text-2);
  font-size: 12.5px; box-shadow: var(--sh-sm);
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.eyebrow .dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.hero h1 { margin: 20px 0 0; font-size: clamp(30px, 5vw, 52px); font-weight: 700; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero-lead { max-width: 720px; margin: 16px auto 0; color: var(--text-2); font-size: 15.5px; }
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.hero-metrics {
  max-width: 980px; margin: 40px auto 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.hero-metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px; box-shadow: var(--sh-sm); text-align: left;
}
.hero-metric .v { font-size: 24px; font-weight: 700; line-height: 1.2; }
.hero-metric .k { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- 7. 区块 ---------- */
.section { padding: 48px 20px; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-inner { max-width: var(--content-max); margin: 0 auto; }
.section-head { max-width: 720px; margin: 0 auto 28px; text-align: center; }
.section-head h2 { font-size: clamp(22px, 3vw, 30px); }
.section-head p { margin-top: 10px; color: var(--text-2); font-size: 14.5px; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--sh-sm);
  transition: box-shadow .18s ease, transform .18s ease;
}
.card.hoverable:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.card h3 { font-size: 15px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.card h4 { font-size: 14px; margin-bottom: 6px; }
.card p { color: var(--text-2); font-size: 13.5px; margin-bottom: 0; }
.card-ico {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 15px; flex: none;
}

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2);
}
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

/* ---------- 8. 步骤 ---------- */
.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; }
.step .no {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; margin-bottom: 10px;
}
.step h4 { font-size: 14px; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--text-2); margin: 0; }

/* ---------- 9. 角色卡 ---------- */
.roles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.role-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.role-card .tag { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.role-card h3 { margin: 6px 0 10px; font-size: 16px; }
.role-card ul li { position: relative; padding-left: 16px; color: var(--text-2); font-size: 13.5px; margin-bottom: 6px; }
.role-card ul li::before { content: "·"; position: absolute; left: 4px; color: var(--brand); font-weight: 700; }
.role-card .role-cta { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 10. 接入页（表单） ---------- */
.auth-wrap { max-width: 460px; margin: 0 auto; padding: 40px 20px 64px; }
.auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 24px; box-shadow: var(--sh-md);
}
.tabs {
  display: flex; gap: 4px; padding: 4px; background: var(--surface-3);
  border-radius: var(--r); margin-bottom: 20px;
}
.tabs button {
  flex: 1; padding: 8px 12px; border: none; background: transparent; color: var(--text-2);
  border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; font-weight: 500;
}
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface-2); outline: none; font-size: 14px;
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.alert { padding: 10px 14px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 14px; }
.alert.err { background: var(--danger-soft); color: var(--danger); border: 1px solid transparent; }
.alert.ok { background: var(--success-soft); color: var(--success); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--info-soft); color: var(--info); }

/* ---------- 11. 代码块 ---------- */
pre.code {
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r);
  padding: 14px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px;
  color: var(--text); line-height: 1.7; margin: 0;
}
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px; background: var(--surface-2); border: 1px solid var(--border);
  border-bottom: none; border-radius: var(--r) var(--r) 0 0; font-size: 12px; color: var(--muted);
}

/* ---------- 12. 表格 ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { color: var(--muted); font-weight: 500; font-size: 12px; }

/* ---------- 13. 页脚 ---------- */
.site-foot { border-top: 1px solid var(--border); padding: 28px 20px 40px; background: var(--bg-soft); }
.foot-inner { max-width: var(--content-max); margin: 0 auto; display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.foot-brand { flex: 1; min-width: 240px; }
.foot-links { display: flex; gap: 28px; flex-wrap: wrap; }
.foot-links h5 { font-size: 12px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.foot-links a { display: block; color: var(--text-2); font-size: 13px; margin-bottom: 6px; }
.foot-links a:hover { color: var(--brand); }
.foot-copy { max-width: var(--content-max); margin: 18px auto 0; font-size: 12px; color: var(--muted); }

/* ---------- 14. 响应式 ---------- */
@media (max-width: 860px) {
  .nav-links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 8px; gap: 2px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .hero { padding: 34px 20px 18px; }
  .section { padding: 34px 20px; }
}
@media (max-width: 520px) {
  .hero-cta .btn { flex: 1 1 100%; }
  .nav-actions .btn-primary { padding: 6px 10px; font-size: 12px; }
}
