/* ══════════════════════════════════════════════════════════════
   环球金融气象台 · Global Market Weather Observatory
   深夜观测站美学: 墨蓝夜空 × 气象等压线 × 仪表盘等宽字 × 思源宋体
   ══════════════════════════════════════════════════════════════ */

:root {
  --ink: #090e1b;
  --ink-2: #0d1425;
  --panel: #111a30;
  --panel-2: #0e1729;
  --line: #1d2947;
  --line-soft: #16213c;
  --text: #e9eef9;
  --muted: #8b96b4;
  --faint: #5a6480;
  --up: #ff5d5d;          /* 红涨 */
  --up-soft: rgba(255, 93, 93, .12);
  --down: #2bdda0;        /* 绿跌 */
  --down-soft: rgba(43, 221, 160, .12);
  --gold: #f5c451;
  --gold-soft: rgba(245, 196, 81, .13);
  --cloud: #9aa7c2;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  background: var(--ink);        /* 弹性滚动回弹区域也是深色, 避免白边 */
  scroll-behavior: smooth;
  scroll-padding-top: 64px;      /* 粘性标签栏不遮挡跳转目标 */
}

/* ── 滚动条美化 (Chrome / Safari / Edge) ── */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #26355c;
  border: 3px solid var(--ink);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: #35497c; }
::-webkit-scrollbar-corner { background: transparent; }

/* ── 滚动条美化 (Firefox) ── */
@supports not selector(::-webkit-scrollbar) {
  html { scrollbar-width: thin; scrollbar-color: #26355c transparent; }
}
body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── 氛围层: 等压线 / 天色 / 颗粒 ─────────────────────────── */
.isobars, .sky, .grain { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.isobars::before, .isobars::after {
  content: ""; position: absolute; inset: 0;
  background-repeat: no-repeat; background-size: 1400px 1000px;
}
.isobars::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='1000' viewBox='0 0 1400 1000'%3E%3Cg fill='none' stroke='%231f2c4e' stroke-width='1'%3E%3Cellipse cx='1030' cy='140' rx='90' ry='64'/%3E%3Cellipse cx='1045' cy='150' rx='180' ry='128'/%3E%3Cellipse cx='1015' cy='132' rx='270' ry='192'/%3E%3Cellipse cx='1040' cy='158' rx='360' ry='256'/%3E%3Cellipse cx='1020' cy='128' rx='450' ry='320'/%3E%3Cellipse cx='1035' cy='148' rx='540' ry='384'/%3E%3C/g%3E%3C/svg%3E");
  opacity: .5;
}
.isobars::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='1000' viewBox='0 0 1400 1000'%3E%3Cg fill='none' stroke='%231b2745' stroke-width='1'%3E%3Cellipse cx='180' cy='880' rx='110' ry='78' transform='rotate(-8 180 880)'/%3E%3Cellipse cx='196' cy='896' rx='220' ry='156' transform='rotate(-8 196 896)'/%3E%3Cellipse cx='168' cy='866' rx='330' ry='234' transform='rotate(-8 168 866)'/%3E%3Cellipse cx='188' cy='888' rx='440' ry='312' transform='rotate(-8 188 888)'/%3E%3C/g%3E%3C/svg%3E");
  opacity: .45;
}

/* 天色随全球情绪变化 */
.sky { transition: background 1.6s ease; z-index: 0; }
body[data-mood="sunny"]  .sky { background:
  radial-gradient(1100px 480px at 72% -8%, rgba(245, 196, 81, .17), transparent 62%),
  radial-gradient(800px 380px at 12% -4%, rgba(255, 122, 96, .07), transparent 60%); }
body[data-mood="cloudy"] .sky { background:
  radial-gradient(1100px 480px at 70% -8%, rgba(142, 160, 205, .12), transparent 62%),
  radial-gradient(800px 380px at 10% -4%, rgba(110, 130, 180, .06), transparent 60%); }
body[data-mood="rain"]   .sky { background:
  radial-gradient(1100px 480px at 70% -8%, rgba(90, 140, 220, .13), transparent 62%),
  radial-gradient(800px 380px at 10% -4%, rgba(70, 110, 190, .07), transparent 60%); }
body[data-mood="storm"]  .sky { background:
  radial-gradient(1100px 480px at 70% -8%, rgba(150, 118, 235, .14), transparent 62%),
  radial-gradient(800px 380px at 10% -4%, rgba(100, 90, 200, .08), transparent 60%); }

.grain {
  z-index: 1; opacity: .5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── 顶栏 ──────────────────────────────────────────────────── */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 22px 28px 14px;
  max-width: 1280px; margin: 0 auto;
}
.brand-cn { font-family: var(--serif); font-weight: 900; font-size: 21px; letter-spacing: .14em; }
.brand-cn::first-letter { color: var(--gold); }
.brand-en { font-family: var(--mono); font-size: 8.5px; letter-spacing: .34em; color: var(--faint); margin-top: 4px; }
.topbar-right { display: flex; align-items: center; gap: 18px; }

.clocks { display: flex; gap: 14px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.clock i { font-style: normal; color: var(--faint); margin-right: 5px; font-size: 10px; }
.clock b { font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }

.refresh-wrap { display: flex; align-items: center; gap: 10px; }
.last-upd { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.refresh-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  background: rgba(17, 26, 48, .6); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px 5px 8px; cursor: pointer;
  transition: color .2s, border-color .2s;
  font-variant-numeric: tabular-nums;
}
.refresh-btn:hover { color: var(--gold); border-color: rgba(245, 196, 81, .45); }
.refresh-btn .ring { width: 18px; height: 18px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 2.5; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 56.55; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }

/* ── 主区 ──────────────────────────────────────────────────── */
.wrap { position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; padding: 0 28px 40px; }

/* ── Hero: 今日环球阴晴 ───────────────────────────────────── */
.hero {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 44px;
  align-items: center; padding: 34px 0 30px;
}
.hero-kicker {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .3em; color: var(--gold);
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); animation: pulse 2.2s ease infinite; }
.hero-date { color: var(--faint); letter-spacing: .12em; margin-left: 6px; }
@keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245, 196, 81, .5); } 50% { opacity: .6; box-shadow: 0 0 0 6px rgba(245, 196, 81, 0); } }

.verdict {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(42px, 6.4vw, 68px); line-height: 1.12;
  letter-spacing: .05em; margin: 18px 0 10px;
}
.verdict em { font-style: normal; transition: color 1.2s; }
body[data-mood="sunny"]  .verdict em { color: var(--gold); text-shadow: 0 0 34px rgba(245, 196, 81, .35); }
body[data-mood="cloudy"] .verdict em { color: #aebbdd; }
body[data-mood="rain"]   .verdict em { color: #7fa3e8; }
body[data-mood="storm"]  .verdict em { color: #b7a5f0; text-shadow: 0 0 34px rgba(150, 118, 235, .35); }
.verdict .ellip { color: var(--faint); }

.verdict-desc { color: var(--muted); font-size: 15px; letter-spacing: .06em; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 20px;
  font-family: var(--mono); font-size: 12.5px; color: var(--muted);
}
.hero-stats b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-stats .su { color: var(--up); } .hero-stats .sd { color: var(--down); }

.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 7px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; cursor: pointer; background: rgba(17, 26, 48, .45);
  transition: border-color .2s, color .2s, transform .2s;
  font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: rgba(245, 196, 81, .5); color: var(--text); transform: translateY(-1px); }
.chip .cn { font-family: var(--sans); font-size: 12px; }
.chip .cu { color: var(--up); } .chip .cd { color: var(--down); } .chip .cf { color: var(--faint); }

/* ── 观测窗 (porthole) ────────────────────────────────────── */
.hero-side { display: flex; flex-direction: column; align-items: center; }
.porthole {
  width: min(290px, 68vw); aspect-ratio: 1; border-radius: 50%;
  position: relative;
  box-shadow: 0 0 0 1px rgba(245, 196, 81, .28), 0 0 0 9px rgba(13, 20, 37, .85),
              0 0 0 10px rgba(245, 196, 81, .12), 0 24px 70px rgba(0, 0, 0, .5);
}
.ticks {
  position: absolute; inset: -17px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(245, 196, 81, .5) 0deg .5deg, transparent .5deg 6deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3.5px), #000 calc(100% - 3px));
}
.scene { position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 46px rgba(0, 0, 0, .6), inset 0 0 5px rgba(255, 255, 255, .05);
}
.sky-fx { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.sky-sunny  { background: linear-gradient(180deg, #2b3a66 0%, #6d5331 72%, #a37c3e 100%); }
.sky-cloudy { background: linear-gradient(180deg, #222b4b 0%, #39466e 100%); }
.sky-rain   { background: linear-gradient(180deg, #1a2340 0%, #2c3d63 100%); }
.sky-storm  { background: linear-gradient(180deg, #151b32 0%, #2f2749 100%); }
body[data-mood="sunny"]  .sky-sunny,
body[data-mood="cloudy"] .sky-cloudy,
body[data-mood="rain"]   .sky-rain,
body[data-mood="storm"]  .sky-storm { opacity: 1; }

.sun-disk {
  position: absolute; top: 17%; right: 21%; width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle, #fff0c2 0%, #f5c451 52%, rgba(245, 196, 81, 0) 74%);
  box-shadow: 0 0 70px rgba(245, 196, 81, .5);
  opacity: 0; transition: opacity 1.4s ease;
}
.sun-rays {
  position: absolute; top: calc(17% - 62px); right: calc(21% - 62px); width: 208px; height: 208px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(245, 196, 81, .16) 0deg 5deg, transparent 5deg 14deg);
  -webkit-mask: radial-gradient(circle, #000 26%, transparent 64%);
          mask: radial-gradient(circle, #000 26%, transparent 64%);
  animation: spin 90s linear infinite;
  opacity: 0; transition: opacity 1.4s ease;
}
body[data-mood="sunny"] .sun-disk, body[data-mood="sunny"] .sun-rays { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.cloud { position: absolute; border-radius: 999px; opacity: 0; transition: opacity 1.4s ease, filter 1.4s ease; }
.cloud::before, .cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.cloud-a { width: 128px; height: 34px; top: 30%; left: 16%;
  background: linear-gradient(180deg, rgba(216, 226, 248, .9), rgba(150, 164, 198, .5));
  animation: drift 26s ease-in-out infinite alternate; }
.cloud-a::before { width: 52px; height: 52px; top: -26px; left: 20px; }
.cloud-a::after  { width: 38px; height: 38px; top: -18px; right: 24px; }
.cloud-b { width: 150px; height: 38px; top: 44%; left: 34%;
  background: linear-gradient(180deg, rgba(196, 208, 236, .82), rgba(130, 144, 180, .45));
  animation: drift 34s ease-in-out infinite alternate-reverse; }
.cloud-b::before { width: 60px; height: 60px; top: -30px; left: 26px; }
.cloud-b::after  { width: 42px; height: 42px; top: -20px; right: 28px; }
body[data-mood="sunny"]  .cloud-a { opacity: .85; }
body[data-mood="cloudy"] .cloud-a, body[data-mood="cloudy"] .cloud-b { opacity: .95; }
body[data-mood="rain"]   .cloud-a, body[data-mood="rain"]   .cloud-b,
body[data-mood="storm"]  .cloud-a, body[data-mood="storm"]  .cloud-b { opacity: 1; filter: brightness(.62) saturate(.55); }
@keyframes drift { from { transform: translateX(-14px); } to { transform: translateX(16px); } }

.rain-layer {
  position: absolute; inset: -30% -10%;
  background: repeating-linear-gradient(112deg, transparent 0 13px, rgba(158, 188, 255, .34) 13px 14px, transparent 14px 27px);
  -webkit-mask: linear-gradient(180deg, transparent 0 32%, #000 55%);
          mask: linear-gradient(180deg, transparent 0 32%, #000 55%);
  opacity: 0; transition: opacity 1.2s ease;
  animation: rainfall .68s linear infinite;
}
body[data-mood="rain"]  .rain-layer { opacity: .55; }
body[data-mood="storm"] .rain-layer { opacity: .8; }
@keyframes rainfall { from { transform: translateY(-14px); } to { transform: translateY(0); } }

.bolt {
  position: absolute; top: 38%; left: 47%; width: 26px; height: 46px;
  background: linear-gradient(180deg, #fff0c2, #f5c451);
  clip-path: polygon(58% 0, 8% 52%, 42% 52%, 30% 100%, 96% 40%, 54% 40%, 78% 0);
  opacity: 0;
}
body[data-mood="storm"] .bolt { animation: flash 3.4s infinite; }
@keyframes flash { 0%, 55%, 62%, 100% { opacity: 0; } 57%, 60% { opacity: 1; } 58.5% { opacity: .4; } }

.skyline {
  position: absolute; bottom: -1px; left: -2%; width: 104%; height: 26%;
  background: #05080f; opacity: .92;
  clip-path: polygon(0 100%, 0 62%, 5% 62%, 5% 40%, 11% 40%, 11% 66%, 18% 66%, 18% 44%,
    25% 44%, 25% 70%, 33% 70%, 33% 34%, 39% 34%, 39% 60%, 47% 60%, 47% 46%,
    55% 46%, 55% 68%, 63% 68%, 63% 38%, 70% 38%, 70% 64%, 78% 64%, 78% 48%,
    85% 48%, 85% 72%, 92% 72%, 92% 56%, 100% 56%, 100% 100%);
}
.porthole-caption { margin-top: 18px; font-family: var(--mono); font-size: 9px; letter-spacing: .32em; color: var(--faint); }

/* ── 分类标签 ─────────────────────────────────────────────── */
.tabs {
  position: sticky; top: 0; z-index: 40;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 13px 2px; margin: 6px 0 10px;
  background: rgba(9, 14, 27, .84);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.tab {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 15px; cursor: pointer; white-space: nowrap;
  transition: color .2s, border-color .2s, background .2s;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.tab .cnt { font-size: 10px; color: var(--faint); }
.tab:hover { color: var(--text); border-color: #2a3a63; }
.tab.active { color: var(--gold); border-color: rgba(245, 196, 81, .55); background: var(--gold-soft); }
.tab.active .cnt { color: rgba(245, 196, 81, .7); }

/* ── 提示条 ───────────────────────────────────────────────── */
.banner {
  font-family: var(--mono); font-size: 11px; color: var(--gold);
  background: rgba(245, 196, 81, .07); border: 1px solid rgba(245, 196, 81, .25);
  border-radius: 10px; padding: 10px 16px; margin-bottom: 14px;
}

/* ── 看板与卡片 ───────────────────────────────────────────── */
.board { padding-top: 8px; }
.group-head { display: flex; align-items: baseline; gap: 14px; margin: 30px 2px 14px; }
.group-head:first-child { margin-top: 14px; }
.group-cn { font-family: var(--serif); font-weight: 700; font-size: 21px; letter-spacing: .1em; }
.group-en { font-family: var(--mono); font-size: 9.5px; letter-spacing: .3em; color: var(--faint); }
.group-stat { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.group-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 14px; }

.card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line); border-radius: 15px;
  padding: 15px 16px 13px;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  animation: cardIn .55s cubic-bezier(.22, .8, .36, 1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-3px); border-color: rgba(245, 196, 81, .38); box-shadow: 0 14px 38px rgba(0, 0, 0, .38); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.wi { width: 42px; height: 42px; }
.wi svg { width: 100%; height: 100%; display: block; }
.wi .rays { transform-origin: 24px 24px; animation: spin 26s linear infinite; }
.wi .drop { animation: widrop 1.15s linear infinite; }
.wi .drop:nth-child(2) { animation-delay: .28s; }
.wi .drop:nth-child(3) { animation-delay: .55s; }
@keyframes widrop { 0% { transform: translateY(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(4.5px); opacity: 0; } }
.wi .bolt { animation: wiflash 2.9s infinite; opacity: 0; }
@keyframes wiflash { 0%, 88%, 96%, 100% { opacity: 0; } 90%, 93% { opacity: 1; } }

.status { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; color: var(--faint); letter-spacing: .08em; }
.lamp { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.lamp.on { background: var(--down); box-shadow: 0 0 8px rgba(43, 221, 160, .8); animation: pulse2 2s ease infinite; }
@keyframes pulse2 { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

.card-name .cn { font-size: 16px; font-weight: 600; letter-spacing: .03em; }
.card-name .en { font-family: var(--mono); font-size: 9px; letter-spacing: .18em; color: var(--faint); margin-top: 3px; text-transform: uppercase; }

.card-quote { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 12px; }
.price { font-family: var(--mono); font-weight: 600; font-size: 25px; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.price .unit { font-size: 10px; font-weight: 400; color: var(--faint); margin-left: 6px; letter-spacing: .08em; }
.card.up .price { color: var(--up); }
.card.down .price { color: var(--down); }

.chg { font-family: var(--mono); font-size: 12px; padding: 3px 9px; border-radius: 7px; white-space: nowrap;
  font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.card.up .chg { color: var(--up); background: var(--up-soft); }
.card.down .chg { color: var(--down); background: var(--down-soft); }
.card.flat .chg { color: var(--muted); background: rgba(139, 150, 180, .1); }
.card.flat .price { color: var(--text); }

.spark { margin-top: 10px; height: 46px; }
.spark svg { width: 100%; height: 100%; display: block; overflow: visible; }
.spark polyline { fill: none; stroke-width: 1.7; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s cubic-bezier(.4, 0, .2, 1) .15s forwards; }
.card.up .spark polyline { stroke: var(--up); }
.card.down .spark polyline { stroke: var(--down); }
.card.flat .spark polyline { stroke: var(--muted); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.spark .base { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 3 3; opacity: .55; vector-effect: non-scaling-stroke; }

.card-foot {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 9px;
  font-family: var(--mono); font-size: 10px; color: var(--faint);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.card-foot .src { color: #48536e; }
.card-foot .warn { color: #6a5830; }

/* 刷新闪烁 */
.card.flash-up { animation: flashUp 1.1s ease; }
.card.flash-down { animation: flashDown 1.1s ease; }
@keyframes flashUp { 0% { box-shadow: inset 0 0 0 999px rgba(255, 93, 93, .16); } 100% { box-shadow: inset 0 0 0 999px rgba(255, 93, 93, 0); } }
@keyframes flashDown { 0% { box-shadow: inset 0 0 0 999px rgba(43, 221, 160, .16); } 100% { box-shadow: inset 0 0 0 999px rgba(43, 221, 160, 0); } }

/* 骨架屏 */
.card.skel { min-height: 172px; }
.card.skel::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(139, 150, 180, .07) 50%, transparent 70%) var(--panel-2);
  background-size: 220% 100%; animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -90% 0; } }

/* ── 星标与自选 ───────────────────────────────────────────── */
.card { cursor: pointer; }
.card-ctl { display: flex; align-items: center; gap: 8px; }
.star {
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent;
  color: var(--faint); cursor: pointer; padding: 0;
  transition: color .18s, border-color .18s, background .18s, transform .18s;
}
.star svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.star:hover { color: var(--gold); border-color: rgba(245, 196, 81, .4); background: var(--gold-soft); transform: scale(1.06); }
.star.on { color: var(--gold); }
.star.on svg { fill: var(--gold); stroke: var(--gold); }
.group-head.fav .group-cn { color: var(--gold); }
.group-head.fav .group-en { color: rgba(245, 196, 81, .55); }

/* ── 区间大图弹层 ─────────────────────────────────────────── */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(5, 8, 15, .74); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); }
.modal-card {
  position: relative; width: min(860px, 96vw);
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 24px 26px 20px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, .55);
  animation: modalIn .32s cubic-bezier(.22, .8, .36, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(22px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(9, 14, 27, .5); border: 1px solid var(--line);
  color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s;
}
.modal-close:hover { color: var(--gold); border-color: rgba(245, 196, 81, .5); }
.modal-close svg { width: 15px; height: 15px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-right: 44px; }
.m-cn { font-family: var(--serif); font-weight: 900; font-size: 24px; letter-spacing: .06em; }
.m-en { font-family: var(--mono); font-size: 10px; letter-spacing: .24em; color: var(--faint); margin-top: 5px; text-transform: uppercase; }
.m-quote { text-align: right; }
.m-price { font-family: var(--mono); font-weight: 600; font-size: 26px; font-variant-numeric: tabular-nums; }
.m-chg { font-family: var(--mono); font-size: 13px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.m-chg.up { color: var(--up); }
.m-chg.down { color: var(--down); }
.m-chg.flat { color: var(--muted); }
.range-tabs { display: flex; gap: 8px; margin-top: 18px; }
.range-tabs button {
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
  color: var(--muted); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.range-tabs button:hover { color: var(--text); border-color: #2a3a63; }
.range-tabs button.active { color: var(--gold); border-color: rgba(245, 196, 81, .55); background: var(--gold-soft); }
.bigchart { height: 320px; margin-top: 14px; position: relative; }
.bigchart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bigchart .cline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s cubic-bezier(.4, 0, .2, 1) .1s forwards; }
.bigchart .cbase { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 4 4; opacity: .55; vector-effect: non-scaling-stroke; }
.bigchart .clab { font-family: var(--mono); font-size: 10px; fill: var(--muted); letter-spacing: .04em; }
.bigchart .clab.baset { fill: var(--faint); }
.bigchart .caxis { font-family: var(--mono); font-size: 10px; fill: var(--faint); }
.bigchart .carea { animation: areaIn 1.2s ease .1s both; }
@keyframes areaIn { from { opacity: 0; } to { opacity: 1; } }
.bc-loading, .bc-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; color: var(--faint); letter-spacing: .12em;
}
.m-foot {
  display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px;
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.m-foot b { color: var(--text); font-weight: 500; }
.m-foot b.su { color: var(--up); }
.m-foot b.sd { color: var(--down); }
.m-foot .src { color: #48536e; }

/* ── 页脚 ─────────────────────────────────────────────────── */
.foot {
  position: relative; z-index: 2; text-align: center;
  font-family: var(--mono); font-size: 10px; color: var(--faint);
  line-height: 2.1; padding: 34px 24px 30px;
  border-top: 1px solid var(--line-soft);
  letter-spacing: .04em;
}

/* ── 响应式 ───────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 18px; }
  .hero-side { order: -1; }
  .porthole { width: min(240px, 60vw); }
  .sun-disk { width: 70px; height: 70px; }
  .sun-rays { width: 174px; height: 174px; top: calc(17% - 52px); right: calc(21% - 52px); }
}
@media (max-width: 720px) {
  .topbar { padding: 16px 18px 10px; }
  .wrap { padding: 0 18px 30px; }
  .clocks .clock:nth-child(n+3) { display: none; }
  .last-upd { display: none; }
  .grid { grid-template-columns: 1fr; }
  .verdict { font-size: 44px; }
  .modal { padding: 12px; }
  .modal-card { padding: 18px 16px 16px; border-radius: 14px; }
  .m-cn { font-size: 19px; }
  .m-price { font-size: 20px; }
  .bigchart { height: 240px; }
  .range-tabs button { padding: 5px 13px; font-size: 11px; }
}
/* ── 大屏自适应 (≥1600px, 如 1920×1080) ── */
@media (min-width: 1600px) {
  .topbar { max-width: 1740px; padding: 28px 40px 14px; }
  .wrap { max-width: 1740px; padding: 0 40px 48px; }
  .brand-cn { font-size: 24px; }
  .brand-en { font-size: 9.5px; }
  .clocks { font-size: 12px; gap: 20px; }
  .refresh-btn { font-size: 12px; padding: 6px 14px 6px 9px; }
  .hero { grid-template-columns: 1.45fr 1fr; gap: 60px; padding: 44px 0 38px; }
  .verdict { font-size: 78px; }
  .verdict-desc { font-size: 16px; }
  .hero-stats { font-size: 13.5px; gap: 10px 26px; margin-top: 24px; }
  .cat-chips { gap: 10px; margin-top: 26px; }
  .chip { font-size: 12px; padding: 7px 15px; }
  .chip .cn { font-size: 13px; }
  .porthole { width: min(332px, 72vw); }
  .sun-disk { width: 96px; height: 96px; }
  .sun-rays { width: 238px; height: 238px; top: calc(17% - 71px); right: calc(21% - 71px); }
  .cloud-a { width: 146px; height: 38px; }
  .cloud-b { width: 170px; height: 42px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
  .card { padding: 17px 18px 14px; }
  .card-name .cn { font-size: 17px; }
  .card-name .en { font-size: 9.5px; }
  .price { font-size: 27px; }
  .chg { font-size: 12.5px; }
  .wi { width: 46px; height: 46px; }
  .spark { height: 52px; margin-top: 12px; }
  .card-foot { font-size: 10.5px; }
  .group-head { margin: 34px 2px 16px; }
  .group-cn { font-size: 23px; }
  .group-en { font-size: 10.5px; }
}

/* ── 超大屏 (≥2200px, 2K/带鱼屏) ── */
@media (min-width: 2200px) {
  .topbar, .wrap { max-width: 2080px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
}

/* ── 回到顶部 ── */
.to-top {
  position: fixed; right: 30px; bottom: 32px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(17, 26, 48, .88); border: 1px solid var(--line);
  color: var(--muted); cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .4);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .32s ease, transform .32s ease, color .2s, border-color .2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--gold); border-color: rgba(245, 196, 81, .55); }
.to-top svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .spark polyline { stroke-dashoffset: 0; }
}
