/* ============================================================
   k.aibiancheng.net —— 金融交易知识站
   深色终端风格；中国市场习惯：红涨绿跌
   ============================================================ */

:root {
  --bg: #0a0c10;
  --bg-soft: #0e1116;
  --panel: #12161e;
  --panel-2: #161b24;
  --line: #222836;
  --line-soft: #1a1f29;
  --text: #e8eaf0;
  --text-2: #b6bdcc;
  --muted: #7d8698;
  --gold: #d8a75a;
  --gold-soft: rgba(216, 167, 90, 0.12);
  --up: #e5484d;
  --down: #2f9e6e;
  --info: #5b9bd5;
  --radius: 14px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}

a { color: inherit; text-decoration: none; }
::selection { background: rgba(216, 167, 90, 0.28); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; position: relative; z-index: 1; }

/* ---------- 顶栏 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 12, 16, 0.82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 28px;
  height: 62px; display: flex; align-items: center; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: .2px; white-space: nowrap; }
.brand .mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: linear-gradient(145deg, var(--gold), #a97c33);
  color: #14100a; font-size: 14px; font-weight: 800;
  display: grid; place-items: center; font-family: var(--mono);
}
.brand span { font-size: 15px; }
.brand em { font-style: normal; color: var(--muted); font-weight: 400; font-size: 13px; }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  font-size: 14px; color: var(--text-2); padding: 7px 11px; border-radius: 8px;
  transition: color .18s, background .18s;
}
.nav-links a:hover { color: var(--text); background: var(--panel); }
.nav-links a.on { color: var(--gold); background: var(--gold-soft); }

.nav-toggle {
  display: none; margin-left: auto; width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  cursor: pointer; font-size: 16px; line-height: 1;
}

/* ---------- 通用排版 ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--gold); opacity: .9;
}
h1, h2, h3, h4 { line-height: 1.35; font-weight: 650; letter-spacing: -0.01em; }
h2.section-title { font-size: 26px; margin-bottom: 8px; }
.section-sub { color: var(--muted); font-size: 14.5px; margin-bottom: 26px; }

.prose { color: var(--text-2); font-size: 15.5px; }
.prose p { margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); font-weight: 600; }
.prose code {
  font-family: var(--mono); font-size: 13px; padding: 2px 6px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; color: var(--gold);
}
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--gold); }

/* ---------- 板块 ---------- */
section.band { padding: 78px 0; border-top: 1px solid var(--line-soft); }
section.band:first-of-type { border-top: none; }

/* ---------- 首页 Hero ---------- */
.hero { padding: 84px 0 66px; position: relative; }
.hero h1 {
  font-size: clamp(32px, 4.6vw, 52px); line-height: 1.22; letter-spacing: -0.02em;
  margin: 18px 0 20px; max-width: 17em;
}
.hero h1 .hl {
  background: linear-gradient(100deg, var(--gold), #f0d3a0 55%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: 17px; color: var(--text-2); max-width: 40em; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; font-size: 14.5px; font-weight: 550;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  transition: transform .15s, border-color .18s, background .18s;
}
.btn:hover { transform: translateY(-1px); border-color: #333c4e; background: var(--panel-2); }
.btn.primary {
  background: linear-gradient(145deg, #e0b46e, #c1903f); color: #17120a;
  border-color: transparent; font-weight: 650;
  box-shadow: 0 6px 20px -8px rgba(216, 167, 90, .55);
}
.btn.primary:hover { background: linear-gradient(145deg, #e8c07c, #c99844); }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  margin-top: 54px; background: var(--line-soft);
  border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden;
}
.hero-stats div { background: var(--bg-soft); padding: 20px 22px; }
.hero-stats b { display: block; font-size: 24px; font-family: var(--mono); color: var(--text); letter-spacing: -.5px; }
.hero-stats span { font-size: 12.5px; color: var(--muted); }

/* ---------- 模块卡片 ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.card {
  display: block; padding: 24px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  transition: border-color .2s, transform .2s, background .2s;
  position: relative; overflow: hidden;
}
a.card:hover { transform: translateY(-2px); border-color: #39445a; }
a.card::after {
  content: ""; position: absolute; inset: 0 0 auto; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 167, 90, .55), transparent);
  opacity: 0; transition: opacity .25s;
}
a.card:hover::after { opacity: 1; }
.card .no { font-family: var(--mono); font-size: 12px; color: var(--gold); letter-spacing: 1px; }
.card h3 { font-size: 18px; margin: 10px 0 8px; }
.card p { font-size: 14px; color: var(--muted); line-height: 1.75; }
.card .arrow { margin-top: 16px; font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
a.card:hover .arrow { color: var(--gold); }

.tag {
  display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--muted); font-family: var(--mono);
}
.tag.gold { color: var(--gold); border-color: rgba(216, 167, 90, .38); background: var(--gold-soft); }

/* ---------- 学习路径 ---------- */
.roadmap { display: grid; gap: 12px; }
.step {
  display: grid; grid-template-columns: 108px 1fr; gap: 24px;
  padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft); position: relative;
}
.step::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px;
  background: linear-gradient(180deg, var(--gold), transparent); border-radius: 2px;
}
.step .stage { font-family: var(--mono); font-size: 12px; color: var(--gold); letter-spacing: .6px; }
.step .weeks { font-size: 12px; color: var(--muted); margin-top: 4px; }
.step h4 { font-size: 16.5px; margin-bottom: 10px; }
.step ul { list-style: none; display: grid; gap: 6px; }
.step li { font-size: 14px; color: var(--text-2); padding-left: 16px; position: relative; }
.step li::before { content: "›"; position: absolute; left: 0; color: var(--gold); }

/* ---------- 内页头 ---------- */
.page-head { padding: 58px 0 34px; border-bottom: 1px solid var(--line-soft); }
.page-head h1 { font-size: clamp(28px, 3.6vw, 40px); margin: 12px 0 14px; }
.page-head .lead { color: var(--text-2); font-size: 16px; max-width: 44em; }

.layout { display: grid; grid-template-columns: 216px 1fr; gap: 56px; padding: 46px 0 90px; align-items: start; }
.layout > * { min-width: 0; }
.article { min-width: 0; }

.toc { position: sticky; top: 84px; }
.toc .toc-title { font-family: var(--mono); font-size: 11.5px; letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; margin-bottom: 12px; }
.toc a {
  display: block; font-size: 13.5px; color: var(--muted); padding: 6px 0 6px 12px;
  border-left: 1px solid var(--line); transition: color .16s, border-color .16s;
}
.toc a:hover { color: var(--text); border-color: var(--gold); }

.article > section { margin-bottom: 54px; scroll-margin-top: 88px; }
.article h2 { font-size: 23px; margin-bottom: 6px; display: flex; align-items: baseline; gap: 10px; }
.article h2 .idx { font-family: var(--mono); font-size: 13px; color: var(--gold); opacity: .75; }
.article h3 { font-size: 16.5px; margin: 26px 0 10px; color: var(--text); }
.article .kicker { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 22px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
thead th {
  text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted);
  letter-spacing: .4px; padding: 12px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text-2); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.015); }
td strong, td b { color: var(--text); font-weight: 600; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 多列宽表：固定列宽，避免关键列被挤成竖排 */
table.wide { table-layout: fixed; width: 100%; min-width: 720px; }
table.wide th:nth-child(1) { width: 11%; }
table.wide th:nth-child(2) { width: 24%; }
table.wide th:nth-child(3) { width: 10%; }
table.wide th:nth-child(4) { width: 16%; }
table.wide th:nth-child(5) { width: 13%; }
table.wide th:nth-child(6) { width: 26%; }
table.wide td:first-child { white-space: nowrap; }
table.wide .num { white-space: normal; word-break: keep-all; }

.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- 提示块 ---------- */
.callout {
  border-left: 2px solid var(--gold); background: var(--gold-soft);
  padding: 16px 20px; border-radius: 0 10px 10px 0; margin: 22px 0; font-size: 14.5px;
  color: var(--text-2);
}
.callout.warn { border-color: var(--up); background: rgba(229, 72, 77, .08); }
.callout.note { border-color: var(--info); background: rgba(91, 155, 213, .08); }
.callout b { color: var(--text); }
.callout .label {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--gold); margin-bottom: 6px;
}
.callout.warn .label { color: var(--up); }
.callout.note .label { color: var(--info); }

/* ---------- 公式 ---------- */
.formula {
  font-family: var(--mono); font-size: 14px; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 20px; margin: 18px 0; overflow-x: auto; line-height: 1.9;
}
.formula em { font-style: normal; color: var(--gold); }

/* ---------- 指标网格 ---------- */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 20px 0; }
.mini { padding: 16px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-soft); }
.mini b { display: block; font-size: 14.5px; margin-bottom: 5px; }
.mini span { font-size: 13px; color: var(--muted); line-height: 1.7; }
.mini .mono { font-family: var(--mono); font-size: 12px; color: var(--gold); }

/* ---------- 工具页 ---------- */
.tool {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-soft);
  padding: 26px; margin-bottom: 20px;
}
.tool h3 { font-size: 17px; margin-bottom: 4px; }
.tool .hint { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px; font-size: 15px; font-family: var(--mono);
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  color: var(--text); outline: none; transition: border-color .16s;
  font-variant-numeric: tabular-nums;
}
.field input:focus { border-color: var(--gold); }
.result {
  margin-top: 20px; padding: 18px 20px; border-radius: 11px;
  background: var(--panel); border: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px;
}
.result div { min-width: 0; }
.result .k { font-size: 12px; color: var(--muted); }
.result .v { font-size: 21px; font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.result .v.gold { color: var(--gold); }

/* ---------- 术语表 ---------- */
.glossary-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 26px; }
.glossary-bar input {
  flex: 1; min-width: 220px; padding: 11px 15px; font-size: 14.5px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); outline: none;
}
.glossary-bar input:focus { border-color: var(--gold); }
.chip {
  font-size: 13px; padding: 6px 13px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  transition: all .16s;
}
.chip:hover { color: var(--text); }
.chip.on { color: var(--gold); border-color: rgba(216, 167, 90, .45); background: var(--gold-soft); }

.gl-item {
  padding: 18px 0; border-bottom: 1px solid var(--line-soft);
}
.gl-item h4 { font-size: 15.5px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gl-item h4 .en { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; }
.gl-item p { font-size: 14px; color: var(--text-2); margin-top: 6px; line-height: 1.8; }
.gl-empty { color: var(--muted); font-size: 14px; padding: 30px 0; text-align: center; }

/* ---------- 页脚 ---------- */
footer {
  border-top: 1px solid var(--line-soft); padding: 40px 0 46px; margin-top: 20px;
  background: var(--bg-soft);
}
.foot-inner { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: flex-start; }
.foot-inner .brand { margin-bottom: 10px; }
.foot-note { font-size: 12.5px; color: var(--muted); max-width: 52em; line-height: 1.85; }
.foot-links { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.foot-links a:hover { color: var(--gold); }

/* ---------- 响应式 ---------- */
@media (max-width: 940px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .layout { grid-template-columns: 1fr; gap: 30px; padding: 34px 0 70px; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .toc .toc-title { width: 100%; }
  .toc a { border-left: none; border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  body { font-size: 15px; }
  .wrap, .nav-inner { padding: 0 18px; }
  .nav-inner { gap: 12px; }
  .nav-links {
    display: none; position: absolute; top: 62px; left: 0; right: 0; z-index: 60;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #0b0e14; border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .95);
    padding: 10px 14px 16px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; }
  .nav-toggle { display: block; }
  .brand em { display: none; }
  .hero { padding: 52px 0 40px; }
  .hero h1 { font-size: 26px; letter-spacing: -0.02em; }
  section.band { padding: 52px 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; gap: 6px; }
  .result .v { font-size: 18px; }
  .table-wrap { margin: 18px 0; }
}
