/* ============================================================
   生刻雷达 · Black-Gold Luxe Intelligence Platform
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700;900&family=Manrope:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Dark luxe palette */
  --bg-0: #0A0908;
  --bg-1: #121110;
  --bg-2: #1A1815;
  --bg-3: #232019;
  --bg-card: #15130F;
  --line: #2A2620;
  --line-soft: #1F1C17;
  --line-strong: #3A342A;

  --ink-0: #F5EEE1;
  --ink-1: #E6DCC5;
  --ink-2: #B8AE97;
  --ink-3: #847C6B;
  --ink-4: #5A5346;

  /* Brand gold — restrained champagne, not bling */
  --gold: #C8A666;
  --gold-lt: #D4B785;
  --gold-dk: #9C7F45;
  --gold-glow: rgba(200, 166, 102, 0.18);

  /* Signal colors (muted luxe versions) */
  --sig-red: #C86B5A;
  --sig-red-bg: rgba(200, 107, 90, 0.12);
  --sig-yellow: #D4A574;
  --sig-yellow-bg: rgba(212, 165, 116, 0.12);
  --sig-green: #9BB8A3;
  --sig-green-bg: rgba(155, 184, 163, 0.1);
  --sig-blue: #8FA8B8;

  --accent-rose: #E8B4A2;

  --radius: 2px;
  --radius-lg: 4px;

  --font-serif: 'Noto Serif SC', 'Source Han Serif', 'Songti SC', serif;
  --font-sans: 'Manrope', 'PingFang SC', 'Hiragino Sans GB', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
}

[data-theme="light"] {
  --bg-0: #F7F3EA;
  --bg-1: #FBF7EE;
  --bg-2: #F2ECDD;
  --bg-3: #E8E0CE;
  --bg-card: #FFFFFF;
  --line: #E0D8C3;
  --line-soft: #EDE6D3;
  --line-strong: #C9BEA1;

  --ink-0: #1A1612;
  --ink-1: #2E2820;
  --ink-2: #5A5346;
  --ink-3: #847C6B;
  --ink-4: #B5AC99;

  --gold: #8B6F2E;
  --gold-lt: #A68545;
  --gold-dk: #6B5420;
  --gold-glow: rgba(139, 111, 46, 0.12);
}

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

html, body {
  background: var(--bg-0);
  color: var(--ink-1);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  letter-spacing: 0.01em;
}
body { min-width: 1400px; }
.brand-name { white-space: nowrap; }
.nav { white-space: nowrap; }
.nav-item { white-space: nowrap; }
.search-box { flex-shrink: 0; }
.user-chip { flex-shrink: 0; white-space: nowrap; }

body {
  background:
    radial-gradient(ellipse 800px 400px at 10% -5%, rgba(200,166,102,0.06), transparent 70%),
    radial-gradient(ellipse 600px 300px at 95% 5%, rgba(200,166,102,0.03), transparent 70%),
    var(--bg-0);
  background-attachment: fixed;
}

[data-theme="light"] body {
  background:
    radial-gradient(ellipse 800px 400px at 10% -5%, rgba(139, 111, 46, 0.06), transparent 70%),
    var(--bg-0);
}

::selection { background: var(--gold); color: var(--bg-0); }

.mono { font-family: var(--font-mono); }
.serif { font-family: var(--font-serif); }
.gold { color: var(--gold); }
.ink2 { color: var(--ink-2); }
.ink3 { color: var(--ink-3); }
.ink4 { color: var(--ink-4); }

/* ============ HEADER ============ */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 9, 8, 0.88);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.app-header::-webkit-scrollbar { height: 0; display: none; }
[data-theme="light"] .app-header { background: rgba(247, 243, 234, 0.92); }

.app-header-inner {
  max-width: 1640px; min-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
  padding: 16px 32px;
}
.brand { flex-shrink: 0; }
.nav { flex-shrink: 0; }

.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: var(--ink-0);
}
.brand-mark {
  width: 36px; height: 36px; position: relative;
  display: grid; place-items: center;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-name {
  font-family: var(--font-serif);
  font-weight: 700; font-size: 20px;
  letter-spacing: 0.08em; line-height: 1;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 0.3em;
  color: var(--gold); text-transform: uppercase;
  margin-top: 3px;
}

.nav { display: flex; gap: 0; flex: 1; }
.nav-item {
  padding: 10px 11px;
  font-size: 12px; font-weight: 500;
  color: var(--ink-3);
  background: transparent; border: none; cursor: pointer;
  position: relative;
  transition: color .15s ease;
  letter-spacing: 0.02em;
  font-family: var(--font-sans);
}
.nav-item:hover { color: var(--ink-1); }
.nav-item.active { color: var(--gold); }
.nav-item.active::after {
  content: ''; position: absolute; left: 11px; right: 11px; bottom: -17px;
  height: 1px; background: var(--gold);
}

.header-right { display: flex; align-items: center; gap: 16px; }

.search-box {
  background: var(--bg-2); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: var(--radius);
  display: flex; align-items: center; gap: 8px;
  min-width: 240px;
  font-size: 12px; color: var(--ink-3);
  cursor: text;
}
.search-box:focus-within { border-color: var(--gold); }
.search-box input {
  background: transparent; border: none; outline: none;
  color: var(--ink-1); flex: 1;
  font-family: var(--font-sans); font-size: 12px;
}
.kbd {
  font-family: var(--font-mono); font-size: 10px;
  padding: 2px 6px; border: 1px solid var(--line);
  border-radius: 2px; color: var(--ink-3);
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--line); border-radius: 2px;
}
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dk), var(--gold-lt));
  color: var(--bg-0); font-weight: 700; font-size: 11px;
  display: grid; place-items: center;
  font-family: var(--font-serif);
}
.user-role {
  font-size: 10px; letter-spacing: 0.15em;
  color: var(--gold); text-transform: uppercase;
}
.user-name { font-size: 12px; color: var(--ink-1); }

/* ============ LAYOUT ============ */
.page { max-width: 1640px; margin: 0 auto; padding: 32px; }
.page-wide { max-width: 1820px; margin: 0 auto; padding: 24px 32px; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; padding-bottom: 20px; margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.page-head-left { flex: 1; min-width: 0; }
.eyebrow {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.35em; color: var(--gold);
  text-transform: uppercase; margin-bottom: 8px;
}
.page-title {
  font-family: var(--font-serif);
  font-weight: 600; font-size: 38px; line-height: 1.1;
  color: var(--ink-0); letter-spacing: 0.01em;
}
.page-subtitle {
  color: var(--ink-3); margin-top: 8px; font-size: 13px;
  max-width: 720px;
}

/* ============ CARDS ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  transition: border-color .2s ease;
}
.card:hover { border-color: var(--line-strong); }
.card-gold::before {
  content: ''; position: absolute; inset: 0;
  border: 1px solid var(--gold); border-radius: var(--radius);
  opacity: 0; transition: opacity .2s ease;
  pointer-events: none;
}
.card-gold:hover::before { opacity: 1; }

.card-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3);
}

/* ============ BADGES & CHIPS ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; font-size: 10px;
  font-family: var(--font-mono); letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 2px;
  color: var(--ink-2);
}
.badge.gold { color: var(--gold); border-color: var(--gold-dk); }
.badge.red  { color: var(--sig-red); background: var(--sig-red-bg); border-color: transparent; }
.badge.yellow { color: var(--sig-yellow); background: var(--sig-yellow-bg); border-color: transparent; }
.badge.green { color: var(--sig-green); background: var(--sig-green-bg); border-color: transparent; }
.badge.dot::before { content:''; width:5px; height:5px; border-radius:50%; background:currentColor; display:inline-block; margin-right:4px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; font-size: 11px;
  white-space: nowrap;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 100px; color: var(--ink-2);
  cursor: pointer; transition: all .15s ease;
}
.chip:hover { border-color: var(--gold); color: var(--ink-0); }
.chip.active {
  background: var(--gold); color: var(--bg-0);
  border-color: var(--gold); font-weight: 600;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; font-size: 12px; font-weight: 600;
  border-radius: var(--radius); cursor: pointer;
  letter-spacing: 0.05em; text-transform: uppercase;
  transition: all .15s ease; border: 1px solid;
  font-family: var(--font-sans);
}
.btn-primary {
  background: var(--gold); color: var(--bg-0);
  border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold-lt); border-color: var(--gold-lt); }
.btn-ghost {
  background: transparent; color: var(--ink-1);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 5px 10px; font-size: 10px; }

/* ============ STAT ============ */
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line);
}
.stat {
  background: var(--bg-card); padding: 20px 22px;
  position: relative;
}
.stat-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.2em; color: var(--ink-3);
  text-transform: uppercase;
}
.stat-value {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 32px; color: var(--ink-0);
  margin-top: 6px; line-height: 1;
}
.stat-value .unit {
  font-family: var(--font-sans); font-size: 13px;
  color: var(--ink-3); font-weight: 400; margin-left: 4px;
}
.stat-delta { font-size: 11px; margin-top: 6px; color: var(--ink-3); }
.stat-delta.up { color: var(--sig-green); }
.stat-delta.down { color: var(--sig-red); }

/* ============ TABLE ============ */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; padding: 10px 14px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-1); vertical-align: middle;
}
.table tr:hover td { background: var(--bg-2); }
.table tr.row-hot td { background: linear-gradient(90deg, var(--sig-red-bg), transparent 30%); }

/* ============ PAYWALL ============ */
.paywall {
  position: relative;
}
.paywall-content {
  filter: blur(6px); pointer-events: none; user-select: none;
}
.paywall-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, transparent 0%, rgba(10,9,8,0.6) 40%, rgba(10,9,8,0.92) 100%);
}
[data-theme="light"] .paywall-overlay {
  background: linear-gradient(180deg, transparent 0%, rgba(247,243,234,0.7) 40%, rgba(247,243,234,0.96) 100%);
}
.paywall-cta {
  text-align: center;
}
.paywall-cta .lock {
  width: 44px; height: 44px; margin: 0 auto 14px;
  border: 1px solid var(--gold); border-radius: 50%;
  display: grid; place-items: center; color: var(--gold);
}
.paywall-cta h4 {
  font-family: var(--font-serif); font-size: 20px;
  margin-bottom: 6px; color: var(--ink-0);
}

/* Watermark for full pages */
.watermark {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
  opacity: 0.04; mix-blend-mode: overlay;
  background-image: repeating-linear-gradient(
    -30deg,
    transparent 0 180px,
    rgba(200,166,102,0.5) 180px 181px,
    transparent 181px 360px
  );
  display: none;
}
.watermark.on { display: block; }
.watermark-text {
  position: absolute; top: 40%; left: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
  font-family: var(--font-serif); font-size: 80px;
  color: var(--gold); opacity: 0.4; white-space: nowrap;
}

/* ============ GRIDS ============ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-feed { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

@media (max-width: 1280px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-feed { grid-template-columns: 1fr; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dk); }

/* ============ INTEL FEED CARD ============ */
.intel-card {
  background: var(--bg-card); border: 1px solid var(--line);
  padding: 24px 28px; cursor: pointer;
  transition: all .2s ease;
  position: relative;
}
.intel-card:hover { border-color: var(--gold); }
.intel-card.featured {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-card));
  border-color: var(--line-strong);
}
.intel-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.intel-title {
  font-family: var(--font-serif); font-weight: 600;
  font-size: 22px; line-height: 1.3;
  color: var(--ink-0); margin-bottom: 10px;
  letter-spacing: 0.01em;
}
.intel-summary {
  color: var(--ink-2); font-size: 13px; line-height: 1.65;
}
.intel-signals {
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 6px;
  border-top: 1px dashed var(--line); padding-top: 14px;
}
.intel-signals li {
  list-style: none; font-size: 12px; color: var(--ink-2);
  padding-left: 16px; position: relative;
}
.intel-signals li::before {
  content: '→'; position: absolute; left: 0; top: 0;
  color: var(--gold); font-family: var(--font-mono);
}

/* ============ NMPA TRAFFIC LIGHTS ============ */
.lane {
  background: var(--bg-card); border: 1px solid var(--line);
  padding: 18px; min-height: 400px;
}
.lane-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.lane-head .pip {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 8px;
  animation: pulse 2s ease-in-out infinite;
}
.lane-red .pip   { background: var(--sig-red); box-shadow: 0 0 12px var(--sig-red); }
.lane-yellow .pip { background: var(--sig-yellow); box-shadow: 0 0 10px var(--sig-yellow); }
.lane-green .pip  { background: var(--sig-green); box-shadow: 0 0 8px var(--sig-green); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.lane-card {
  background: var(--bg-0); border: 1px solid var(--line-soft);
  padding: 14px; margin-bottom: 10px;
  transition: border-color .15s ease; cursor: pointer;
  border-left: 2px solid transparent;
}
.lane-red .lane-card { border-left-color: var(--sig-red); }
.lane-yellow .lane-card { border-left-color: var(--sig-yellow); }
.lane-green .lane-card { border-left-color: var(--sig-green); }
.lane-card:hover { border-color: var(--gold); }

/* ============ DRAWER ============ */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  animation: fade .2s ease;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(560px, 90vw); background: var(--bg-1);
  border-left: 1px solid var(--line-strong);
  z-index: 201; overflow-y: auto;
  animation: slideIn .25s ease;
  box-shadow: -40px 0 80px -20px rgba(0,0,0,0.6);
}
@keyframes fade { from {opacity:0} to {opacity:1} }
@keyframes slideIn { from {transform: translateX(30px); opacity: 0} to {transform: translateX(0); opacity: 1} }

/* ============ TWEAKS PANEL ============ */
.tweaks-panel {
  position: fixed; right: 24px; bottom: 24px;
  width: 300px; background: var(--bg-1);
  border: 1px solid var(--gold-dk); border-radius: var(--radius);
  padding: 20px; z-index: 150;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,0.8);
  font-size: 12px;
}
.tweaks-panel h5 {
  font-family: var(--font-serif); font-size: 14px;
  color: var(--gold); margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.tweak-row { margin-bottom: 14px; }
.tweak-row label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3); display: block; margin-bottom: 6px;
}
.seg {
  display: flex; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 2px;
  padding: 2px; gap: 2px;
}
.seg button {
  flex: 1; padding: 6px 8px; font-size: 11px;
  background: transparent; border: none; color: var(--ink-2);
  cursor: pointer; border-radius: 2px;
  font-family: var(--font-sans);
}
.seg button.active { background: var(--gold); color: var(--bg-0); font-weight: 600; }

/* ============ UTIL ============ */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mb-12 { margin-bottom: 12px; } .mb-20 { margin-bottom: 20px; } .mb-28 { margin-bottom: 28px; }
.mt-12 { margin-top: 12px; } .mt-20 { margin-top: 20px; }
.tac { text-align: center; } .tar { text-align: right; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.divider-gold {
  height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dk), transparent);
  margin: 24px 0;
}

/* Animated ticker */
.ticker {
  background: var(--bg-1); border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 8px 0;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-2);
}
.ticker-track {
  display: flex; gap: 50px; white-space: nowrap;
  animation: scroll 80s linear infinite;
}
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; }
.ticker-item .sym { color: var(--gold); }

/* Map styles */
.china-map {
  position: relative; width: 100%; aspect-ratio: 16 / 11;
  background: var(--bg-card); border: 1px solid var(--line);
  overflow: hidden;
}
.region-dot {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold); cursor: pointer;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 rgba(200,166,102, 0.4);
  animation: pulseDot 2.4s ease-in-out infinite;
}
.region-dot.hot {
  background: var(--sig-red);
  animation: pulseHot 1.8s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 var(--gold-glow); }
  50% { box-shadow: 0 0 0 12px transparent; }
}
@keyframes pulseHot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,107,90, 0.4); }
  50% { box-shadow: 0 0 0 14px transparent; }
}
.region-label {
  position: absolute; transform: translate(-50%, -180%);
  font-size: 11px; color: var(--ink-2);
  white-space: nowrap; pointer-events: none;
  font-family: var(--font-mono);
}
.region-label b { color: var(--gold); font-weight: 600; }
