/* BTC 价格查询站 — 暗色金融风，移动优先 */
:root {
  --bg: #0b0f14;
  --bg-elev: #121821;
  --bg-card: #161d28;
  --bg-soft: #1c2533;
  --line: #2a3545;
  --text: #e8eef7;
  --muted: #8b9bb0;
  --accent: #f7931a;
  --accent-2: #3dd6c6;
  --up: #22c55e;
  --up-bg: rgba(34, 197, 94, 0.12);
  --down: #ef4444;
  --down-bg: rgba(239, 68, 68, 0.12);
  --flat: #94a3b8;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "SF Mono", "Cascadia Code", "Consolas", ui-monospace, monospace;
  --max: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(247, 147, 26, 0.12), transparent 55%),
    radial-gradient(900px 400px at 90% 0%, rgba(61, 214, 198, 0.08), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #111; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11, 15, 20, 0.85);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 0; position: relative;
}
.logo { display: flex; align-items: center; gap: .75rem; color: var(--text); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-icon { display: grid; place-items: center; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-text strong { font-size: 1.05rem; letter-spacing: .02em; }
.logo-text small { color: var(--muted); font-size: .72rem; }
.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg-card); cursor: pointer; padding: 10px;
}
.nav-toggle span {
  display: block; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px;
}
.site-nav { display: flex; flex-wrap: wrap; gap: .35rem .85rem; }
.site-nav a {
  color: var(--muted); font-size: .92rem; padding: .35rem .2rem; border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a.active { color: var(--text); text-decoration: none; border-bottom-color: var(--accent); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; place-items: center; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: calc(100% + 1px);
    background: var(--bg-elev); border-bottom: 1px solid var(--line);
    flex-direction: column; padding: .75rem 1rem 1rem; gap: .25rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: .65rem .4rem; border-bottom: none; border-radius: 8px; }
  .site-nav a.active, .site-nav a:hover { background: var(--bg-soft); }
}

.site-main { padding: 1.5rem 0 3rem; }

/* Hero / price card */
.hero {
  display: grid; gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.hero-card {
  background: linear-gradient(160deg, var(--bg-card), #10161f 70%);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: var(--shadow);
}
.hero-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
  margin-bottom: .85rem;
}
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(247, 147, 26, 0.15); color: var(--accent);
  border: 1px solid rgba(247, 147, 26, 0.35);
  font-size: .78rem; font-weight: 600; padding: .25rem .65rem; border-radius: 999px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--up);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.meta-line { color: var(--muted); font-size: .82rem; }
.h1 {
  margin: 0 0 .35rem; font-size: clamp(1.35rem, 3.5vw, 1.85rem); font-weight: 700; letter-spacing: .01em;
}
.price-row {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .75rem 1.25rem; margin: .5rem 0 1rem;
}
.price-main {
  font-family: var(--mono); font-size: clamp(2rem, 7vw, 3.2rem); font-weight: 700; letter-spacing: -.02em;
  line-height: 1.1;
}
.price-sub {
  font-family: var(--mono); font-size: clamp(1.05rem, 3vw, 1.35rem); color: var(--muted);
}
.change-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: var(--mono); font-weight: 700; font-size: .95rem;
  padding: .35rem .7rem; border-radius: 999px;
}
.change-pill.up { color: var(--up); background: var(--up-bg); }
.change-pill.down { color: var(--down); background: var(--down-bg); }
.change-pill.flat { color: var(--flat); background: rgba(148, 163, 184, .12); }

.stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem;
}
@media (min-width: 700px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: .85rem .9rem;
}
.stat .label { display: block; color: var(--muted); font-size: .78rem; margin-bottom: .25rem; }
.stat .value { font-family: var(--mono); font-size: .98rem; font-weight: 600; }

/* Cards / sections */
.section { margin: 1.75rem 0; }
.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: .75rem; margin-bottom: 1rem;
}
.section-head h2 { margin: 0; font-size: 1.25rem; }
.section-head p { margin: 0; color: var(--muted); font-size: .9rem; }
.card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem;
}
.card + .card { margin-top: 1rem; }

/* Table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%; border-collapse: collapse; min-width: 640px; font-size: .92rem;
}
table.data th, table.data td {
  text-align: left; padding: .75rem .65rem; border-bottom: 1px solid var(--line);
}
table.data th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: none; }
table.data tbody tr:hover { background: rgba(255,255,255,.02); }
.coin-cell { display: flex; align-items: center; gap: .55rem; font-weight: 600; }
.coin-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0;
}
.coin-dot.eth { background: #627eea; }
.coin-dot.bnb { background: #f3ba2f; }
.coin-dot.sol { background: #14f195; }
.coin-dot.xrp { background: #23292f; outline: 1px solid #9ca3af; }
.mono { font-family: var(--mono); }
.up { color: var(--up); }
.down { color: var(--down); }

/* Forms */
.form-grid {
  display: grid; gap: 1rem;
}
@media (min-width: 720px) {
  .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}
label.field { display: flex; flex-direction: column; gap: .4rem; font-size: .9rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="number"], select, textarea {
  appearance: none; width: 100%;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .85rem; font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(247, 147, 26, .45); border-color: var(--accent);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: none; border-radius: 10px; padding: .75rem 1.15rem;
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--accent); color: #1a1208;
}
.btn:hover { filter: brightness(1.05); }
.btn-secondary {
  background: transparent; color: var(--text); border: 1px solid var(--line);
}
.btn-secondary:hover { border-color: var(--accent-2); color: var(--accent-2); }
.result-box {
  margin-top: 1rem; padding: 1rem; border-radius: 12px;
  background: rgba(61, 214, 198, 0.08); border: 1px solid rgba(61, 214, 198, 0.25);
}
.result-box .big { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; }

/* Chart */
.chart-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .85rem; }
.chip {
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted);
  border-radius: 999px; padding: .35rem .8rem; font-size: .85rem; cursor: pointer;
}
.chip.active, .chip:hover { color: var(--text); border-color: var(--accent); }
.chart-box { position: relative; height: 320px; }
.chart-box canvas { width: 100% !important; height: 100% !important; }

/* FAQ accordion */
.faq details {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
  padding: .85rem 1rem; margin-bottom: .65rem;
}
.faq summary {
  cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: .75rem 0 0; color: var(--muted); }

/* Alert / notice */
.notice {
  padding: .85rem 1rem; border-radius: 12px; margin: 1rem 0;
  background: rgba(247, 147, 26, 0.1); border: 1px solid rgba(247, 147, 26, 0.3);
  color: #ffd9a0; font-size: .92rem;
}
.notice.info {
  background: rgba(61, 214, 198, 0.08); border-color: rgba(61, 214, 198, 0.28); color: #b7f3ec;
}
.notice.ok {
  background: var(--up-bg); border-color: rgba(34, 197, 94, .35); color: #86efac;
}
.notice.danger {
  background: var(--down-bg); border-color: rgba(239, 68, 68, .35); color: #fca5a5;
}

/* SEO content */
.prose h2 { margin-top: 1.5rem; font-size: 1.2rem; }
.prose h3 { margin-top: 1.1rem; font-size: 1.05rem; }
.prose p, .prose li { color: #c4d0e0; }
.prose ul { padding-left: 1.2rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line); background: #080b10; padding: 2.25rem 0 1.25rem; margin-top: 2rem;
}
.footer-grid {
  display: grid; gap: 1.5rem;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer-title { font-size: 1rem; margin: 0 0 .75rem; }
.footer-col p { color: var(--muted); font-size: .9rem; margin: 0; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: .35rem 0; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--accent-2); }
.footer-note { margin-top: .85rem !important; font-size: .82rem !important; }
.footer-bottom {
  margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .82rem; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem;
}

/* Utilities */
.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;
}
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--muted); }
.grid-2 {
  display: grid; gap: 1rem;
}
@media (min-width: 800px) {
  .grid-2 { grid-template-columns: 1.2fr .8fr; }
}
.kpi-list { display: grid; gap: .65rem; }
.kpi {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .7rem .8rem; background: var(--bg-soft); border-radius: 10px; border: 1px solid var(--line);
}
.kpi span { color: var(--muted); font-size: .85rem; }
.kpi strong { font-family: var(--mono); }


/* Live auto-refresh UI */
.live-status-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .85rem; }
.hero-actions { display: flex; gap: .5rem; align-items: center; }
.countdown {
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  background: var(--bg-soft); border: 1px solid var(--line);
  padding: .2rem .55rem; border-radius: 999px;
  font-variant-numeric: tabular-nums;
  min-width: 7.5rem;
  text-align: center;
}
.countdown strong,
#liveCountdownNum {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.countdown.is-refreshing {
  color: #93c5fd;
  border-color: rgba(59,130,246,.35);
  background: rgba(59,130,246,.12);
}
.badge.is-loading { color: #93c5fd; background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.35); }
.badge.is-error { color: #fca5a5; background: var(--down-bg); border-color: rgba(239,68,68,.35); }
.badge.is-ok { color: #86efac; background: var(--up-bg); border-color: rgba(34,197,94,.35); }
.btn-sm { padding: .4rem .75rem; font-size: .82rem; border-radius: 8px; }
.price-sub-label {
  display: inline-block; margin-left: .35rem; font-size: .72rem;
  color: var(--muted); font-family: var(--font); font-weight: 500; vertical-align: middle;
}
.stat .value-sub {
  display: block; margin-top: .2rem; font-family: var(--mono);
  font-size: .78rem; color: var(--muted); font-weight: 500;
}
.primary-price { font-weight: 700; color: var(--text); }
@keyframes priceFlash {
  0% { background: rgba(247, 147, 26, 0.28); }
  100% { background: transparent; }
}
.price-flash {
  border-radius: 6px;
  animation: priceFlash .9s ease;
}

.btn.is-busy,
.btn:disabled {
  opacity: .65;
  cursor: wait;
}
