/* CryptoCalcLab 全局样式 —— 原生 CSS，无框架 */
:root {
  --bg: #f6f8fb;
  --bg2: #eef2f8;
  --card: #ffffff;
  --ink: #0f1b2d;
  --ink-2: #33415c;
  --muted: #6b7891;
  --line: #e2e8f0;
  --brand: #0b1220;
  --accent: #f7931a;
  --accent2: #e2651a;
  --blue: #3147c9;
  --pos: #0aa863;
  --neg: #e5484d;
  --grad: linear-gradient(135deg, #f7931a 0%, #ffb84d 100%);
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 27, 45, 0.08);
  --shadow-lg: 0 18px 44px rgba(15, 27, 45, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
p { margin: 0 0 12px; }
h1, h2, h3, h4 { margin: 0 0 10px; line-height: 1.3; font-weight: 700; }
h1 { font-size: clamp(26px, 4vw, 40px); letter-spacing: -0.5px; }
h2 { font-size: clamp(20px, 2.6vw, 27px); }
h3 { font-size: 17px; }
code { font-family: var(--mono); font-size: 0.92em; background: #eef2f8; padding: 1px 6px; border-radius: 6px; word-break: break-all; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.sec { padding: 46px 0; }
.sec h2, .sec .sub { text-align: center; }
.sub { color: var(--muted); max-width: 640px; margin: 0 auto 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--grad); color: #fff; font-weight: 600;
  border: 0; border-radius: 10px; padding: 11px 20px; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(242, 140, 20, 0.28); transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(242, 140, 20, 0.35); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 8px; }
.btn-ghost { background: #eef2f8; color: var(--ink); box-shadow: none; }
.btn-ghost:hover { background: #e2e8f0; box-shadow: none; }
.btn-ghost:disabled { background: #eef2f8; }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(11, 18, 32, 0.94); backdrop-filter: blur(8px);
  color: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
}
.header-inner { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 16.5px; letter-spacing: 0.2px; }
.brand-text i { font-style: normal; font-size: 11px; color: #9fb0c9; }
.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-quick {
  font-size: 14.5px; color: #dbe4f2; padding: 8px 10px; border-radius: 8px; white-space: nowrap;
}
.nav-quick:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.has-drop { position: relative; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: #dbe4f2; border: 0; cursor: pointer;
  font-size: 14.5px; font-family: inherit; padding: 8px 10px; border-radius: 8px;
}
.nav-btn:hover, .has-drop:hover .nav-btn { color: #fff; background: rgba(255, 255, 255, 0.08); }
.drop {
  position: absolute; top: calc(100% + 12px); right: 0; min-width: 220px;
  background: #fff; color: var(--ink); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 12px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.16s, transform 0.16s, visibility 0.16s;
}
.has-drop:hover .drop, .has-drop:focus-within .drop { opacity: 1; visibility: visible; transform: none; }
.drop a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 14.5px; }
.drop a:hover { background: #f1f5fb; color: var(--accent2); }
.drop.mega { width: min(640px, 90vw); right: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; }
.mega-title { font-weight: 700; font-size: 12.5px; color: var(--muted); padding: 6px 10px 2px; letter-spacing: 0.4px; }
.mega-col { display: flex; flex-direction: column; }
.coins-drop .drop { min-width: 460px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; }
.coin-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 14.5px; }
.coin-chip:hover { background: #f1f5fb; }
.coin-chip em { font-style: normal; color: var(--muted); margin-left: 4px; font-size: 12.5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.header-right { display: flex; align-items: center; gap: 8px; }
.lang-switch {
  color: #dbe4f2; font-size: 14px; border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 6px 11px; border-radius: 8px; white-space: nowrap;
}
.lang-switch:hover { color: #fff; border-color: #fff; }
.nav-burger { display: none; background: transparent; border: 0; cursor: pointer; padding: 6px; }
.nav-burger span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; border-radius: 2px; }
.mobile-nav {
  display: none;
  background: var(--brand); color: #fff; padding: 10px 20px 18px;
  flex-direction: column; gap: 2px;
}
.mobile-nav:not([hidden]) { display: flex; }
.mobile-nav[hidden] { display: none; }
.mobile-nav a { color: #dbe4f2; padding: 9px 6px; border-bottom: 1px solid rgba(255,255,255,0.07); font-size: 15px; }
.mobile-nav .mega-col { margin-top: 8px; }
.mobile-nav .mega-title { color: #9fb0c9; }
.mobile-nav .coin-chip em { color: #9fb0c9; }

/* ---------- Hero / 首页 ---------- */
.hero { background: radial-gradient(1200px 500px at 20% -10%, #1a2b4d 0%, var(--brand) 60%); color: #fff; padding: 54px 0 64px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.05fr; gap: 34px; align-items: center; }
.hero-copy h1 { margin-bottom: 12px; }
.hero .lede { color: #c3d0e6; font-size: 17px; max-width: 46ch; }
.hero-note { color: #7f90ad; font-size: 12.5px; margin-top: 14px; }
.sec.muted { background: var(--bg2); }
.sec.muted + .sec, .sec + .sec.muted { margin-top: 0; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.feat h3 { margin-bottom: 6px; }
.feat p { color: var(--muted); font-size: 14.5px; margin: 0; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.cat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 10px; box-shadow: var(--shadow); }
.cat-card h3 { color: var(--accent2); font-size: 16px; }
.cat-card a { display: block; padding: 7px 4px; color: var(--ink-2); border-top: 1px dashed var(--line); font-size: 14.5px; }
.cat-card a:hover { color: var(--accent2); padding-left: 8px; transition: padding 0.15s; }
.coins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.coin-chip.lg {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--shadow);
}
.coin-chip.lg b { display: block; font-size: 16px; }
.coin-chip.lg em { font-style: normal; color: var(--muted); font-size: 13px; }
.coin-chip.lg:hover { border-color: var(--accent); transform: translateY(-1px); transition: 0.15s; }
.eco-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.eco-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.eco-card b { color: var(--blue); }
.eco-card p { color: var(--muted); font-size: 14px; }
.coming { font-size: 12.5px; color: var(--muted); background: #eef2f8; padding: 4px 10px; border-radius: 6px; }
.eco-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.eco-item b { display: block; font-size: 13.5px; }
.eco-item span { color: var(--muted); font-size: 12.5px; }
.risk-box { background: #fff8f0; border: 1px solid #f3dcbd; border-radius: var(--radius); padding: 18px 20px; color: #5a4a2e; font-size: 14px; }

/* ---------- 通用页面骨架 ---------- */
.page { padding: 26px 20px 70px; }
.page-head { margin: 6px 0 22px; }
.page-head h1 { margin-bottom: 6px; }
.lede { color: var(--ink-2); font-size: 16.5px; max-width: 720px; }
.crumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13.5px; margin: 16px 0 6px; }
.crumbs a:hover { color: var(--accent2); }
.crumbs span:last-child { color: var(--ink-2); font-weight: 500; }
.t-content { max-width: 860px; }
.t-sec { margin: 30px 0; }
.t-sec h2 { border-left: 4px solid var(--accent); padding-left: 12px; }
.t-sec p { color: var(--ink-2); }
.intro-card { background: #fff6ec; border: 1px solid #f6dfc3; border-radius: var(--radius); padding: 18px 22px; margin: 6px 0 0; }
.formula-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.formula-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; }
.f-label { font-weight: 600; min-width: 130px; color: var(--ink); font-size: 14.5px; }
.f-label + code { background: #f7f9fd; }

/* FAQ */
.faq-item { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 10px; overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; position: relative; padding-right: 40px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--accent2); }
.faq-item[open] summary::after { content: "–"; }
.faq-a { padding: 0 18px 14px; color: var(--ink-2); font-size: 15px; }

/* 计算器卡片 */
.calc-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin: 18px 0 8px; max-width: 100%;
}
.calc-card.ghost { background: #fff; }
.calc-app { display: flex; flex-direction: column; gap: 16px; }
.calc-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.calc-tab {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 8px 15px; border-radius: 999px; cursor: pointer; font-size: 14px; font-family: inherit;
}
.calc-tab.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.calc-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; }
.calc-form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.control { position: relative; display: flex; align-items: center; }
.control input, .control select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--ink); outline: none;
}
.control input:focus, .control select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.15); }
.control .suffix { position: absolute; right: 12px; color: var(--muted); font-size: 13px; pointer-events: none; }
.control input.pr { padding-right: 74px; }
.calc-actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.calc-actions .spacer { flex: 1; }
.live-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--blue); background: #eef3ff; border: 0; padding: 8px 13px; border-radius: 9px; cursor: pointer; font-family: inherit; }
.live-btn:hover { background: #e0e9ff; }
.live-btn.loading { opacity: 0.6; pointer-events: none; }
.res-note { font-size: 12.5px; color: var(--muted); }
/* 结果 */
.calc-result { border-top: 1px dashed var(--line); padding-top: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #f7f9fd; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .k { font-size: 12.5px; color: var(--muted); display: block; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .v.small { font-size: 15px; }
.stat.spotlight { background: linear-gradient(150deg, #fff6ec, #fff); border-color: #f2d3a8; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.flat { color: var(--ink-2); }
.result-extra { margin-top: 14px; }
.result-extra table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.result-extra th, .result-extra td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.result-extra th { color: var(--muted); font-weight: 600; }
.result-extra td:first-child, .result-extra th:first-child { text-align: left; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.chart-box { width: 100%; height: 260px; position: relative; }
.chart-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* 平均成本行编辑 */
.cost-rows { grid-column: 1 / -1; }
.row-line { display: grid; grid-template-columns: 1fr 1fr 46px; gap: 10px; margin-bottom: 8px; align-items: center; }
.row-line .rm { border: 1px solid var(--line); background: #fff; color: var(--neg); border-radius: 9px; cursor: pointer; height: 38px; }
.add-row { justify-self: start; }
.mini-notes { color: var(--muted); font-size: 12.5px; }

/* 相关工具 / 磁贴 */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.tile:hover { border-color: var(--accent); transform: translateY(-1px); transition: 0.15s; }
.tile b { font-size: 15px; }
.tile i { font-style: normal; color: var(--accent2); font-size: 12.5px; font-weight: 600; }
.tile-cat { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.related .card-grid { max-width: none; }
.f-coins.inline { display: flex; flex-wrap: wrap; gap: 10px; max-width: 860px; }
.f-coins.inline a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 13.5px; }
.f-coins.inline a:hover { border-color: var(--accent); color: var(--accent2); }
.hub-head { display: flex; gap: 18px; align-items: center; }
.hub-logo { width: 62px; height: 62px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; font-weight: 800; color: #fff; background: linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c), #000 25%)); flex: none; box-shadow: var(--shadow); }
.empty-state { text-align: center; padding: 90px 0; }
.empty-state h1 { font-size: 64px; margin: 0; }

/* 页脚 */
.site-footer { background: var(--brand); color: #c3d0e6; margin-top: 40px; font-size: 14px; }
.site-footer .wrap { padding-top: 42px; padding-bottom: 22px; }
.f-grid { display: grid; grid-template-columns: 1.6fr 1.3fr 1.3fr; gap: 30px; }
.f-brand { margin-bottom: 10px; color: #fff; font-size: 17px; }
.f-title { color: #fff; font-weight: 700; margin-bottom: 12px; font-size: 15px; }
.f-col a { display: block; padding: 4px 0; color: #9fb0c9; }
.f-col a:hover { color: #fff; }
.f-about p { color: #9fb0c9; font-size: 13.5px; }
.f-persona b { color: #fff; }
.f-persona span { display: block; margin: 4px 0; }
.f-coins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 10px; }
.f-risk { margin-top: 28px; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 18px; color: #7f90ad; font-size: 12.5px; }
.f-risk b { color: #dbe4f2; }
.f-data { margin-top: 8px; }
.f-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 18px; padding-top: 14px; color: #5f6f8c; font-size: 12.5px; }

@media (max-width: 980px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .nav-burger { display: block; }
  .header-right { margin-left: auto; }
  .lang-switch { display: none; }
  .f-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .f-grid { grid-template-columns: 1fr; }
  .calc-form { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-head { align-items: flex-start; }
}
