/* ============================================================
   深房研 Design System — app.css
   字体：Plus Jakarta Sans (display) + DM Sans (body) + Geist Mono (data)
   配色：深邃石板 + 琥珀品牌 + 专业数据色
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400&family=Geist+Mono:wght@400;500;600&display=swap');

/* ── Design Tokens ── */
:root {
  /* Backgrounds — 石板深色系 */
  --bg:        #0c0f14;
  --bg-2:      #111620;
  --card:      #161d2a;
  --card-2:    #1c2435;
  --overlay:   rgba(8, 11, 18, 0.75);

  /* Borders */
  --border:    #1e2736;
  --border-2:  #2a3547;

  /* Text */
  --t1:   #eaf0f8;
  --t2:   #7e8fa6;
  --t3:   #3d4f66;

  /* Brand — 琥珀金 */
  --brand:        #e8a945;
  --brand-dim:    rgba(232, 169, 69, 0.12);
  --brand-border: rgba(232, 169, 69, 0.28);

  /* Data colors — 专业图表色 */
  --blue:   #4da6ff;
  --blue-dim: rgba(77, 166, 255, 0.1);
  --red:    #f0635a;
  --green:  #3ecf7a;
  --orange: #e8a945;
  --purple: #a87fff;
  --cyan:   #30d4be;
  --pink:   #f06faa;
  --teal:   #2eccc0;

  /* Semantic */
  --up:   #f0635a;
  --down: #3ecf7a;

  /* Typography */
  --font-display: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-body:    'DM Sans', -apple-system, sans-serif;
  --font-mono:    'Geist Mono', 'JetBrains Mono', monospace;

  /* Spacing scale (8px base) */
  --s1:  4px;
  --s2:  8px;
  --s3:  12px;
  --s4:  16px;
  --s5:  20px;
  --s6:  24px;
  --s7:  32px;
  --s8:  48px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-card: 0 2px 12px rgba(0,0,0,0.35);
  --shadow-float: 0 8px 32px rgba(0,0,0,0.5);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast:   150ms;
  --t-normal: 250ms;
  --t-slow:   400ms;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: var(--bg);
  color: var(--t1);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Background texture — 微噪点质感 ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.028'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 15, 20, 0.92);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--s4);
}

.header-top {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s3) 0 var(--s2);
}

.brand-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--brand) 0%, #c87d20 100%);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: #0c0f14;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(232, 169, 69, 0.35);
}

.brand-text { flex: 1; min-width: 0; }

.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--t1);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-slogan {
  font-size: 11px;
  color: var(--t2);
  font-weight: 400;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-source {
  font-size: 10px;
  color: var(--t3);
  margin-top: 2px;
  font-family: var(--font-mono);
}

.header-cta {
  flex-shrink: 0;
  padding: var(--s1) var(--s3);
  background: var(--brand-dim);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-full);
  font-size: 11px;
  color: var(--brand);
  font-weight: 600;
}
.header-cta .wechat-id { user-select: all; }

/* ── Nav / Tabs ── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-top: 2px;
  gap: 0;
}

.tab-bar .tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--t2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  position: relative;
}

.tab-bar .tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.tab-bar .tab:hover:not(.active) {
  color: var(--t1);
}

.tab-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 15px;
  height: 15px;
  line-height: 15px;
  border-radius: var(--r-full);
  text-align: center;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
  font-family: var(--font-mono);
}
.tab-badge:empty { display: none; }

/* ── Breadcrumb + Selects ── */
.breadcrumb {
  font-size: 12px;
  color: var(--t2);
  padding: var(--s2) 0 var(--s1);
  font-family: var(--font-display);
}
.breadcrumb span { cursor: pointer; transition: color var(--t-fast); }
.breadcrumb span:hover { color: var(--brand); }
.breadcrumb .sep { margin: 0 5px; color: var(--t3); }

.sel-row { display: flex; gap: var(--s2); padding-bottom: var(--s2); }

.sel-row select {
  flex: 1;
  background: var(--card);
  color: var(--t1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px var(--s3);
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237e8fa6'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.sel-row select:focus {
  outline: none;
  border-color: var(--brand);
}

/* ── Main Layout ── */
.main { padding: 0 var(--s4) 80px; }

/* ── Section Headers ── */
.section { margin-top: var(--s6); }

.section-title {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: var(--s2);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.section-title .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 6px var(--brand);
}

.section-group { margin-top: var(--s7); }
.section-group-title {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--t3);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: var(--s3);
  padding-left: var(--s2);
  border-left: 2px solid var(--brand);
}

/* ── KPI Cards ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s2);
  margin-bottom: var(--s4);
}

.kpi-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s3);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-normal), box-shadow var(--t-normal);
}
.kpi-item:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow-card);
}
.kpi-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 60%);
  pointer-events: none;
}

.kpi-item .kpi-val {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  line-height: 1;
}
.kpi-item .kpi-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--t2);
  margin-top: var(--s1);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-family: var(--font-display);
}
.kpi-val.up     { color: var(--up); }
.kpi-val.down   { color: var(--down); }
.kpi-val.neutral { color: var(--blue); }

/* ── Temperature KPI — 特殊样式 ── */
.kpi-item.kpi-temp {
  background: linear-gradient(135deg, var(--card) 0%, rgba(22,29,42,0.8) 100%);
}
.kpi-temp-track {
  height: 3px;
  background: var(--border);
  border-radius: var(--r-full);
  margin: var(--s2) var(--s1) var(--s1);
  overflow: hidden;
  position: relative;
}
.kpi-temp-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width var(--t-slow) var(--ease);
  position: relative;
}
/* 温度色: 冷→中→热 */
.kpi-temp-fill.cold   { background: linear-gradient(90deg, #2eccc0, #4da6ff); }
.kpi-temp-fill.cool   { background: linear-gradient(90deg, #4da6ff, #7e8fa6); }
.kpi-temp-fill.warm   { background: linear-gradient(90deg, #e8a945, #f0883e); }
.kpi-temp-fill.hot    { background: linear-gradient(90deg, #f0883e, #f0635a); }

/* ── Chart Cards ── */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s4);
  margin-bottom: var(--s5);
  transition: border-color var(--t-normal);
}
.chart-card:hover { border-color: var(--border-2); }

.chart-card .chart-title {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--t2);
  margin-bottom: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s2);
}
.chart-card .chart-title .formula {
  font-size: 10px;
  color: var(--t3);
  font-family: var(--font-mono);
  font-weight: 400;
}
.chart-source {
  font-size: 10px;
  color: var(--t3);
  margin: 2px 0 var(--s2);
  line-height: 1.4;
  font-family: var(--font-mono);
}
.chart-box { width: 100%; height: 220px; }

/* ── Period Tabs ── */
.period-tabs {
  margin: var(--s3) 0 var(--s2);
  display: flex;
  gap: var(--s1);
}
.period-tab {
  flex: 1;
  text-align: center;
  padding: 7px 0;
  border-radius: var(--r-md);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  background: var(--card);
  color: var(--t2);
  border: 1px solid var(--border);
  transition: all var(--t-fast) var(--ease);
}
.period-tab.active {
  background: var(--brand);
  color: #0c0f14;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(232, 169, 69, 0.3);
}
.period-tab:hover:not(.active) {
  border-color: var(--border-2);
  color: var(--t1);
}

/* ── Community List ── */
.comm-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.comm-item {
  display: flex;
  align-items: center;
  padding: 10px var(--s3);
  border-bottom: 1px solid var(--border);
  gap: var(--s2);
  transition: background var(--t-fast);
}
.comm-item:last-child { border-bottom: none; }
.comm-item:hover { background: rgba(255,255,255,0.02); }

.comm-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.comm-meta {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  min-width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--t2);
}

/* ── Buttons ── */
.btn {
  border: none;
  border-radius: var(--r-sm);
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease);
}
.btn-compare {
  background: transparent;
  color: var(--t3);
  border: none;
  font-size: 18px;
  padding: 4px 6px;
  line-height: 1;
}
.btn-compare:hover  { color: var(--brand); transform: scale(1.15); }
.btn-compare.active { color: var(--brand); }

.btn-detail {
  background: rgba(77, 166, 255, 0.12);
  color: var(--blue);
  border: 1px solid rgba(77, 166, 255, 0.25);
  border-radius: var(--r-full);
  font-size: 11px;
  padding: 3px 10px;
}
.btn-detail:hover {
  background: rgba(77, 166, 255, 0.22);
  border-color: rgba(77, 166, 255, 0.45);
}

/* ── Watchlist ── */
.watch-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border-radius: var(--r-full);
  padding: 4px 10px;
  transition: all var(--t-fast) var(--ease);
  flex-shrink: 0;
  font-size: 13px;
  color: var(--t2);
  background: var(--card);
  border: 1px solid var(--border);
}
.watch-btn .watch-icon { font-size: 16px; line-height: 1; }
.watch-btn .watch-label { font-size: 12px; font-weight: 500; }
.watch-btn:hover { border-color: var(--brand); color: var(--brand); }
.watch-btn.watched {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-dim);
}

.watch-remove {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--t3);
  font-size: 16px;
  flex-shrink: 0;
  transition: all var(--t-fast);
}
.watch-remove:hover {
  background: rgba(240, 99, 90, 0.15);
  color: var(--red);
}
.watch-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--t3);
}

/* ── Chips ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 3px 10px;
  margin: 3px;
  font-size: 11px;
}
.chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.chip-close { cursor: pointer; margin-left: 2px; opacity: 0.6; }
.chip-close:hover { opacity: 1; }

/* ── Detail Panel ── */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-normal);
  backdrop-filter: blur(4px);
}
.detail-overlay.show { opacity: 1; pointer-events: auto; }

.detail-panel {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-2);
  z-index: 201;
  transform: translateY(100%);
  transition: transform var(--t-slow) var(--ease);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.detail-panel.show { transform: translateY(0); }

.detail-header {
  position: sticky;
  top: 0;
  background: rgba(17, 22, 32, 0.92);
  backdrop-filter: blur(12px);
  padding: var(--s3) var(--s4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
}
.detail-header h2 {
  font-size: 15px;
  font-family: var(--font-display);
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}
.close-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 18px;
  cursor: pointer;
  color: var(--t2);
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.close-btn:hover { color: var(--t1); border-color: var(--border-2); }
.detail-body { padding: var(--s3) var(--s4) 40px; }

/* ── Beta Gauge ── */
.beta-gauge {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  display: flex;
  align-items: center;
  gap: var(--s4);
}
.beta-val {
  font-size: 30px;
  font-weight: 800;
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.beta-desc { font-size: 11px; color: var(--t2); line-height: 1.7; }

/* ── Transaction Table ── */
.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: var(--font-mono);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.tx-table th {
  background: rgba(255,255,255,0.03);
  padding: 7px var(--s2);
  text-align: left;
  font-weight: 600;
  color: var(--t2);
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tx-table td {
  padding: 7px var(--s2);
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.tx-table tr:hover td { background: rgba(255,255,255,0.015); }

/* ── Community Detail Tags / Reviews ── */
.detail-tag {
  background: rgba(77,166,255,0.08);
  color: var(--blue);
  border: 1px solid rgba(77,166,255,0.2);
  border-radius: var(--r-full);
  padding: 3px 10px;
  font-size: 11px;
  white-space: nowrap;
}
.detail-review-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s3);
  margin-top: var(--s3);
}
.detail-review-label {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  margin-bottom: 6px;
}
.detail-review-label.pros { color: var(--green); }
.detail-review-label.cons { color: var(--orange); }
.detail-review-list { list-style: none; padding: 0; margin: 0; }
.detail-review-list li {
  font-size: 12px;
  color: var(--t1);
  padding: 4px 0 4px var(--s3);
  border-bottom: 1px solid var(--border);
  position: relative;
  line-height: 1.5;
}
.detail-review-list li:last-child { border-bottom: none; }
.detail-review-list li::before {
  content: '·';
  position: absolute;
  left: 2px;
  color: var(--t3);
}
.detail-review-summary {
  font-size: 12px;
  color: var(--t2);
  line-height: 1.7;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.detail-info-grid {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: var(--s3);
}
.detail-info-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.detail-info-row:last-child { border-bottom: none; }
.detail-info-key {
  padding: 8px 10px;
  color: var(--t2);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}
.detail-info-val {
  padding: 8px 10px;
  color: var(--t1);
  font-weight: 500;
}

/* ── Toast ── */
.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--card-2);
  color: var(--t1);
  border: 1px solid var(--border-2);
  padding: 8px 20px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-family: var(--font-display);
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  transition: all var(--t-normal) var(--ease);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-float);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-warn { border-color: var(--brand); color: var(--brand); }
.toast-ok   { border-color: var(--green); color: var(--green); }

/* ── Auth Overlay ── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-normal);
  backdrop-filter: blur(8px);
}
.auth-overlay.show { opacity: 1; pointer-events: auto; }
.auth-box {
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 28px 24px;
  width: min(320px, 90vw);
  text-align: center;
  box-shadow: var(--shadow-float);
}
.auth-box h3 {
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-display);
  margin-bottom: 6px;
  color: var(--t1);
  letter-spacing: -0.3px;
}
.auth-box p { font-size: 12px; color: var(--t2); margin-bottom: 16px; line-height: 1.6; }
.auth-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--t1);
  text-align: center;
  letter-spacing: 1px;
  outline: none;
  transition: border-color var(--t-fast);
}
.auth-input:focus   { border-color: var(--brand); }
.auth-input.err     { border-color: var(--red); animation: shake 0.4s; }
.auth-err-msg { font-size: 11px; color: var(--red); margin-top: 6px; min-height: 16px; }
.auth-submit {
  width: 100%;
  margin-top: var(--s3);
  padding: 10px;
  border: none;
  border-radius: var(--r-md);
  background: var(--brand);
  color: #0c0f14;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.auth-submit:hover   { opacity: 0.9; transform: translateY(-1px); }
.auth-submit:active  { transform: translateY(0); }
.auth-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.auth-cancel {
  margin-top: 10px;
  font-size: 12px;
  color: var(--t3);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
}
.auth-cancel:hover { color: var(--t2); }

/* ── Locked State ── */
.sel-row.locked select { opacity: 0.4; pointer-events: none; }
.sel-row.locked { position: relative; }
.lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
}
.lock-hint {
  background: rgba(22, 29, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px 14px;
  font-size: 12px;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.tab.locked { opacity: 0.5; cursor: not-allowed; position: relative; }
.tab.locked .lock-icon { font-size: 12px; margin-left: 2px; }

/* ── Recommend Page ── */
.rec-filter {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s4);
  margin-bottom: var(--s3);
}
.rec-filter-title {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--t2);
  margin-bottom: 10px;
}
.rec-budget-input-wrap { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.rec-budget-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--t1);
  text-align: center;
  outline: none;
  transition: border-color var(--t-fast);
  -moz-appearance: textfield;
}
.rec-budget-input::-webkit-inner-spin-button,
.rec-budget-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rec-budget-input:focus { border-color: var(--brand); }
.rec-budget-unit { font-size: 14px; color: var(--t2); font-weight: 600; flex-shrink: 0; }
.rec-rooms { display: flex; gap: var(--s2); margin-bottom: var(--s4); }
.rec-room-btn {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  background: var(--card);
  color: var(--t2);
  border: 1px solid var(--border);
  transition: all var(--t-fast) var(--ease);
}
.rec-room-btn.active {
  background: var(--brand);
  color: #0c0f14;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(232, 169, 69, 0.3);
}
.rec-search-btn {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: var(--r-md);
  background: var(--brand);
  color: #0c0f14;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: opacity var(--t-fast), transform var(--t-fast);
  letter-spacing: 0.3px;
}
.rec-search-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.rec-search-btn:active { transform: translateY(0); }
.rec-search-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.rec-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--s2); margin-bottom: var(--s3); }
.rec-region-header {
  display: flex; align-items: center; gap: 10px;
  padding: var(--s3);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 2px;
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.rec-region-header:hover { border-color: var(--brand); }
.rec-region-header.expanded { border-radius: var(--r-md) var(--r-md) 0 0; border-bottom-color: transparent; margin-bottom: 0; }
.rec-arrow { font-size: 10px; color: var(--t3); flex-shrink: 0; width: 16px; text-align: center; transition: transform var(--t-fast); }
.rec-region-info { flex: 1; min-width: 0; }
.rec-region-name { font-size: 13px; font-weight: 600; font-family: var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-region-sub { font-size: 11px; color: var(--t2); margin-top: 2px; }
.rec-comm-panel { background: var(--card); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--r-md) var(--r-md); margin-bottom: var(--s2); overflow: hidden; }
.rec-comm-item { padding: 10px var(--s3) 10px 38px; border-top: 1px solid var(--border); cursor: pointer; transition: background var(--t-fast); }
.rec-comm-item:hover { background: rgba(232, 169, 69, 0.04); }
.rec-comm-top { display: flex; align-items: center; gap: var(--s2); margin-bottom: 4px; }
.rec-comm-name { flex: 1; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-comm-price { font-size: 13px; font-weight: 700; font-family: var(--font-mono); color: var(--brand); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.rec-comm-stats { display: flex; gap: 10px; font-size: 11px; color: var(--t2); }

/* ── Path Cards ── */
.path-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: var(--s3); overflow: hidden; }
.path-card-header { padding: var(--s4) var(--s4) 10px; border-bottom: 1px solid var(--border); }
.path-card-label { font-size: 14px; font-weight: 700; font-family: var(--font-display); color: var(--blue); margin-bottom: 2px; }
.path-card-desc { font-size: 12px; color: var(--t2); }
.path-card-regions { font-size: 11px; color: var(--cyan); margin-top: 4px; }
.path-card-body { padding: 0; }
.path-card-empty { text-align: center; color: var(--t3); padding: 24px 0; font-size: 12px; }
.path-card-footer { padding: 8px var(--s4); text-align: center; font-size: 12px; color: var(--t2); border-top: 1px solid var(--border); }
.path-card-toggle { cursor: pointer; color: var(--blue); font-weight: 500; }
.path-card-toggle:hover { text-decoration: underline; }
.path-card-stats { font-size: 11px; color: var(--t3); padding: 4px var(--s4) 10px; display: flex; gap: 10px; }

/* ── Footer ── */
.footer-trust {
  margin-top: 40px;
  padding: 28px var(--s4);
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-brand {
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--t1);
  letter-spacing: -0.3px;
}
.footer-brand span { color: var(--brand); }
.footer-slogan { font-size: 12px; color: var(--t2); margin-top: 4px; }
.footer-cta {
  margin-top: var(--s4);
  padding: var(--s4) var(--s5);
  background: var(--brand-dim);
  border: 1px solid var(--brand-border);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--t1);
  line-height: 1.8;
}
.footer-cta .wechat-id {
  font-weight: 700;
  color: var(--brand);
  font-size: 15px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  user-select: all;
}
.footer-stats {
  margin-top: var(--s4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--t3);
}
.footer-copy { margin-top: var(--s4); font-size: 10px; color: var(--t3); }

/* ── Animations ── */
.fade-in { animation: fadeIn var(--t-normal) var(--ease); }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60%  { transform: translateX(-6px); }
  40%, 80%  { transform: translateX(6px); }
}

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

.loading-pulse { animation: pulse 1.5s ease-in-out infinite; }

/* ── Empty / Hint ── */
.empty-hint {
  text-align: center;
  color: var(--t3);
  padding: 40px 0;
  font-size: 13px;
}

/* ── Accessibility helpers ── */
.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;
}

.tab-bar .tab {
  background: none;
  border: none;
  -webkit-appearance: none;
  appearance: none;
}

.breadcrumb .crumb-btn {
  background: none;
  border: none;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.breadcrumb .crumb-current {
  color: var(--t1);
}

.chart-summary {
  font-size: 13px;
  color: var(--t1);
  line-height: 1.65;
  margin-bottom: 8px;
}

/* ── Home redesign ── */
.home-page {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
}

.hero-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
  background: linear-gradient(180deg, rgba(232, 169, 69, 0.14) 0%, rgba(28, 36, 53, 0.92) 100%);
  border: 1px solid var(--brand-border);
  border-radius: 24px;
  padding: 22px 18px;
  box-shadow: var(--shadow-card);
}

.hero-card.strong {
  background: linear-gradient(180deg, rgba(240, 136, 62, 0.18) 0%, rgba(28, 36, 53, 0.92) 100%);
}

.hero-card.value {
  background: linear-gradient(180deg, rgba(77, 166, 255, 0.14) 0%, rgba(28, 36, 53, 0.92) 100%);
}

.hero-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 10px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.9px;
  margin: 0;
}

.hero-subtitle {
  margin-top: 12px;
  font-size: 15px;
  color: var(--t1);
  line-height: 1.75;
}

.hero-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.hero-status-pill,
.home-chip-btn {
  border-radius: var(--r-full);
  border: 1px solid transparent;
}

.hero-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
}

.hero-status-pill.hot,
.hero-status-pill.warm {
  background: rgba(240, 136, 62, 0.14);
  border-color: rgba(240, 136, 62, 0.28);
  color: #ffc287;
}

.hero-status-pill.cool,
.hero-status-pill.cold {
  background: rgba(77, 166, 255, 0.12);
  border-color: rgba(77, 166, 255, 0.24);
  color: #9ecfff;
}

.hero-status-text {
  font-size: 13px;
  color: var(--t2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.home-primary-btn,
.home-secondary-btn,
.home-ghost-btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.home-primary-btn {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #0c0f14;
}

.home-secondary-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-2);
  color: var(--t1);
}

.home-ghost-btn {
  background: transparent;
  border: 1px dashed var(--border-2);
  color: var(--t2);
}

.home-primary-btn:hover,
.home-secondary-btn:hover,
.home-ghost-btn:hover,
.home-chip-btn:hover,
.home-region-card:hover {
  transform: translateY(-1px);
}

.home-block-btn {
  width: 100%;
  justify-content: center;
}

.hero-side-card,
.home-action-card,
.home-insight-card,
.home-region-card {
  background: rgba(12, 15, 20, 0.35);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
}

.hero-side-card {
  padding: 16px;
}

.hero-side-label,
.home-card-eyebrow,
.home-insight-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--t3);
}

.hero-checklist {
  list-style: none;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hero-checklist li {
  position: relative;
  padding-left: 18px;
  color: var(--t1);
  line-height: 1.65;
}

.hero-checklist li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--brand);
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
}

.home-region-card {
  width: 100%;
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.home-region-card.strong {
  border-color: rgba(240, 136, 62, 0.26);
}

.home-region-card.value {
  border-color: rgba(77, 166, 255, 0.24);
}

.home-region-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-region-name,
.home-card-title,
.home-insight-value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--t1);
}

.home-region-name {
  font-size: 18px;
}

.home-region-tag {
  font-size: 12px;
  color: var(--brand);
}

.home-region-summary,
.home-card-text,
.home-insight-text,
.home-section-intro {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--t2);
}

.home-region-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  font-size: 11px;
  color: var(--t3);
}

.home-action-card {
  padding: 16px;
}

.home-action-card.subtle {
  background: rgba(255,255,255,0.02);
}

.home-card-title,
.home-insight-value {
  font-size: 18px;
  line-height: 1.35;
  margin-top: 8px;
}

.home-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.home-chip-btn {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  color: var(--t1);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

.home-insight-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
}

.home-insight-card {
  padding: 16px;
}

.home-section-intro {
  margin-top: 0;
  margin-bottom: var(--s4);
}

/* ── Focus states ── */
button:focus-visible,
select:focus-visible,
input:focus-visible,
.home-region-card:focus-visible,
.home-chip-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ── Responsive tweaks ── */
@media (min-width: 720px) {
  .hero-card {
    grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.9fr);
    align-items: center;
  }

  .home-grid.home-grid-2,
  .home-insight-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .home-insight-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in,
  .loading-pulse {
    animation: none !important;
  }
}

/* ============================================================
   房价地图页 — map.js 专属样式
   ============================================================ */

/* 主布局 */
.map-layout { display: flex; height: calc(100vh - 92px); background: var(--bg); }
.map-area { flex: 1; position: relative; overflow: hidden; }

/* 左上指标按钮 */
.map-indicators {
  position: absolute; top: 16px; left: 16px; z-index: 20;
  display: flex; flex-direction: column; gap: 4px;
}
.map-ind-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(20,25,32,0.88); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; transition: all 0.2s;
  color: var(--t2); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.map-ind-btn:hover { background: rgba(30,39,54,0.95); color: var(--t1); border-color: var(--border-2); }
.map-ind-btn.active { background: rgba(20,25,32,0.95); color: var(--t1); border-color: #4da6ff; }
.map-ind-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* 左下图例 */
.map-legend {
  position: absolute; bottom: 16px; left: 16px; z-index: 20;
  background: rgba(20,25,32,0.88); backdrop-filter: blur(10px);
  border-radius: 8px; padding: 10px 14px;
  border: 1px solid var(--border);
}
.map-lg-title { font-size: 10px; color: var(--t3); margin-bottom: 6px; }
.map-lg-item { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.map-lg-item:last-child { margin-bottom: 0; }
.map-lg-dot { width: 12px; height: 12px; border-radius: 2px; }
.map-lg-item span { font-size: 10px; color: var(--t2); }

/* 顶部数据面板 */
.map-data-panel {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  background: rgba(12,15,20,0.97); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transform: translateY(-100%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  max-height: 70vh; overflow-y: auto;
}
.map-data-panel.show { transform: translateY(0); }
.map-dp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
}
.map-dp-title { font-size: 15px; font-weight: 600; color: var(--t1); }
.map-dp-close {
  background: rgba(255,255,255,0.05); border: none; color: var(--t2);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.map-dp-close:hover { background: rgba(255,255,255,0.1); color: var(--t1); }
.map-dp-body { padding: 20px 24px; }
.map-dp-chart { width: 100%; height: 320px; }
.map-dp-desc { font-size: 12px; color: var(--t3); line-height: 1.8; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.map-dp-formula { color: var(--t3); font-size: 11px; margin-top: 4px; }

/* 右侧边栏 */
.map-sidebar {
  width: 0; background: var(--card); border-left: 1px solid var(--border);
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden; display: flex; flex-direction: column;
}
.map-sidebar.open { width: 400px; }

.map-sb-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.map-sb-back {
  background: rgba(255,255,255,0.05); border: none; color: var(--t2);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.map-sb-back:hover { background: rgba(255,255,255,0.1); color: var(--t1); }
.map-sb-title { font-size: 15px; font-weight: 600; color: var(--t1); flex: 1; }
.map-sb-close { background: none; border: none; color: var(--t3); font-size: 18px; cursor: pointer; }
.map-sb-close:hover { color: var(--t2); }

.map-sb-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.map-sb-body::-webkit-scrollbar { width: 4px; }
.map-sb-body::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

.map-sb-price { font-size: 28px; font-weight: 800; color: #4da6ff; margin: 4px 0; }
.map-sb-price span { font-size: 13px; color: var(--t3); font-weight: 400; }
.map-sb-meta { font-size: 12px; color: var(--t2); margin-bottom: 16px; }
.map-sb-chart { width: 100%; height: 200px; margin-bottom: 16px; border-radius: 8px; background: var(--bg-2); }

.map-sb-section {
  font-size: 12px; font-weight: 600; color: var(--t2); margin: 16px 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

/* 小区列表 */
.map-sb-comm-list { display: flex; flex-direction: column; gap: 4px; }
.map-sb-comm {
  display: flex; align-items: center; padding: 10px 12px;
  background: var(--bg-2); border-radius: 8px; cursor: pointer; transition: background 0.15s;
}
.map-sb-comm:hover { background: var(--card-2); }
.map-sb-comm-name { flex: 1; font-size: 13px; color: #c8d6e5; }
.map-sb-comm-price { font-size: 13px; font-weight: 600; color: var(--t1); font-variant-numeric: tabular-nums; }
.map-sb-comm-price span { font-size: 10px; color: var(--t3); }
.map-sb-comm-arrow { color: var(--t3); margin-left: 8px; font-size: 14px; }

/* 标签 */
.map-sb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.map-sb-tag { background: rgba(77,166,255,0.1); color: #4da6ff; font-size: 11px; padding: 3px 8px; border-radius: 4px; }

/* 优劣势 */
.map-sb-pros, .map-sb-cons { padding-left: 16px; margin: 4px 0 8px; }
.map-sb-pros li, .map-sb-cons li { font-size: 12px; color: var(--t2); line-height: 1.8; }
.map-sb-pros li::marker { color: #5cd4b8; }
.map-sb-cons li::marker { color: #f06088; }

/* 成交列表 */
.map-sb-tx-list { display: flex; flex-direction: column; gap: 4px; }
.map-sb-tx {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.map-sb-tx:last-child { border-bottom: none; }
.map-sb-tx-left { }
.map-sb-tx-date { font-size: 12px; color: var(--t2); }
.map-sb-tx-area { font-size: 11px; color: var(--t3); }
.map-sb-tx-right { text-align: right; }
.map-sb-tx-total { font-size: 13px; font-weight: 600; color: var(--t1); }
.map-sb-tx-unit { font-size: 11px; color: var(--t3); }
.map-sb-tx-hint { font-size: 10px; color: var(--t3); text-align: center; margin-top: 4px; }

/* 响应式：移动端侧边栏改为底部弹出 */
@media (max-width: 768px) {
  .map-layout { flex-direction: column; }
  .map-sidebar { width: 100% !important; height: 0; border-left: none; border-top: 1px solid var(--border); transition: height 0.3s; }
  .map-sidebar.open { height: 55vh; }
  .map-indicators { flex-direction: row; flex-wrap: wrap; gap: 4px; top: 8px; left: 8px; right: 8px; }
  .map-ind-btn { padding: 6px 10px; font-size: 11px; }
  .map-legend { bottom: 8px; left: 8px; }
}
}
