/* ==========================================================================
   MT5 中文指南 - 公共样式
   零依赖，无 CDN，无 JS 构建产物；单文件约 12KB，gzip 后约 3KB
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --bg: #05080f;
  --bg-soft: #0a0f1c;
  --surface: #0d1322;
  --surface-2: #111a2e;
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #e6ebf4;
  --text-dim: #9aa8bd;
  --text-faint: #6b7a90;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --accent-line: rgba(59, 130, 246, 0.35);
  --ok: #22c55e;
  --warn: #f59e0b;
  --radius: 16px;
  --radius-lg: 22px;
  --container: 1080px;
  --shadow: 0 18px 48px -24px rgba(0, 0, 0, 0.9);
}

/* ---------- 重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  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.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.125rem; }

p { margin: 0 0 1em; }

a {
  color: #93b4f7;
  text-decoration: none;
  transition: color 0.18s ease;
}
a:hover { color: #cddffd; }

ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: 0.5em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 8, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.0625rem;
  color: #fff;
  letter-spacing: -0.02em;
}
.brand:hover { color: #fff; }
.brand__mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(140deg, #3b82f6, #1d4ed8);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
  flex: none;
}
.brand__sub {
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--text-dim);
}
.nav a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.06); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 64px;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30% 0 auto 0;
  height: 620px;
  background: radial-gradient(
    ellipse 60% 50% at 50% 0%,
    rgba(59, 130, 246, 0.22),
    transparent 70%
  );
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  margin-bottom: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #9ec0ff;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: 999px;
}

.hero h1 { max-width: 20ch; }
.hero h1 .dim {
  display: block;
  color: var(--text-dim);
  font-weight: 600;
}
.hero__lead {
  max-width: 60ch;
  font-size: 1.0625rem;
  color: var(--text-dim);
  margin-bottom: 28px;
}

/* ---------- 按钮 ---------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 12px 30px -14px rgba(37, 99, 235, 0.9);
}
.btn--primary:hover { background: linear-gradient(180deg, #4f90f8, #2f6fe8); color: #fff; }

.btn--ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line-strong);
  color: var(--text);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }

.btn__hint {
  font-size: 0.8125rem;
  color: var(--text-faint);
}

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  padding: 24px;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; font-size: 0.9375rem; color: var(--text-dim); }
.card p + p { margin-top: 0.75em; }
.card__tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 3px 9px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #9ec0ff;
  background: var(--accent-soft);
  border-radius: 999px;
}

/* ---------- 平台下载卡 ---------- */
.platform {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease;
}
.platform:hover { border-color: var(--accent-line); }
.platform__icon {
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
  color: #9ec0ff;
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.platform h3 { margin-bottom: 4px; font-size: 1.25rem; }
.platform__meta {
  margin-bottom: 18px;
  font-size: 0.875rem;
  color: var(--text-faint);
}
.platform .btn { width: 100%; margin-top: auto; }

/* ---------- 清单 / 步骤 ---------- */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0;
  padding: 14px 16px;
  font-size: 0.9375rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.checklist li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 14px;
}
.steps li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 16px 18px 16px 58px;
  font-size: 0.9375rem;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 15px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #9ec0ff;
  background: var(--accent-soft);
  border-radius: 8px;
}

/* ---------- 提示条 ---------- */
.note {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  font-size: 0.9375rem;
  color: var(--text-dim);
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
}
.note strong { color: #cddffd; }
.note--warn {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
  border-left-color: var(--warn);
}
.note--warn strong { color: #fbd38d; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; }
.faq details {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.faq details[open] { border-color: var(--line-strong); }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq p {
  margin: 12px 0 0;
  font-size: 0.9375rem;
  color: var(--text-dim);
}
.faq p:last-child { margin-bottom: 0; }

/* ---------- 版本记录 ---------- */
.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 0 0 20px;
  list-style: none;
  border-left: 1px solid var(--line-strong);
}
.timeline li {
  position: relative;
  margin: 0 0 26px;
  padding-left: 4px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}
.timeline li.is-latest::before { background: var(--accent); }
.timeline .ver {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  font-weight: 700;
  color: #fff;
}
.timeline .ver time { font-size: 0.8125rem; font-weight: 500; color: var(--text-faint); }
.timeline p { margin: 0; font-size: 0.9375rem; color: var(--text-dim); }
.timeline ul { margin: 8px 0 0; font-size: 0.9375rem; color: var(--text-dim); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.badge--live { color: #86efac; background: rgba(34, 197, 94, 0.14); }
.badge--draft { color: #fbd38d; background: rgba(245, 158, 11, 0.14); }

/* ---------- 正文排版（关于/隐私等长文页） ---------- */
.prose { max-width: 74ch; }
.prose h2 { margin-top: 2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; }
.prose p, .prose li { color: var(--text-dim); }
.prose strong { color: var(--text); }

/* ---------- 面包屑 ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 0 0;
  font-size: 0.8125rem;
  color: var(--text-faint);
}
.crumbs a { color: var(--text-faint); }
.crumbs a:hover { color: var(--text-dim); }
.crumbs span[aria-hidden] { opacity: 0.5; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 40px;
  padding: 44px 0 28px;
  border-top: 1px solid var(--line);
  background: #04070d;
  font-size: 0.875rem;
  color: var(--text-faint);
}
.footer-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: 1.4fr 1fr 1fr;
  margin-bottom: 32px;
}
.footer-grid h4 {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--text-faint); }
.footer-grid a:hover { color: var(--text); }

.disclaimer {
  padding: 16px 18px;
  margin-bottom: 20px;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
}

/* ---------- 对比表格 ---------- */
.table-wrap {
  width: 100%;
  margin: 20px 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.9375rem;
  text-align: left;
}
caption {
  padding: 14px 18px 0;
  text-align: left;
  font-size: 0.8125rem;
  color: var(--text-faint);
}
th, td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
thead th {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
tbody th {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 0; }
td { color: var(--text-dim); }
tbody tr:hover td,
tbody tr:hover th { background: rgba(255, 255, 255, 0.015); }

/* ---------- 正文元信息（E-E-A-T） ---------- */
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 14px 0 0;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  color: var(--text-faint);
  border-top: 1px solid var(--line);
}
.meta-line strong { color: var(--text-dim); font-weight: 600; }

/* 答案先行段落：给 AI 引擎和快速阅读用的摘要句 */
.answer-lead {
  padding: 18px 20px;
  margin: 0 0 20px;
  font-size: 1rem;
  color: var(--text);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.07), rgba(59, 130, 246, 0.02));
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 12px;
}
.answer-lead p { margin: 0; }
.answer-lead p + p { margin-top: 8px; }

/* ---------- 行内代码 ---------- */
code {
  padding: 2px 7px;
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 0.875em;
  color: #a8c7f9;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 6px;
}

/* ---------- 命令行代码块 ---------- */
pre {
  margin: 18px 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: #0a1020;
  border: 1px solid var(--line);
  border-left: 3px solid #3b82f6;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.65;
}
pre code {
  padding: 0;
  background: none;
  border: 0;
  color: #a8c7f9;
  font-size: 1em;
  white-space: pre;
}

hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ---------- 跳转链接（键盘无障碍） ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
  color: #fff;
}

/* ---------- 通用工具类 ---------- */
.stack > * + * { margin-top: 16px; }
.center { text-align: center; }
.muted { color: var(--text-dim); }
.small { font-size: 0.875rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.section-head { max-width: 66ch; margin-bottom: 32px; }
.section-head p { margin-bottom: 0; color: var(--text-dim); }

/* ---------- 首屏分栏 ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 56px;
  align-items: center;
}
.hero-visual { position: relative; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: -8% -6%;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(59, 130, 246, 0.22), transparent 70%);
  z-index: 0;
}
.hero-visual .term {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow:
    0 30px 70px -30px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(59, 130, 246, 0.08);
  transition: transform 0.4s ease;
}
.hero-visual:hover .term { transform: translateY(-4px); }
.hero-visual figcaption {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-faint);
}
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.hero-stats div { font-size: 0.875rem; color: var(--text-dim); }
.hero-stats b {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.hero-stats small { font-size: 0.75rem; color: var(--text-faint); }

/* ---------- 特性卡（带图标） ---------- */
.icon-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.icon-card .ic {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #9ec0ff;
}
.icon-card .ic svg { width: 22px; height: 22px; }
.icon-card h3 { font-size: 1.0625rem; margin-bottom: 6px; }
.icon-card p { font-size: 0.9375rem; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .header-inner { height: auto; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
  .nav { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .nav a { white-space: nowrap; padding: 7px 10px; font-size: 0.875rem; }
  .hero { padding: 44px 0 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { order: 2; }
  .section { padding: 44px 0; }
  .btn-row .btn { width: 100%; }
  .card, .platform { padding: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
}

/* ---------- 无障碍：尊重系统减弱动效设置 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .site-header, .site-footer, .btn { display: none; }
  body { background: #fff; color: #000; }
  h1, h2, h3, .prose strong { color: #000; }
  .prose p, .prose li { color: #222; }
}
