:root {
  --bg: #05070b;
  --bg-2: #070b11;
  --panel: #0b1018;
  --panel-2: #0f1621;
  --panel-3: #131c29;
  --line: #19222f;
  --line-2: #253246;
  --text: #e8eef8;
  --muted: #8b9ab0;
  --muted-2: #5b6a80;
  --yellow: #f5c518;
  --yellow-2: #ffd84d;
  --up: #0ecb81;
  --down: #f6465d;
  --blue: #5b8cff;
  --radius: 14px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "JetBrains Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 78% -10%, rgba(245, 197, 24, 0.055), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(91, 140, 255, 0.045), transparent 60%),
    var(--bg);
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1d2836; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #2b394c; }

/* ===================== auth ===================== */
.auth-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
}
.auth-art {
  position: relative;
  overflow: hidden;
  padding: 46px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(800px 500px at 20% 20%, rgba(245, 197, 24, 0.07), transparent 65%),
    linear-gradient(160deg, #080c12, #05070b 70%);
}
.auth-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 30% 35%, #000 0%, transparent 75%);
  pointer-events: none;
}
.auth-brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  font-size: 13px;
}
.auth-brand small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted-2);
  font-weight: 500;
}
.logo-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #111;
  background: linear-gradient(145deg, var(--yellow-2), var(--yellow));
  box-shadow: 0 6px 18px rgba(245, 197, 24, 0.22);
  flex: 0 0 auto;
}
.logo-mark svg { width: 20px; height: 20px; }

.auth-copy { position: relative; z-index: 2; max-width: 520px; margin: 8vh 0 4vh; }
.eyebrow {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--yellow);
  font-weight: 600;
  text-transform: uppercase;
}
.auth-copy h1 {
  margin: 18px 0 20px;
  font-size: clamp(38px, 4.4vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.auth-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  max-width: 440px;
}
.auth-points {
  list-style: none;
  margin: 34px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.auth-points li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #c3cddc;
  font-size: 13px;
}
.auth-points b {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--yellow);
  border: 1px solid rgba(245, 197, 24, 0.28);
  background: rgba(245, 197, 24, 0.06);
  border-radius: 6px;
  padding: 4px 7px;
}
.auth-candles {
  position: relative;
  z-index: 1;
  height: 170px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  opacity: 0.55;
  pointer-events: none;
}
.auth-candles span {
  width: 11px;
  height: var(--h);
  border-radius: 2px;
  background: linear-gradient(180deg, #24e39a, #0a9c64);
  box-shadow: 0 0 24px rgba(14, 203, 129, 0.18);
  animation: candleRise 1.2s cubic-bezier(.2, .8, .2, 1) both;
}
.auth-candles span:nth-child(odd) {
  background: linear-gradient(180deg, #ff6b7e, #b52b3d);
  box-shadow: 0 0 24px rgba(246, 70, 93, 0.18);
}
.auth-candles span:nth-child(1) { animation-delay: .05s; }
.auth-candles span:nth-child(2) { animation-delay: .1s; }
.auth-candles span:nth-child(3) { animation-delay: .15s; }
.auth-candles span:nth-child(4) { animation-delay: .2s; }
.auth-candles span:nth-child(5) { animation-delay: .25s; }
.auth-candles span:nth-child(6) { animation-delay: .3s; }
.auth-candles span:nth-child(7) { animation-delay: .35s; }
.auth-candles span:nth-child(8) { animation-delay: .4s; }
.auth-candles span:nth-child(9) { animation-delay: .45s; }
.auth-candles span:nth-child(10) { animation-delay: .5s; }
.auth-candles span:nth-child(11) { animation-delay: .55s; }
.auth-candles span:nth-child(12) { animation-delay: .6s; }
@keyframes candleRise {
  from { height: 0; opacity: 0; }
  to { height: var(--h); opacity: 1; }
}
.auth-foot {
  position: relative;
  z-index: 2;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: linear-gradient(180deg, #080c12, #05070b);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 34px 32px 30px;
  border: 1px solid var(--line-2);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(18, 26, 38, 0.9), rgba(9, 13, 20, 0.95));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: #080d14;
  border: 1px solid var(--line);
  margin-bottom: 22px;
}
.auth-tabs button {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  transition: 0.2s;
}
.auth-tabs button.active { background: var(--yellow); color: #121212; }
.auth-note {
  margin: 20px 0 0;
  font-size: 11px;
  color: var(--muted-2);
  text-align: center;
  line-height: 1.6;
}
.auth-back {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}
.auth-back:hover { color: var(--text); }
.auth-link {
  display: block;
  margin: 14px auto 0;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  color: var(--yellow);
  font-size: 11.5px;
  cursor: pointer;
  opacity: 0.85;
}
.auth-link:hover { opacity: 1; text-decoration: underline; }

/* ===================== shell ===================== */
.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
  grid-template-areas:
    "top top"
    "side main";
  height: 100vh;
}

/* ===================== topbar ===================== */
.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 12, 0.86);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
.brand-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;
}
.brand-text small {
  display: block;
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  font-weight: 500;
}
.side-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  stroke: var(--muted-2);
  fill: none;
  stroke-width: 1.7;
  pointer-events: none;
}
.side-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 35px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #080d14;
  color: var(--text);
  outline: none;
  transition: 0.2s;
  font-size: 13px;
}
.side-search input:focus {
  border-color: rgba(245, 197, 24, 0.5);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.07);
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: 0.2s;
}
.icon-btn:hover { color: var(--text); background: var(--panel-2); border-color: var(--line); }
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #080d14;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.conn i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted-2);
  box-shadow: 0 0 0 3px rgba(91, 106, 128, 0.12);
}
.conn.ok { color: var(--up); border-color: rgba(14, 203, 129, 0.25); background: rgba(14, 203, 129, 0.06); }
.conn.ok i { background: var(--up); box-shadow: 0 0 0 3px rgba(14, 203, 129, 0.15); animation: dotPulse 2s infinite; }
.conn.demo { color: var(--yellow); border-color: rgba(245, 197, 24, 0.28); background: rgba(245, 197, 24, 0.07); }
.conn.demo i { background: var(--yellow); }
.conn.bad { color: var(--down); border-color: rgba(246, 70, 93, 0.28); background: rgba(246, 70, 93, 0.06); }
.conn.bad i { background: var(--down); }
@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(14, 203, 129, 0.15); }
  50% { box-shadow: 0 0 0 5px rgba(14, 203, 129, 0.06); }
}
.badge {
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.badge.demo { color: #1a1500; background: var(--yellow); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  transition: 0.2s;
}
.chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.chip.warn {
  color: var(--yellow);
  border-color: rgba(245, 197, 24, 0.32);
  background: rgba(245, 197, 24, 0.07);
  animation: chipGlow 2.4s infinite;
}
@keyframes chipGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 197, 24, 0.14); }
  50% { box-shadow: 0 0 0 5px rgba(245, 197, 24, 0); }
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: linear-gradient(145deg, #1a2637, #0d141e);
  color: var(--yellow);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
}
.avatar.big { width: 54px; height: 54px; font-size: 20px; }

/* ===================== sidebar ===================== */
.sidebar {
  grid-area: side;
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 16px 10px 24px;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.6), rgba(5, 7, 11, 0.2));
}
.side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2px 8px 12px;
}
.side-head span { font-weight: 700; font-size: 14px; }
.side-head small { font-size: 9px; letter-spacing: 0.12em; color: var(--muted-2); }
.side-search { position: relative; margin: 0 4px 12px; }
.side-search input { height: 32px; font-size: 12px; }
.side-search svg { width: 13px; height: 13px; left: 10px; }
.side-sort { display: flex; gap: 4px; margin: 0 4px 10px; }
.side-sort button {
  flex: 1;
  height: 27px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #0a0f16;
  color: var(--muted);
  font-size: 11px;
  transition: 0.15s;
}
.side-sort button:hover { color: var(--text); border-color: var(--line-2); }
.side-sort button.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #10130a;
  font-weight: 700;
}
.list-head {
  display: flex;
  justify-content: space-between;
  padding: 0 10px 8px;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
}
.market-list { display: flex; flex-direction: column; gap: 2px; }
.market-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 8px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.market-row:hover { background: var(--panel-2); }
.market-row.active {
  background: linear-gradient(90deg, rgba(245, 197, 24, 0.13), rgba(245, 197, 24, 0.015));
  border-color: rgba(245, 197, 24, 0.16);
}
.market-sym {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}
.market-sym b { font-size: 12.5px; font-weight: 700; letter-spacing: 0.01em; }
.market-sym small { font-size: 9px; color: var(--muted-2); }
.market-price {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.market-vol {
  font-size: 9px;
  font-family: var(--mono);
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}
.market-chg { font-size: 10px; text-align: right; font-family: var(--mono); color: var(--muted); }
.market-chg.up { color: var(--up); }
.market-chg.down { color: var(--down); }
.list-empty { padding: 28px 14px; text-align: center; color: var(--muted-2); font-size: 12px; line-height: 1.7; }

/* ===================== main ===================== */
.main {
  grid-area: main;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 22px 40px;
}
.source-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid rgba(246, 70, 93, 0.28);
  background: linear-gradient(90deg, rgba(246, 70, 93, 0.09), rgba(246, 70, 93, 0.02));
}
.source-banner-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.source-banner-text strong { font-size: 13px; color: #ffb5bf; }
.source-banner-text span {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 60vw;
}
.banner-actions { display: flex; gap: 8px; }

.symbol-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: end;
  padding: 2px 2px 18px;
}
.sym-title { display: flex; flex-direction: column; gap: 6px; }
.sym-line { display: flex; align-items: center; gap: 10px; }
.sym-line h1 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 34px);
  letter-spacing: -0.02em;
  font-weight: 700;
}
.tag {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line-2);
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--panel-2);
}
.sym-sub { font-size: 11px; color: var(--muted-2); letter-spacing: 0.04em; }
.price-line { display: flex; align-items: center; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.last-price {
  font-family: var(--mono);
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.last-price.up { color: var(--up); }
.last-price.down { color: var(--down); }
.change-pill {
  font-family: var(--mono);
  font-size: 13px;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.change-pill.up { color: var(--up); background: rgba(14, 203, 129, 0.08); border-color: rgba(14, 203, 129, 0.22); }
.change-pill.down { color: var(--down); background: rgba(246, 70, 93, 0.08); border-color: rgba(246, 70, 93, 0.22); }
.stat-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.stat-grid > div {
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 22, 33, 0.7), rgba(9, 14, 21, 0.5));
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-grid span { font-size: 10px; color: var(--muted-2); letter-spacing: 0.05em; }
.stat-grid b { font-family: var(--mono); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ===================== chart ===================== */
.chart-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(13, 19, 28, 0.85), rgba(7, 11, 17, 0.85));
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.tf-group {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
}
.tf-group button { flex: 0 0 auto; }
.tf-more { position: relative; flex: 0 0 auto; }
#tfMoreBtn { display: inline-flex; align-items: center; gap: 4px; }
#tfMoreBtn .caret {
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.7;
}
.tf-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 92px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0b1220;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.tf-group .tf-menu button {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  text-align: left;
  border-radius: 5px;
}
.tf-group button {
  height: 28px;
  min-width: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  transition: 0.15s;
}
.tf-group button:hover { color: var(--text); background: var(--panel-2); }
.tf-group button.active { color: #161200; background: var(--yellow); font-weight: 700; }
.chart-legend {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  white-space: nowrap;
  overflow: hidden;
}
.chart-legend b { color: var(--muted); font-weight: 500; }
.chart-body { position: relative; height: clamp(300px, 46vh, 460px); }
#chart { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.draw-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 13, 20, 0.55);
  overflow-x: auto;
  scrollbar-width: none;
}
.draw-tools::-webkit-scrollbar { display: none; }
.draw-tools button {
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  transition: 0.15s;
}
.draw-tools button:hover { color: var(--text); background: var(--panel-2); }
.draw-tools button.active { background: rgba(245, 197, 24, 0.14); color: var(--yellow); }
.draw-tools .sep { width: 1px; height: 14px; margin: 0 2px; background: var(--line); }
@media (max-width: 640px) {
  .draw-tools button { height: 30px; padding: 0 10px; font-size: 12px; }
}
.chart-head-right { display: flex; align-items: center; gap: 14px; margin-left: auto; min-width: 0; }
.chart-src {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #080d14;
  flex: 0 0 auto;
}
.chart-src button {
  height: 22px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  transition: 0.15s;
}
.chart-src button:hover { color: var(--text); }
.chart-src button.active { background: var(--panel-3); color: var(--text); font-weight: 600; }
.tv-chart { position: absolute; inset: 0; background: #0b1018; }
.tv-chart iframe { display: block; width: 100%; height: 100%; border: 0; }
.chart-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.04em;
  background: rgba(6, 10, 15, 0.35);
  pointer-events: none;
}

/* ===================== main cards ===================== */
.main-cards {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(13, 19, 28, 0.75), rgba(7, 11, 17, 0.6));
  padding: 14px 16px 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.panel-head h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
.mini-alerts { display: flex; flex-direction: column; gap: 6px; }
.mini-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(15, 22, 33, 0.5);
  font-size: 12px;
  cursor: pointer;
  transition: 0.15s;
}
.mini-alert:hover { border-color: var(--line-2); background: var(--panel-2); }
.mini-alert .ma-dir { font-family: var(--mono); color: var(--yellow); font-size: 11px; }
.mini-alert .ma-note { color: var(--muted-2); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-alert .ma-status { font-size: 10px; color: var(--muted-2); }
.mini-empty {
  padding: 21px 10px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  border: 1px dashed var(--line-2);
  border-radius: 9px;
  line-height: 1.7;
}
.guide-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 11px; }
.guide-list li { display: flex; flex-direction: column; gap: 3px; padding-left: 14px; position: relative; }
.guide-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--yellow);
  opacity: 0.8;
}
.guide-list b { font-size: 12px; font-weight: 600; }
.guide-list span { font-size: 11px; color: var(--muted); line-height: 1.6; }
.guide-click { cursor: pointer; border-radius: 8px; transition: 0.15s; }
.guide-click:hover { background: rgba(245, 197, 24, 0.05); }
.guide-click:hover b { color: var(--yellow); }
.guide-click:focus-visible { outline: 1px solid rgba(245, 197, 24, 0.45); outline-offset: 4px; }
.guide-go { font-style: normal; font-size: 10px; color: var(--yellow); margin-left: 6px; }
.channel-card.channel-flash {
  border-color: rgba(245, 197, 24, 0.6);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.08);
}

/* ===================== rail ===================== */
.rail {
  grid-area: rail;
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.65), rgba(5, 7, 11, 0.3));
  padding: 14px 14px 30px;
}
.rail-head {
  position: sticky;
  top: -14px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0 12px;
  margin-top: -6px;
  background: rgba(7, 10, 15, 0.92);
  backdrop-filter: blur(8px);
}
.seg {
  display: flex;
  padding: 3px;
  gap: 3px;
  border-radius: 9px;
  background: #080d14;
  border: 1px solid var(--line);
}
.seg button {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.15s;
}
.seg button.active { background: var(--panel-3); color: var(--text); }
.seg b {
  font-family: var(--mono);
  font-size: 10px;
  background: rgba(245, 197, 24, 0.14);
  color: var(--yellow);
  border-radius: 4px;
  padding: 1px 5px;
}
.rail-body { display: flex; flex-direction: column; gap: 9px; }
.alert-item {
  position: relative;
  padding: 12px 12px 11px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 24, 36, 0.85), rgba(9, 14, 21, 0.85));
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  overflow: hidden;
}
.alert-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: var(--up);
}
.alert-item.below::before { background: var(--down); }
.alert-item:hover { border-color: var(--line-2); transform: translateY(-1px); }
.alert-item.paused { opacity: 0.55; }
.alert-item.triggered { opacity: 0.6; }
.alert-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.alert-sym { font-weight: 700; font-size: 13px; letter-spacing: 0.01em; }
.alert-sym small { font-weight: 500; color: var(--muted-2); font-size: 9px; margin-left: 4px; }
.alert-state { font-size: 9px; letter-spacing: 0.08em; color: var(--muted-2); border: 1px solid var(--line); padding: 2px 5px; border-radius: 4px; }
.alert-state.on { color: var(--up); border-color: rgba(14, 203, 129, 0.3); background: rgba(14, 203, 129, 0.07); }
.alert-cond {
  margin-top: 9px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-family: var(--mono);
}
.alert-cond em { font-style: normal; font-size: 11px; color: var(--muted); }
.alert-cond b { font-size: 18px; letter-spacing: -0.02em; color: #fff; font-weight: 600; }
.alert-cond span { font-size: 10px; color: var(--muted-2); }
.alert-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.alert-distance { font-size: 10px; color: var(--muted); }
.alert-distance.close { color: var(--yellow); }
.alert-note { font-size: 10px; color: var(--muted-2); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-item.has-error { border-color: rgba(246, 70, 93, 0.4); }
.alert-item.has-error::before { background: var(--down); }
.alert-state.err { color: var(--down); border-color: rgba(246, 70, 93, 0.35); background: rgba(246, 70, 93, 0.08); }
.alert-warn {
  margin-top: 7px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 10px;
  line-height: 1.55;
  white-space: normal;
  color: #ffb3bd;
  background: rgba(246, 70, 93, 0.09);
  border: 1px solid rgba(246, 70, 93, 0.22);
}
.alert-warn-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 11px;
  border-radius: 10px;
  background: rgba(246, 70, 93, 0.1);
  border: 1px solid rgba(246, 70, 93, 0.3);
}
.alert-warn-banner b { font-size: 11px; color: #ff9aa8; }
.alert-warn-banner span { font-size: 10px; line-height: 1.55; color: var(--muted); }
.alert-warn-banner button {
  align-self: flex-start;
  margin-top: 2px;
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 5px;
  color: #ffd7dc;
  border: 1px solid rgba(246, 70, 93, 0.4);
  background: rgba(246, 70, 93, 0.14);
}
.alert-warn-banner button:hover { background: rgba(246, 70, 93, 0.24); }
.alert-error-hint {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.6;
  color: #ffb3bd;
  background: rgba(246, 70, 93, 0.09);
  border: 1px solid rgba(246, 70, 93, 0.25);
}
.push-health {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(246, 70, 93, 0.09);
  border: 1px solid rgba(246, 70, 93, 0.3);
}
.push-health b { font-size: 11px; color: #ff9aa8; }
.push-health span { font-size: 11px; line-height: 1.6; color: #ffc4cb; }
.push-health small { font-size: 10px; color: var(--muted-2); }
.alert-actions { display: flex; align-items: center; gap: 4px; }
.alert-actions button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-2);
  transition: 0.15s;
}
.alert-actions button:hover { background: var(--panel-3); color: var(--text); }
.alert-actions button.danger:hover { color: var(--down); }
.alert-actions svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.rail-empty {
  padding: 40px 20px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.8;
}
.rail-empty b { display: block; color: var(--muted); font-size: 13px; margin-bottom: 5px; }

.history-item {
  position: relative;
  padding: 11px 12px 11px 22px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(12, 18, 27, 0.6);
}
.history-item::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--down);
  box-shadow: 0 0 10px rgba(246, 70, 93, 0.6);
}
.history-item.above::before { background: var(--up); box-shadow: 0 0 10px rgba(14, 203, 129, 0.55); }
.history-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.history-sym { font-size: 12px; font-weight: 700; }
.history-time { font-size: 10px; color: var(--muted-2); font-family: var(--mono); }
.history-msg { margin-top: 4px; font-size: 11px; color: var(--muted); line-height: 1.55; }
.delivery { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.delivery span { font-size: 9px; padding: 2px 5px; border-radius: 4px; border: 1px solid var(--line); color: var(--muted-2); }
.delivery span.ok { color: var(--up); border-color: rgba(14, 203, 129, 0.25); }
.delivery span.fail { color: var(--down); border-color: rgba(246, 70, 93, 0.25); }

/* ===================== buttons / forms ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  transition: 0.16s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: #32435c; }
.btn.primary {
  background: linear-gradient(180deg, var(--yellow-2), var(--yellow));
  border-color: var(--yellow);
  color: #161200;
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.btn.danger { background: rgba(246, 70, 93, 0.08); border-color: rgba(246, 70, 93, 0.3); color: #ff8b9a; }
.btn.danger:hover { background: rgba(246, 70, 93, 0.16); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 11px; border-radius: 7px; }
.btn.lg { height: 46px; padding: 0 24px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > span, .field > label > span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.field input, .field select, .channel-grid input, .channel-grid select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #080d14;
  color: var(--text);
  outline: none;
  transition: 0.18s;
  font-size: 13px;
}
.field input:focus, .field select:focus, .channel-grid input:focus, .channel-grid select:focus {
  border-color: rgba(245, 197, 24, 0.55);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.07);
}
.field input::placeholder { color: #445267; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 11px; color: var(--muted-2); line-height: 1.7; margin: 4px 0 0; }
.form-error {
  margin: 0 0 12px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid rgba(246, 70, 93, 0.3);
  background: rgba(246, 70, 93, 0.07);
  color: #ff9daa;
  font-size: 12px;
}
.checkline { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.checkline input { width: auto; height: auto; accent-color: var(--yellow); }
input[type="range"] { accent-color: var(--yellow); height: 26px; padding: 0; background: transparent; border: 0; }

/* ===================== modal ===================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 4, 8, 0.72);
  backdrop-filter: blur(9px);
  overflow-y: auto;
}
.modal-card {
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  border: 1px solid var(--line-2);
  background: linear-gradient(180deg, #0e1520, #090e16);
  box-shadow: var(--shadow);
  animation: modalIn 0.18s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 14px;
  flex: 0 0 auto;
}
.modal-head h3 { margin: 5px 0 0; font-size: 19px; letter-spacing: -0.01em; }
.modal-card form { padding: 0 24px 22px; overflow-y: auto; }
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 24px 20px;
  flex: 0 0 auto;
}
.modal-actions.sticky { border-top: 1px solid var(--line); padding-top: 14px; }
.modal-actions .hint { margin-right: auto; }

.symbol-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #080d14;
  margin-bottom: 14px;
  position: relative;
}
.symbol-pick > span { font-size: 11px; color: var(--muted); }
.symbol-pick .symbol-combo { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.symbol-pick b { font-size: 15px; letter-spacing: 0.01em; }
.symbol-pick small { font-size: 11px; color: var(--muted-2); font-family: var(--mono); }
.symbol-pick input {
  width: 140px;
  height: auto;
  padding: 2px 20px 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent
    url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%238b9ab0' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right center / 11px 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  outline: none;
}
.symbol-pick input::placeholder { color: var(--muted-2); font-size: 13px; font-weight: 500; }
.symbol-pick input:focus { border: 0; box-shadow: none; color: var(--yellow); }
.symbol-options {
  position: absolute;
  z-index: 30;
  left: 10px;
  right: 10px;
  top: calc(100% + 5px);
  max-height: 258px;
  overflow-y: auto;
  padding: 5px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: #0b1220;
  box-shadow: var(--shadow);
}
.symbol-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.symbol-option b { font-weight: 600; letter-spacing: 0.01em; }
.symbol-option small { font-family: var(--mono); font-size: 11px; color: var(--muted-2); }
.symbol-option:hover, .symbol-option.on { background: var(--panel-3); }
.symbol-empty { padding: 12px; text-align: center; font-size: 12px; color: var(--muted-2); }
.dir-toggle { display: flex; gap: 5px; padding: 4px; border-radius: 10px; background: #080d14; border: 1px solid var(--line); }
.dir-toggle button {
  flex: 1;
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: 0.16s;
}
.dir-toggle button[data-dir="above"].active { background: rgba(14, 203, 129, 0.13); color: var(--up); box-shadow: inset 0 0 0 1px rgba(14, 203, 129, 0.3); }
.dir-toggle button[data-dir="below"].active { background: rgba(246, 70, 93, 0.13); color: var(--down); box-shadow: inset 0 0 0 1px rgba(246, 70, 93, 0.3); }
.quick-prices {
  display: flex;
  gap: 6px;
  margin: -4px 0 14px;
  flex-wrap: wrap;
}
.quick-prices button {
  height: 27px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #080d14;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  transition: 0.15s;
}
.quick-prices button:hover { border-color: rgba(245, 197, 24, 0.4); color: var(--yellow); }

/* ===================== settings ===================== */
.settings-card { max-width: 880px; }
.settings-layout {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  border-top: 1px solid var(--line);
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
}
.settings-nav button {
  height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 12px;
  transition: 0.15s;
}
.settings-nav button:hover { background: var(--panel-2); color: var(--text); }
.settings-nav button.active { background: rgba(245, 197, 24, 0.1); color: var(--yellow); font-weight: 600; }
.settings-panels { overflow-y: auto; min-height: 0; padding: 18px 20px 8px; }
.settings-panel { display: none; }
.settings-panel.active { display: block; animation: fadeIn 0.16s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.panel-desc { margin: 0 0 16px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.channel-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10, 15, 23, 0.65);
  padding: 14px;
  margin-bottom: 12px;
}
.channel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.channel-name { display: flex; align-items: center; gap: 10px; }
.channel-name b { display: block; font-size: 13px; }
.channel-name small { display: block; margin-top: 2px; font-size: 10px; color: var(--muted-2); }
.channel-badge {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-3);
  border: 1px solid var(--line-2);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--yellow);
}
.channel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.channel-grid.three { grid-template-columns: 1.2fr 0.8fr 1fr; align-items: end; }
.channel-grid label, .field label { display: flex; flex-direction: column; gap: 5px; font-size: 10px; color: var(--muted-2); margin-bottom: 9px; }
.channel-grid input, .channel-grid select { height: 36px; font-size: 12px; }
.channel-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.test-result { margin-right: auto; font-size: 10px; color: var(--muted-2); max-width: 68%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-result.ok { color: var(--up); }
.test-result.fail { color: var(--down); }
.channel-sub {
  margin-top: 4px;
  padding: 12px;
  border: 1px dashed rgba(245, 197, 24, 0.28);
  border-radius: 12px;
  background: rgba(245, 197, 24, 0.04);
}
.channel-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.channel-sub-head b { display: block; font-size: 12.5px; }
.channel-sub-head small { display: block; margin-top: 2px; font-size: 10px; color: var(--muted-2); }
.channel-sub .hint { margin: 0 0 0; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: #223046; border-radius: 999px; transition: 0.2s; }
.switch i::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s;
}
.switch input:checked + i { background: var(--yellow); }
.switch input:checked + i::after { transform: translateX(18px); background: #151100; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.setting-row b { display: block; font-size: 12.5px; }
.setting-row small { display: block; margin-top: 3px; font-size: 10px; color: var(--muted-2); }
.source-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}
.source-status div {
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(8, 13, 20, 0.7);
  min-width: 0;
}
.source-status span { display: block; font-size: 9px; color: var(--muted-2); margin-bottom: 4px; }
.source-status b { display: block; font-size: 12px; font-family: var(--mono); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.account-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(8, 13, 20, 0.6); margin-bottom: 14px; }
.account-card b { display: block; font-size: 15px; }
.account-card span { display: block; margin-top: 3px; font-size: 11px; color: var(--muted-2); }
.account-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 16px; }
.account-meta div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; }
.account-meta span { display: block; font-size: 9px; color: var(--muted-2); margin-bottom: 4px; }
.account-meta b { font-size: 12px; font-weight: 500; }
.account-email { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(10, 15, 23, 0.45); }
.account-quota { margin-bottom: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(10, 15, 23, 0.45); }
.quota-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.quota-row b { font-family: var(--mono); font-size: 12px; color: var(--text); }
.quota-bar { height: 6px; margin: 6px 0 12px; border-radius: 99px; background: #0a1017; overflow: hidden; }
.quota-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #0ecb81, #5b8cff); transition: width 0.4s ease; }
.account-quota .hint { margin: 0 0 10px; }
.quota-redeem { display: flex; gap: 8px; }
.quota-redeem input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: #080d14; color: var(--text); outline: none; font-size: 12px; }
.quota-redeem input:focus { border-color: rgba(245, 197, 24, 0.5); }
.mail-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.mail-actions .hint { margin: 0; font-size: 11px; }
.forgot-card, .bind-card { max-width: 460px; }

/* ===================== help ===================== */
.help-card { max-width: 620px; }
.help-body { padding: 0 24px 6px; overflow-y: auto; }
.help-step { display: flex; gap: 13px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.step-no {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(245, 197, 24, 0.1);
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}
.help-step h4 { margin: 2px 0 6px; font-size: 13px; }
.help-step p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.75; }
.help-step a { color: var(--yellow); text-decoration: none; border-bottom: 1px dashed rgba(245, 197, 24, 0.4); }
.help-step a:hover { color: var(--yellow-2); }
.help-step b { color: #cfd8e5; }
.help-warn { margin: 14px 0 4px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(246, 70, 93, 0.22); background: rgba(246, 70, 93, 0.05); }
.help-warn b { font-size: 12px; color: #ff9daa; }
.help-warn p { margin: 5px 0 0; font-size: 11px; color: var(--muted); line-height: 1.7; }

.welcome-card { max-width: 720px; }
.welcome-body { padding: 0 24px; overflow-y: auto; }
.welcome-lead { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.welcome-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.welcome-item { padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: #080d14; }
.welcome-item b { display: block; margin-bottom: 4px; font-size: 12.5px; }
.welcome-item span { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.welcome-steps { border-top: 1px solid var(--line); }
.welcome-steps .help-step:last-child { border-bottom: 0; }
.welcome-actions { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.welcome-mute { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.welcome-mute input { width: 14px; height: 14px; accent-color: var(--yellow); cursor: pointer; }
.welcome-btns { display: flex; gap: 8px; margin-left: auto; }

.home-contact-card { max-width: 460px; }
.home-contact-body { padding: 0 24px 22px; }
.home-contact-body p { margin: 0 0 14px; color: var(--muted); line-height: 1.7; }
@media (max-width: 640px) {
  .welcome-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .welcome-grid { grid-template-columns: 1fr; }
}

.tf-group .tf-menu .tf-menu-custom {
  height: 30px;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 5px 5px;
  color: var(--yellow);
}
.custom-tf-card { max-width: 380px; }
.custom-tf-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 24px; }
.custom-tf-hint { padding: 8px 24px 2px; }

/* ===================== alarm ===================== */
.alarm {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, rgba(246, 70, 93, 0.22), rgba(3, 5, 9, 0.96) 58%),
    rgba(2, 4, 8, 0.96);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
.alarm-inner { position: relative; z-index: 2; text-align: center; max-width: 620px; }
.alarm-rings { position: absolute; inset: -180px; pointer-events: none; z-index: -1; }
.alarm-rings i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 320px;
  height: 320px;
  margin: -160px 0 0 -160px;
  border-radius: 50%;
  border: 1px solid rgba(246, 70, 93, 0.36);
  animation: ringOut 2.6s ease-out infinite;
}
.alarm-rings i:nth-child(2) { animation-delay: 0.85s; }
.alarm-rings i:nth-child(3) { animation-delay: 1.7s; }
@keyframes ringOut {
  0% { transform: scale(0.38); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}
.alarm-inner h2 {
  margin: 14px 0 6px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: 0.01em;
  font-weight: 700;
}
.alarm-price {
  font-family: var(--mono);
  font-size: clamp(46px, 8vw, 88px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
  background: linear-gradient(180deg, #fff, #ffb3bd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.alarm-message { margin: 14px auto 26px; color: #c8d2e0; font-size: 14px; line-height: 1.7; max-width: 460px; }
.alarm-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.alarm-inner time { display: block; margin-top: 20px; font-size: 11px; color: var(--muted-2); font-family: var(--mono); }
.alarm .eyebrow { color: #ff8b9a; }

/* ===================== toasts ===================== */
.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 36px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #101823;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
  font-size: 12px;
  line-height: 1.55;
  animation: toastIn 0.18s ease-out;
}
.toast::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--up);
}
.toast.error::before { background: var(--down); }
.toast.info::before { background: var(--blue); }
@keyframes toastIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }

/* ===================== responsive ===================== */
.mobile-only { display: none !important; }
.sidebar-overlay { display: none; }

@media (max-width: 1380px) {
  .shell { grid-template-columns: 228px minmax(0, 1fr); }
  .chart-legend { display: none; }
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: 46px 64px auto;
    grid-template-areas:
      "nav nav"
      "top top"
      "side main";
    height: auto;
    min-height: 100vh;
  }
  .main { overflow: visible; }
  .rail { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); align-self: start; }
  .rail-body { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .rail-head { position: static; }
  .alarm-rings { display: none; }
}

@media (max-width: 900px) {
  .shell {
    display: block;
    min-height: 100vh;
  }
  .topbar {
    position: sticky;
    top: 0;
    height: 58px;
    padding: 0 12px;
    gap: 8px;
  }
  .mobile-only { display: grid !important; }
  .brand-text { display: none; }
  .top-actions { gap: 4px; }
  .conn { display: none; }
  .chip { height: 28px; padding: 0 8px; }
  .chip svg { width: 13px; height: 13px; }
  .sidebar {
    position: fixed;
    z-index: 70;
    top: 0;
    left: 0;
    bottom: 0;
    width: 270px;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    padding-top: 18px;
    padding-bottom: calc(30px + env(safe-area-inset-bottom));
    background: #070b11;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--line-2);
    box-shadow: 30px 0 60px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
  .sidebar.open { transform: none; }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(2, 4, 8, 0.6);
    backdrop-filter: blur(3px);
  }
  .sidebar-overlay.show { display: block; }
  .main { padding: 14px 12px 26px; overflow: visible; }
  .rail { padding: 14px 12px 34px; }
  .rail-body { display: flex; }
  .symbol-header { gap: 12px 14px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .main-cards { grid-template-columns: 1fr; }
  .chart-body { height: 300px; }
  .chart-head { flex-wrap: wrap; gap: 8px; }
  .source-banner-text span { max-width: 100%; white-space: normal; }
  .modal { padding: 12px; align-items: flex-start; }
  .modal-card { max-height: calc(100vh - 24px); margin: auto 0; }
  .modal-head { padding: 18px 18px 12px; }
  .modal-card form { padding: 0 18px 18px; }
  .modal-actions { padding: 12px 18px 16px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 10px;
  }
  .settings-nav button { white-space: nowrap; height: 32px; }
  .settings-panels { padding: 14px 16px 4px; }
  .channel-grid, .channel-grid.three { grid-template-columns: 1fr; }
  .source-status { grid-template-columns: 1fr; }
  .account-meta { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .top-actions .chip span { display: none; }
  .chip { width: 32px; padding: 0; justify-content: center; }
  .topbar { gap: 6px; }
  .brand { margin-right: auto; }
  .last-price { font-size: 34px; }
  .price-line { gap: 8px; }
  .symbol-header { grid-template-columns: 1fr; }
  .price-line { justify-content: flex-start; }
  .stat-grid b { font-size: 12px; }
  .auth-panel { padding: 20px; }
  .auth-card { padding: 26px 22px; }
  .field-row { grid-template-columns: 1fr; }
  .alarm-price { font-size: 54px; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-card { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .hint { display: block; width: 100%; order: -1; margin-bottom: 2px; }
  .source-actions .btn { flex: 1; }
  .toasts { right: 10px; bottom: 10px; }
}

@media (max-width: 980px) {
  .auth-view { grid-template-columns: 1fr; }
  .auth-art {
    padding: 26px;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(160deg, #0a0f17, #06090e);
  }
  .auth-copy { margin: 34px 0 12px; }
  .auth-copy h1 { font-size: 38px; }
  .auth-points, .auth-candles, .auth-foot { display: none; }
  .auth-panel { padding: 30px 20px 50px; }
}

/* ======================= 带单员 ======================= */
.up { color: var(--up); }
.down { color: var(--down); }

.lead-search { display: flex; gap: 6px; padding-bottom: 2px; }
.lead-search input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #080d14;
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.lead-search input:focus { border-color: var(--line-2); }
.lead-search input::placeholder { color: var(--muted-2); }
.lead-search button {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(245, 197, 24, 0.35);
  background: rgba(245, 197, 24, 0.12);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 600;
}
.lead-search button:hover { background: rgba(245, 197, 24, 0.2); }

.lead-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 4px;
}
.lead-toolbar select {
  height: 28px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #080d14;
  color: var(--muted);
  font-size: 11px;
  outline: none;
}
.lead-sorts {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #080d14;
}
.lead-sorts button {
  height: 22px;
  padding: 0 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 600;
}
.lead-sorts button.active { background: var(--panel-3); color: var(--text); }
.lead-refresh {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #080d14;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
}
.lead-refresh:hover { color: var(--text); border-color: var(--line-2); }

.lead-list { display: flex; flex-direction: column; gap: 6px; }
.lead-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  text-align: left;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(15, 22, 33, 0.5);
  transition: 0.15s;
}
.lead-row:hover { border-color: var(--line-2); background: var(--panel-2); }
.lead-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #1a1206;
  background: linear-gradient(160deg, var(--yellow-2), #d9a908);
}
.lead-avatar.lg { width: 42px; height: 42px; font-size: 17px; }
.lead-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.lead-name {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead-stats { display: flex; gap: 8px; font-size: 10.5px; color: var(--muted-2); font-family: var(--mono); }
.lead-stats b { font-weight: 600; }
.lead-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 0 0 auto; }
.lead-right b { font-family: var(--mono); font-size: 12px; }
.lead-right small { font-size: 9.5px; color: var(--muted-2); }
.lead-foot { padding: 4px 2px 0; font-size: 10.5px; color: var(--muted-2); text-align: center; }
.lead-warn {
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid rgba(246, 70, 93, 0.28);
  background: rgba(246, 70, 93, 0.08);
  color: #ff9aa8;
  font-size: 11px;
  line-height: 1.5;
}

.leader-card { max-width: 900px; }
.leader-body { padding: 0 24px 6px; overflow-y: auto; min-height: 0; }
.leader-summary { display: flex; flex-direction: column; gap: 12px; }
.leader-id { display: flex; align-items: center; gap: 11px; }
.leader-id b { display: block; font-size: 15px; }
.leader-id small { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.leader-id small i {
  font-style: normal;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 20px;
  color: var(--yellow);
  background: rgba(245, 197, 24, 0.1);
  border: 1px solid rgba(245, 197, 24, 0.22);
}
.leader-desc { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.65; }
.leader-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.leader-grid div {
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(15, 22, 33, 0.55);
}
.leader-grid span { display: block; font-size: 10.5px; color: var(--muted-2); }
.leader-grid b { display: block; margin-top: 4px; font-family: var(--mono); font-size: 13px; }
.leader-pos-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 0 9px;
}
.leader-pos-head h4 { margin: 0; font-size: 13px; }
.leader-pos-head h4 em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted-2);
  margin-left: 4px;
}
.leader-pos-head span { font-family: var(--mono); font-size: 11.5px; }
.pos-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.pos-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 11.5px; }
.pos-table th {
  text-align: right;
  padding: 9px 10px;
  color: var(--muted-2);
  font-weight: 500;
  font-size: 10.5px;
  background: rgba(19, 28, 41, 0.7);
  white-space: nowrap;
}
.pos-table th:first-child, .pos-table td:first-child { text-align: left; }
.pos-table td {
  padding: 9px 10px;
  text-align: right;
  font-family: var(--mono);
  border-top: 1px solid var(--line);
  white-space: nowrap;
}
.pos-sym { font-weight: 600; color: var(--text); }
.pos-side { padding: 2px 7px; border-radius: 5px; font-size: 10.5px; }
.pos-side.long { color: var(--up); background: rgba(14, 203, 129, 0.1); }
.pos-side.short { color: var(--down); background: rgba(246, 70, 93, 0.1); }

@media (max-width: 620px) {
  .leader-body { padding: 0 18px 4px; }
  .leader-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-sorts button { padding: 0 5px; }
}

.hint-inline { font-size: 10.5px; color: var(--muted-2); }
.trade-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-y: auto;
  max-height: 360px;
}
.trade-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 11px;
  border-top: 1px solid var(--line);
}
.trade-row:first-child { border-top: 0; }
.trade-sym { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-side { flex: 0 0 auto; font-size: 10px; padding: 2px 6px; border-radius: 5px; }
.trade-side.long { color: var(--up); background: rgba(14, 203, 129, 0.1); }
.trade-side.short { color: var(--down); background: rgba(246, 70, 93, 0.1); }
.trade-price, .trade-qty, .trade-time {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.trade-time { margin-left: auto; color: var(--muted); white-space: nowrap; }
@media (max-width: 620px) {
  /* 手机上不再隐藏时间：换成第二行完整显示开仓 / 平仓时间 */
  .trade-row { flex-wrap: wrap; row-gap: 3px; }
  .trade-time { flex: 1 1 100%; margin-left: 0; font-size: 10px; }
}

.trade-pnl { flex: 0 0 auto; font-family: var(--mono); font-size: 10.5px; }

/* ======================= 带单员入口 + 列表弹窗 ======================= */
.leaders-entry {
  border-color: rgba(245, 197, 24, 0.35);
  background: rgba(245, 197, 24, 0.1);
  color: var(--yellow);
}
.leaders-entry:hover { background: rgba(245, 197, 24, 0.18); }
.leaders-card { max-width: 980px; }
.leaders-body { padding: 0 24px 4px; overflow-y: auto; min-height: 0; }
.leaders-body .lead-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.leaders-body .lead-row { width: 100%; }
@media (max-width: 760px) {
  .leaders-body { padding: 0 18px 4px; }
  .leaders-body .lead-list { grid-template-columns: 1fr; }
  .leaders-entry { padding: 0 8px; }
}

.leaders-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 16px;
  text-align: left;
  border-radius: var(--radius);
  border: 1px solid rgba(245, 197, 24, 0.32);
  background:
    radial-gradient(420px 120px at 8% 0%, rgba(245, 197, 24, 0.18), transparent 70%),
    linear-gradient(100deg, rgba(245, 197, 24, 0.1), rgba(15, 22, 33, 0.75));
  transition: 0.16s;
}
.leaders-banner:hover {
  border-color: rgba(245, 197, 24, 0.55);
  transform: translateY(-1px);
}
.leaders-banner-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #1a1206;
  background: linear-gradient(160deg, var(--yellow-2), #d9a908);
}
.leaders-banner-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.leaders-banner-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.leaders-banner-text b { font-size: 14px; }
.leaders-banner-text small { font-size: 11px; color: var(--muted); }
.leaders-banner-cta {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--yellow);
  white-space: nowrap;
}
@media (max-width: 620px) {
  .leaders-banner { padding: 10px 12px; gap: 9px; }
  .leaders-banner-text small { display: none; }
  .leaders-banner-cta { font-size: 11px; }
}

.lead-watchbox {
  border: 1px solid rgba(245, 197, 24, 0.28);
  border-radius: 10px;
  padding: 9px 10px 10px;
  background: rgba(245, 197, 24, 0.06);
}
.lead-watch-head { font-size: 11px; color: var(--muted); margin-bottom: 7px; }
.lead-watch-head b { color: var(--yellow); font-family: var(--mono); }
.lead-watch-list { display: flex; flex-wrap: wrap; gap: 6px; }
.lead-watch-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  border: 1px solid rgba(245, 197, 24, 0.3);
  background: rgba(245, 197, 24, 0.1);
  overflow: hidden;
}
.lwc-name {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  padding: 4px 4px 4px 9px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lwc-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 0 7px 0 2px;
}
.lwc-remove:hover { color: var(--down); }
.lead-watch-tag {
  font-style: normal;
  font-size: 9px;
  font-weight: 500;
  color: var(--yellow);
  border: 1px solid rgba(245, 197, 24, 0.3);
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 5px;
}

.modal-head-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn.spinning svg { animation: icon-spin 0.8s linear infinite; }
@keyframes icon-spin { to { transform: rotate(360deg); } }

/* ===================== X 博主 ===================== */
.kol-bar { display: flex; align-items: center; gap: 8px; }
.kol-add { display: flex; flex: 1; min-width: 0; gap: 6px; }
.kol-add input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #080d14;
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.kol-add input:focus { border-color: rgba(245, 197, 24, 0.55); }
.kol-add button {
  height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: var(--yellow);
  color: #0b0f16;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.kol-add button:hover { background: var(--yellow-2); }
.kol-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  padding: 10px 11px;
  cursor: pointer;
  transition: 0.15s;
}
.kol-card:hover { border-color: var(--line-2); background: var(--panel-3); }
.kol-row { display: flex; align-items: center; gap: 8px; }
.kol-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: #1b2534; }
.kol-avatar-fallback { display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.kol-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.kol-meta b { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kol-meta small { font-size: 10px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kol-remove {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 16px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
}
.kol-remove:hover { color: var(--down); background: rgba(255, 255, 255, 0.05); }
.kol-test {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.kol-test:hover { border-color: var(--yellow); color: var(--yellow); }
.kol-test:disabled { opacity: 0.6; cursor: default; }
.kol-text {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  white-space: pre-wrap;
}
.kol-text-error { color: var(--down); }
.kol-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 10px; color: var(--muted-2); }
.kol-suggests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kol-suggests button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px;
  cursor: pointer;
}
.kol-suggests button:hover { border-color: var(--line-2); color: var(--text); }
.kol-search-results {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 15, 23, 0.85);
  max-height: 320px;
  overflow-y: auto;
  flex: 0 0 auto;
}
.kol-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: default;
}
.kol-result:hover { border-color: var(--line-2); background: var(--panel-3); }
.kol-result span { display: flex; flex-direction: column; min-width: 0; }
.kol-result b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kol-result small { font-size: 10px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kol-monitor-btn {
  flex: 0 0 auto;
  padding: 5px 12px;
  border: 1px solid var(--yellow);
  border-radius: 999px;
  background: var(--yellow);
  color: #14181d;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.kol-monitor-btn:hover { filter: brightness(1.08); }
.kol-monitor-btn.done {
  border-color: var(--line-2);
  background: transparent;
  color: var(--muted-2);
  cursor: default;
}
.kol-search-item {
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--panel-3);
  overflow: hidden;
  flex: 0 0 auto;
}
.kol-search-item + .kol-search-item { margin-top: 8px; }
.kol-search-item .kol-result { border: none; background: transparent; }
.kol-search-tweets {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 150px;
  overflow-y: auto;
  padding: 6px 9px 8px;
  border-top: 1px dashed var(--line);
}
.kol-search-tweets-head { font-size: 10px; color: var(--muted-2); margin-bottom: 2px; }
.kol-search-tweet {
  display: flex;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.55;
  text-decoration: none;
}
.kol-search-tweet:hover { background: rgba(255, 255, 255, 0.04); }
.kol-search-tweet span { flex: 0 0 auto; min-width: 54px; padding-top: 1px; font-size: 10px; color: var(--muted-2); }
.kol-search-tweet p { margin: 0; word-break: break-word; }
.kol-follow-row { margin-bottom: 6px; }
.kol-follow-btn {
  flex: 0 0 auto;
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.kol-follow-btn:hover { border-color: var(--yellow); color: var(--yellow); }
.kol-follow-del {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.kol-follow-del:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.kol-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.kol-list-head b { font-size: 11.5px; color: var(--muted); }
.kol-list-head span { font-size: 10px; color: var(--muted-2); }
.kol-search-empty { margin: 0; padding: 4px 2px; font-size: 11px; color: var(--muted-2); }
.kol-recommend {
  padding: 9px 10px;
  border: 1px dashed rgba(245, 197, 24, 0.24);
  border-radius: 10px;
  background: rgba(245, 197, 24, 0.035);
}
.kol-recommend-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kol-recommend-head b { font-size: 11.5px; color: var(--muted); }
.kol-recommend-head button {
  border: 0;
  background: transparent;
  color: var(--yellow);
  font-size: 10.5px;
  cursor: pointer;
  padding: 2px 4px;
}
.kol-recommend-head button:hover { text-decoration: underline; }
.kol-recommend .kol-suggests { margin-top: 6px; }
.kol-note { margin: 7px 0 0; font-size: 10px; line-height: 1.6; color: var(--muted-2); }
.kol-tip {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(240, 185, 11, 0.25);
  background: rgba(240, 185, 11, 0.07);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}
.kol-tip b { color: var(--yellow); }
#kolsModal .modal-card { max-width: 720px; }
.kol-body { display: flex; flex-direction: column; gap: 9px; }
.kol-body .kol-list { display: flex; flex-direction: column; gap: 8px; }

/* ===================== 欧易实盘 ===================== */
#okxModal .modal-card { max-width: 720px; }
.okx-result-actions { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; align-items: stretch; }
.okx-test-mini {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.okx-test-mini:hover { border-color: var(--yellow); color: var(--yellow); }
.okx-test-mini:disabled { opacity: 0.6; cursor: default; }
.okx-stats { display: flex; flex-wrap: wrap; gap: 3px 10px; margin-top: 5px; font-size: 10px; color: var(--muted-2); }
.okx-stats b { font-size: 11px; }
.okx-pos {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 2px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
}
.okx-pos:first-child { border-top: 0; }
.okx-pos-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.okx-pos-main b { font-size: 11.5px; color: var(--text); }
.okx-pos-main small { font-size: 10px; color: var(--muted-2); }
.okx-pos-right { display: flex; flex-direction: column; gap: 2px; text-align: right; flex: 0 0 auto; }
.okx-pos-right b { font-size: 11.5px; }
.okx-pos-right small { font-size: 10px; color: var(--muted-2); }
.okx-empty { margin: 7px 0 0; font-size: 10px; color: var(--muted-2); }
.okx-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.okx-follow-actions { margin: 0 2px 8px; }
.okx-pos-list {
  margin: 0 2px 10px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}
.okx-actions button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 10px;
  cursor: pointer;
}
.okx-actions button:hover { border-color: var(--yellow); color: var(--yellow); }
.okx-actions button:disabled { opacity: 0.6; cursor: default; }
.okx-split { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 2px; }

/* ===================== 卡密 / 用户库 ===================== */
.invite-gen { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.invite-gen label { display: flex; flex-direction: column; gap: 5px; font-size: 10px; color: var(--muted-2); }
.invite-gen input {
  width: 120px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #080d14;
  color: var(--text);
  font-size: 12px;
  outline: none;
}
.invite-gen input:focus { border-color: rgba(245, 197, 24, 0.55); }
.admin-table-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.admin-table th,
.admin-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-2);
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 600;
}
.admin-table tbody tr:hover { background: var(--panel-3); }
.admin-table code { font-family: var(--mono); font-size: 12px; color: var(--yellow); }
.tag { padding: 2px 7px; border-radius: 999px; font-size: 10px; }
.tag.fresh { color: var(--up); background: rgba(14, 203, 129, 0.12); }
.tag.used { color: var(--muted); background: rgba(255, 255, 255, 0.06); }
.tag.expired { color: var(--down); background: rgba(246, 70, 93, 0.12); }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 2px 4px; }
.link-btn.danger:hover { color: var(--down); }
.row-actions .link-btn { margin-right: 4px; }
.row-actions .link-btn:last-child { margin-right: 0; }
.push-cell { max-width: 240px; white-space: normal; }
.visitor-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.visitor-ua, .visitor-ref { max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visitor-region { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.push-tag {
  display: inline-block;
  margin: 1px 4px 1px 0;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(91, 140, 255, 0.12);
  color: var(--blue);
  font-size: 10px;
  white-space: nowrap;
}
.push-empty { color: var(--muted-2); font-size: 11px; }
.push-tag.ok { background: rgba(14, 203, 129, 0.12); color: var(--up); }
.push-tag.fail { background: rgba(246, 70, 93, 0.12); color: var(--down); }
.push-state { font-size: 11px; color: var(--muted); white-space: nowrap; }
.push-state.ok { color: var(--up); }
.push-state.fail { color: var(--down); }
.push-time { white-space: nowrap; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.push-log-content { max-width: 320px; }
.push-log-content b { display: block; font-size: 12px; font-weight: 600; color: #cfd8e5; }
.push-log-content span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted-2);
  max-height: 32px;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.table-empty,
.table-error { padding: 18px; text-align: center; color: var(--muted-2); font-size: 11px; }
.table-error { color: var(--down); }

/* ---------------- 账户持仓 ---------------- */
.rail-head .seg { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.rail-head .seg::-webkit-scrollbar { display: none; }
.rail-head .seg button { flex: 0 0 auto; padding: 0 8px; }
.rail-head #newAlertBtn { flex: 0 0 auto; }

.account-card { max-width: 460px; }
.account-body { padding: 2px 24px 4px; display: flex; flex-direction: column; gap: 10px; }

.pos-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pos-cell {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 24, 36, 0.85), rgba(9, 14, 21, 0.85));
}
.pos-cell span { display: block; font-size: 10px; letter-spacing: 0.06em; color: var(--muted); }
.pos-cell b { display: block; margin-top: 4px; font-family: var(--mono); font-size: 15px; font-weight: 700; }
.text-up { color: var(--up); }
.text-down { color: var(--down); }

.pos-assets { display: flex; flex-wrap: wrap; gap: 6px; }
.pos-asset {
  font-size: 10.5px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.pos-asset b { color: var(--text); font-family: var(--mono); font-weight: 600; }

.pos-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pos-head small { color: var(--muted-2); font-size: 10.5px; }
.pos-actions { display: flex; gap: 10px; }

.pos-empty {
  padding: 18px 14px;
  border-radius: 11px;
  border: 1px dashed var(--line-2);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}
.pos-empty-actions { margin-top: 12px; display: flex; gap: 8px; justify-content: center; }

.pos-item {
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 24, 36, 0.85), rgba(9, 14, 21, 0.85));
}
.pos-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pos-sym { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.pos-side { font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.pos-side.long { color: var(--up); background: rgba(22, 199, 132, 0.12); }
.pos-side.short { color: var(--down); background: rgba(246, 70, 93, 0.12); }
.pos-pnl { font-family: var(--mono); font-size: 13px; font-weight: 700; text-align: right; }
.pos-pnl small { display: block; font-size: 10px; font-weight: 500; opacity: 0.8; }
.pos-meta { margin-top: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pos-meta div { font-size: 10px; color: var(--muted); }
.pos-meta b { display: block; margin-top: 2px; font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text); }

/* ===================== 用户详情弹窗 ===================== */
.user-detail-card { max-width: 720px; }
.user-detail-body { max-height: 62vh; overflow-y: auto; padding: 2px 2px 12px; }
.ud-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.ud-grid > div {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; background: var(--panel-3); border: 1px solid var(--line);
  border-radius: 8px; font-size: 12px;
}
.ud-grid span { color: var(--muted); flex: 0 0 auto; }
.ud-grid b { font-weight: 600; text-align: right; word-break: break-all; }
.ud-expiry.up { color: var(--up); }
.ud-expiry.warn { color: var(--yellow); }
.ud-expiry.down { color: var(--down); }
.ud-push { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ud-push-item {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; background: var(--panel-3);
  border: 1px solid var(--line); border-radius: 8px;
}
.ud-push-head { display: flex; align-items: center; gap: 6px; }
.ud-push-value { flex: 1 1 220px; word-break: break-all; font-size: 11px; color: var(--muted); }
.ud-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.ud-stats span {
  padding: 8px 6px; text-align: center; font-size: 11px; color: var(--muted);
  background: var(--panel-3); border: 1px solid var(--line); border-radius: 8px;
}
.ud-stats b { display: block; font-family: var(--mono); font-size: 17px; color: var(--text); }
.ud-stats i { font-style: normal; color: var(--muted-2); }
.ud-section { margin-top: 12px; }
.ud-section h4 {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 600;
}
.ud-section h4 small { color: var(--muted-2); font-weight: 500; }
.ud-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--line); font-size: 12px;
}
.ud-row b { font-weight: 600; }
.ud-row small { color: var(--muted); margin-right: auto; word-break: break-all; }
.ud-badge {
  flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; font-size: 10px;
  color: var(--muted); border: 1px solid var(--line-2);
}
.ud-badge.on { color: var(--up); border-color: rgba(14, 203, 129, 0.45); background: rgba(14, 203, 129, 0.08); }
.ud-empty { margin: 4px 0; font-size: 12px; color: var(--muted-2); }
.ud-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
}
@media (max-width: 640px) {
  .ud-grid { grid-template-columns: 1fr; }
  .ud-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===================== 板块推送铃声 ===================== */
.ring-icon { width: 30px; height: 30px; flex: 0 0 auto; }
.ring-icon svg { width: 17px; height: 17px; stroke-linecap: round; stroke-linejoin: round; }
.ring-open { flex: 0 0 auto; }
.ring-card { width: min(460px, calc(100vw - 32px)); }
.ring-body { padding: 0 24px 4px; overflow-y: auto; }
.ring-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
}
.ring-head b { display: block; font-size: 14px; }
.ring-head small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.ring-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ring-body .checkline { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.ring-body .hint { margin: 0 0 10px; font-size: 11px; color: var(--muted-2); line-height: 1.6; }
.ring-card .modal-actions .test-result { margin-right: auto; }
@media (max-width: 640px) {
  .ring-grid { grid-template-columns: 1fr; }
  .ring-body { padding: 0 16px 4px; }
}

/* ===================== fund flow ===================== */
.ff-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px 10px; flex-wrap: wrap; }
.ff-toolbar .hint { font-size: 11px; color: var(--muted-2); }
.ff-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ff-tabs { flex: 0 0 auto; }
.ff-tabs button { height: 26px; padding: 0 10px; font-size: 11px; }
.ff-sort { flex: 0 0 auto; }
.ff-sort button { height: 26px; padding: 0 9px; font-size: 11px; }
.ff-body { padding: 0 0 4px; }
.ff-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.ff-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: #0a0f17;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.ff-table th.ff-num, .ff-table td.ff-num { text-align: right; }
.ff-table tbody td { padding: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.ff-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.ff-table tbody tr:last-child td { border-bottom: 0; }
.ff-rank { width: 30px; font-family: var(--mono); font-size: 11px; color: var(--muted-2); }
.ff-coin { display: flex; align-items: center; gap: 9px; }
.ff-token {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.ff-coin-name b { display: block; font-size: 12.5px; font-weight: 600; }
.ff-coin-name small { display: block; margin-top: 1px; font-size: 10px; color: var(--muted-2); }
.ff-num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ff-dim { color: var(--muted); }
.ff-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 640px) {
  .ff-table thead th, .ff-table tbody td { padding: 8px 6px; }
  .ff-table th:nth-child(1), .ff-table td:nth-child(1),
  .ff-table th:nth-child(5), .ff-table td:nth-child(5),
  .ff-table th:nth-child(6), .ff-table td:nth-child(6),
  .ff-table th:nth-child(7), .ff-table td:nth-child(7),
  .ff-table th:nth-child(8), .ff-table td:nth-child(8),
  .ff-table th:nth-child(9), .ff-table td:nth-child(9),
  .ff-table th:nth-child(10), .ff-table td:nth-child(10),
  .ff-table th:nth-child(11), .ff-table td:nth-child(11),
  .ff-table th:nth-child(12), .ff-table td:nth-child(12) { display: none; }
  .ff-toolbar { padding: 0 16px 10px; }
}

/* ===================== 在线客服 ===================== */
.support-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #111;
  background: linear-gradient(160deg, #ffd84d, #f5c518);
  border: 1px solid rgba(245, 197, 24, 0.6);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(245, 197, 24, 0.08);
  transition: 0.16s;
}
.support-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 0 5px rgba(245, 197, 24, 0.12);
}
.support-fab svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.support-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--down);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  border: 2px solid #06080c;
}

.support-card { max-width: 760px; }
.support-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  height: min(62vh, 540px);
  border-top: 1px solid var(--line);
}
.support-card.admin-mode .support-layout { grid-template-columns: 220px minmax(0, 1fr); }
.support-side {
  display: none;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: rgba(8, 12, 18, 0.5);
}
.support-card.admin-mode .support-side { display: flex; }
.support-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 8px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.support-threads { flex: 1 1 auto; overflow-y: auto; padding: 0 8px 10px; }
.support-thread {
  display: block;
  width: 100%;
  margin-bottom: 3px;
  padding: 9px 10px;
  text-align: left;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  transition: 0.14s;
}
.support-thread:hover { background: var(--panel-2); }
.support-thread.active {
  background: rgba(245, 197, 24, 0.1);
  border-color: rgba(245, 197, 24, 0.28);
}
.support-thread-top,
.support-thread-bottom { display: flex; align-items: center; gap: 6px; }
.support-thread-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-thread-time { flex: 0 0 auto; font-size: 10px; color: var(--muted-2); }
.support-thread-msg {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-thread-dot {
  flex: 0 0 auto;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--down);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.support-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.support-messages {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px 18px;
}
.support-empty {
  margin: auto;
  padding: 20px;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}
.support-empty b { display: block; margin-bottom: 4px; font-size: 13px; color: var(--text); }
.support-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; }
.support-msg.mine { align-self: flex-end; align-items: flex-end; }
.support-bubble {
  padding: 9px 12px;
  border-radius: 13px;
  border-top-left-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.support-msg.mine .support-bubble {
  border-radius: 13px;
  border-top-right-radius: 4px;
  background: rgba(245, 197, 24, 0.14);
  border-color: rgba(245, 197, 24, 0.32);
}
.support-msg time { margin-top: 3px; font-size: 10px; color: var(--muted-2); }
.modal-card .support-form {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px 14px;
  overflow: visible;
  border-top: 1px solid var(--line);
}
.support-form textarea {
  flex: 1 1 auto;
  min-height: 40px;
  max-height: 120px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #080d14;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  resize: none;
}
.support-form textarea:focus { outline: none; border-color: rgba(245, 197, 24, 0.5); }
.support-form .btn { flex: 0 0 auto; height: 40px; }

@media (max-width: 700px) {
  .support-card { max-width: 100%; }
  .support-layout { height: min(72vh, 620px); grid-template-columns: minmax(0, 1fr); }
  .support-card.admin-mode .support-layout { grid-template-columns: minmax(0, 1fr); }
  .support-card.admin-mode .support-side { max-height: 148px; border-right: 0; border-bottom: 1px solid var(--line); }
  .support-threads { display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 0 8px 8px; }
  .support-thread { flex: 0 0 160px; margin-bottom: 0; border-color: var(--line); }
  .support-fab { right: 16px; bottom: 16px; width: 48px; height: 48px; }
}

.modal-card.wide { max-width: 780px; }
.card-tabs {
  display: flex; gap: 6px; padding: 8px 18px 4px;
  border-bottom: 1px solid var(--line);
}
.card-tabs button {
  position: relative; padding: 8px 14px; background: transparent; border: 0;
  color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer;
  border-radius: 8px 8px 0 0; transition: color .15s, background .15s;
}
.card-tabs button:hover { color: var(--text); }
.card-tabs button.active { color: var(--text); background: var(--panel-3); }
.card-tabs .count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  font-size: 11px; border-radius: 10px; background: var(--line); color: var(--muted);
}
.card-tabs button.active .count { background: var(--panel-2); color: var(--text); }

.broadcast-form { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.broadcast-form label { display: flex; flex-direction: column; gap: 4px; }
.broadcast-form label > span { font-size: 12px; color: var(--muted); }
.broadcast-form input[type=text],
.broadcast-form textarea,
.broadcast-form select {
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font-size: 13px;
}
.broadcast-form textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.broadcast-target select { flex: 0 0 auto; }

.monitor-hint {
  margin-top: 10px; padding: 8px 12px; border-radius: 8px;
  background: var(--panel-3); color: var(--muted);
  font-size: 12px; line-height: 1.5;
}
.monitor-hint.hidden { display: none; }

.plan-choices { display: flex; gap: 16px; align-items: center; }
.plan-choices label { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.plan-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
#planPaidBox { display: flex; flex-direction: column; gap: 6px; }
#planPaidBox.hidden { display: none; }

.push-reminder {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; font-size: 13px;
  color: #7a4a00; background: #fff4d6;
  border-bottom: 1px solid #f0d38a;
}
.push-reminder span { flex: 1; line-height: 1.45; }
.push-reminder.hidden { display: none; }
.push-reminder .icon-btn { width: 26px; height: 26px; flex: none; }

.plan-extend { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.plan-extend span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.plan-extend input { width: 88px; flex: none; }

.orbit-config { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: var(--panel-2); }
.orbit-config-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0; font-size: 12px; color: var(--muted); }
.orbit-key-form { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.orbit-key-form input { flex: 1 1 180px; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 13px; }
.orbit-key-form button { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--accent); color: #fff; font-size: 13px; cursor: pointer; }
.orbit-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(240, 185, 11, 0.16); color: #f0b90b; font-size: 11px; }
.orbit-resolved { margin: 8px 0; }
.orbit-hist-row { border-top: 1px dashed var(--line); }
.orbit-liq { font-style: normal; font-size: 11px; color: #f6465d; }
.orbit-history { margin: 6px 0 12px; }

/* ===================== 市场情绪 ===================== */
.mood-card {
  margin: 0 0 14px;
  padding: 13px 16px 11px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(520px 140px at 88% -20%, rgba(91, 140, 255, 0.12), transparent 70%),
    linear-gradient(100deg, rgba(255, 255, 255, 0.028), rgba(10, 15, 23, 0.9));
}
.mood-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mood-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mood-title svg { width: 17px; height: 17px; fill: none; stroke: var(--yellow); stroke-width: 1.5; flex: none; }
.mood-title b { font-size: 13px; letter-spacing: 0.02em; white-space: nowrap; }
.mood-title small { color: var(--muted-2); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mood-updated { color: var(--muted-2); font-size: 11px; font-family: var(--mono); white-space: nowrap; }

.mood-body {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) minmax(170px, 280px);
  gap: 18px;
  align-items: center;
  margin-top: 9px;
}
.mood-score { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mood-score b { font-size: 36px; line-height: 1; font-family: var(--mono); font-weight: 700; letter-spacing: -0.02em; }
.mood-score span { font-size: 13px; font-weight: 600; }
.mood-score small { color: var(--muted-2); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mood-scale { min-width: 0; }
.mood-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f6465d, #f5a623 25%, #8b9ab0 50%, #3fbf7f 75%, #0ecb81);
  opacity: 0.9;
}
.mood-track i {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  transition: left 0.5s ease;
}
.mood-ticks { display: flex; justify-content: space-between; gap: 4px; margin-top: 7px; color: var(--muted-2); font-size: 10px; }
.mood-ticks span { white-space: nowrap; }

.mood-chart { position: relative; min-width: 0; padding-top: 12px; }
.mood-chart canvas { display: block; width: 100%; height: 52px; }
.mood-chart-label { position: absolute; top: 0; right: 0; color: var(--muted-2); font-size: 10px; }

@media (max-width: 900px) {
  .mood-body { grid-template-columns: 96px minmax(0, 1fr); }
  .mood-chart { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .mood-card { padding: 12px; }
  .mood-title small { display: none; }
  .mood-body { grid-template-columns: 1fr; gap: 12px; }
  .mood-score { flex-direction: row; align-items: baseline; gap: 8px; }
  .mood-score b { font-size: 28px; }
}

/* ============================================================
   板块导航与板块页面（首页 / 监控 / 推送 / 市场 / 会员 / 联系我们）
   ============================================================ */

/* 顶部多出 46px 的板块导航行 */
.shell {
  grid-template-rows: 46px 64px minmax(0, 1fr);
  grid-template-areas:
    "nav nav"
    "top top"
    "side main";
}

.pagenav {
  grid-area: nav;
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 12, 0.86);
  backdrop-filter: blur(16px);
  overflow-x: auto;
  scrollbar-width: none;
}
.pagenav::-webkit-scrollbar { display: none; }

.pagenav button {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.16s ease;
}
.pagenav button:hover { color: var(--text); }
.pagenav button.active { color: var(--yellow); font-weight: 600; }
.pagenav button.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--yellow);
  box-shadow: 0 0 12px rgba(245, 197, 24, 0.45);
}

/* 非首页时隐藏行情终端三栏，由板块页面占满 */
.shell:not([data-page="home"]) > .sidebar,
.shell:not([data-page="home"]) > .main { display: none; }

.page-view {
  display: none;
  grid-column: 1 / -1;
  grid-row: 3;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 26px 44px;
}
.page-view > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.shell[data-page="monitor"] > #pageMonitor,
.shell[data-page="push"] > #pagePush,
.shell[data-page="market"] > #pageMarket,
.shell[data-page="membership"] > #pageMembership,
.shell[data-page="contact"] > #pageContact { display: block; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.page-head-copy { min-width: 0; }
.page-head .eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--yellow);
  opacity: 0.82;
  margin-bottom: 6px;
}
.page-head h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: 0.02em; }
.page-head p { margin: 0; max-width: 62ch; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.page-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.page-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(12, 17, 25, 0.9), rgba(7, 10, 15, 0.72));
  margin-bottom: 16px;
  overflow: hidden;
}
.page-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.page-card-head h3 { margin: 0; font-size: 13.5px; }
.page-card-head .tag { font-size: 10.5px; }

.page-panel-body { padding: 6px 10px 12px; }
.page-panel-body.rail-body { overflow: visible; }

/* 监控板块卡片 */
.module-grid { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px; }
.module-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.022);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.module-card:hover { border-color: rgba(245, 197, 24, 0.34); background: rgba(245, 197, 24, 0.045); }
.module-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--yellow);
}
.module-ico svg { width: 17px; height: 17px; }
.module-copy { flex: 1; min-width: 0; }
.module-copy b { display: block; font-size: 13px; }
.module-copy small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.module-count {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

/* 框架板块 */
.fw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.fw-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fw-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 150px;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.017);
}
.fw-card.live { border-style: solid; border-color: rgba(245, 197, 24, 0.3); background: rgba(245, 197, 24, 0.045); }
.fw-card h4 { margin: 0; font-size: 14px; }
.fw-card p { margin: 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.fw-card .btn { margin-top: auto; align-self: flex-start; }
.fw-state {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--dim, #5b6a80);
}
.fw-card.live .fw-state { color: var(--yellow); opacity: 0.85; }

.page-note {
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

/* 推送板块：承接原设置弹窗里的「手机推送」面板 */
.push-page-card { padding: 18px 20px 22px; }
.page-push-panel { display: block !important; }
.push-page-card .settings-panel { padding: 0; }

/* 窄屏：导航与页面 */
@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: 46px 64px auto;
    grid-template-areas:
      "nav nav"
      "top top"
      "side main";
  }
  .sidebar { top: 110px; height: calc(100vh - 110px); }
  .page-view { grid-column: 1 / -1; grid-row: 3 / -1; }
  .page-grid { grid-template-columns: 1fr; }
  .fw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fw-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .pagenav {
    position: sticky;
    top: 0;
    z-index: 45;
    height: 44px;
    padding: 0 10px;
  }
  .pagenav button { height: 44px; padding: 0 12px; font-size: 12.5px; }
  .topbar { top: 44px; }
  .page-view { padding: 16px 14px 90px; }
  .page-head h2 { font-size: 20px; }
  .fw-grid, .fw-grid.three { grid-template-columns: 1fr; }
  .module-count { display: none; }
}

@media (max-width: 620px) {
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
}

/* ============ 监控页：从首页搬过来的 6 个入口卡片 ============ */
.monitor-entries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.monitor-entries .leaders-banner { margin: 0; height: 100%; }
.entry-count {
  flex: none;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(245, 197, 24, 0.32);
  background: rgba(245, 197, 24, 0.1);
  color: var(--yellow);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1;
  white-space: nowrap;
}
.entry-count.is-empty {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
}
@media (max-width: 900px) {
  .monitor-entries { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .monitor-entries .leaders-banner-cta { display: none; }
  .entry-count { padding: 4px 6px; font-size: 10px; }
}

/* ============ 品牌标题放在导航条最左上 ============ */
.pagenav .brand {
  height: 46px;
  gap: 9px;
  padding-right: 16px;
  margin-right: 6px;
  border-right: 1px solid var(--line);
  flex: 0 0 auto;
}
.pagenav .brand .logo-mark { width: 28px; height: 28px; border-radius: 9px; }
.pagenav .brand .logo-mark svg { width: 17px; height: 17px; }
.pagenav .brand .brand-text { font-size: 11.5px; letter-spacing: 0.14em; white-space: nowrap; }
.pagenav .brand .brand-text small { font-size: 8.5px; margin-top: 1px; }

@media (max-width: 900px) {
  .pagenav .brand { height: 44px; padding-right: 10px; margin-right: 2px; gap: 7px; }
  .pagenav .brand .logo-mark { width: 24px; height: 24px; border-radius: 8px; }
  .pagenav .brand .logo-mark svg { width: 14px; height: 14px; }
  .pagenav .brand .brand-text { display: block; font-size: 10.5px; letter-spacing: 0.1em; }
  .pagenav .brand .brand-text small { font-size: 8px; }
}

/* ============ 顶栏无内容时自动收起（仅桌面端） ============ */
.topbar.is-collapsed { display: none; }
@media (min-width: 901px) {
  .shell.no-topbar {
    grid-template-rows: 46px minmax(0, 1fr);
    grid-template-areas:
      "nav nav"
      "side main";
  }
  .shell.no-topbar > .page-view { grid-row: 2 / -1; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .shell.no-topbar {
    grid-template-rows: 46px auto;
  }
  .shell.no-topbar > .sidebar { top: 46px; height: calc(100vh - 46px); }
}

/* ============ 板块导航：放大 + 金色胶囊高亮 ============ */
.pagenav { align-items: center; gap: 4px; }

.pagenav button {
  position: relative;
  height: 34px;
  padding: 0 17px;
  border-radius: 10px;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: #97a3b6;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.pagenav button:hover {
  color: #fff;
  background: rgba(245, 197, 24, 0.09);
}
.pagenav button.active {
  color: #1a1405;
  background: linear-gradient(135deg, #ffd75e 0%, #f5c518 52%, #e6a90a 100%);
  box-shadow:
    0 8px 20px -8px rgba(245, 197, 24, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transform: translateY(-0.5px);
}
.pagenav button.active::after { display: none; }
.pagenav button:focus-visible {
  outline: 2px solid rgba(245, 197, 24, 0.6);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .pagenav button {
    height: 32px;
    padding: 0 13px;
    font-size: 14px;
    letter-spacing: 0.04em;
  }
}

/* 导航图标与间距微调 */
.pagenav button { gap: 8px; }
.pagenav button svg { width: 16px; height: 16px; flex: none; opacity: 0.9; }
.pagenav button.active svg { opacity: 1; }
.pagenav button:hover { transform: translateY(-1px); }
.pagenav button.active:hover { transform: translateY(-0.5px); }
@media (max-width: 900px) {
  .pagenav button svg { width: 15px; height: 15px; }
}

/* ============================================================
   手机端适配（≤900px）
   · 板块导航改为底部标签栏（图标 + 文字，拇指可达）
   · 顶栏固定：菜单 + 品牌 + 行情状态
   · 页面头部操作分两行，按钮不低于 40px 触控高度
   · 悬浮球 / 提示条避开底部标签栏
   ============================================================ */

.brand-mobile { display: none; }

@media (max-width: 900px) {

  /* ---------- 底部标签栏 ---------- */
  .pagenav {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    height: auto;
    gap: 0;
    align-items: stretch;
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--line-2);
    border-bottom: 0;
    background: rgba(6, 9, 14, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
    overflow: visible;
  }
  .pagenav .brand { display: none; }

  .pagenav button {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 57px;
    padding: 7px 2px 6px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    border-radius: 0;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #8b97ad;
    background: transparent;
    box-shadow: none;
    transform: none;
  }
  .pagenav button svg {
    width: 21px;
    height: 21px;
    opacity: 0.85;
  }
  .pagenav button:hover {
    color: #c9d3e3;
    background: transparent;
    transform: none;
  }
  .pagenav button.active {
    color: var(--yellow);
    background: transparent;
    box-shadow: none;
    transform: none;
  }
  .pagenav button.active svg {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(245, 197, 24, 0.55));
  }
  .pagenav button.active::after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--yellow);
    box-shadow: 0 0 12px rgba(245, 197, 24, 0.75);
  }

  /* ---------- 顶栏：菜单 + 品牌 ---------- */
  .topbar {
    top: 0;
    height: 52px;
    padding: 0 12px;
    gap: 10px;
  }
  .brand-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .brand-mobile .logo-mark {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    flex: none;
  }
  .brand-mobile .logo-mark svg { width: 15px; height: 15px; }
  .brand-mobile .brand-text {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top-actions { margin-left: auto; gap: 6px; }

  /* ---------- 内容留出底部栏高度 ---------- */
  .shell { padding-bottom: calc(57px + env(safe-area-inset-bottom, 0px)); }
  .main { padding: 12px 12px 16px; }
  .rail { padding: 12px 12px 20px; }
  .page-view { padding: 14px 12px 16px; }

  /* ---------- 页面头部：操作按钮分两行 ---------- */
  .page-head { gap: 12px; margin-bottom: 14px; padding-bottom: 14px; }
  .page-head h2 { font-size: 20px; }
  .page-head p { font-size: 12px; }
  .page-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .page-head-actions .icon-btn { width: 40px; height: 40px; }
  .page-head-actions .btn { height: 40px; }
  #soundBtn { margin-right: auto; flex: 0 1 auto; min-width: 0; height: 40px; }
  #soundBtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #monitorNewAlert {
    order: 9;
    flex: 1 1 100%;
    width: 100%;
    height: 42px;
  }

  /* ---------- 监控入口卡片 ---------- */
  .monitor-entries { grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
  .monitor-entries .leaders-banner { padding: 11px 13px; gap: 10px; }
  .monitor-entries .leaders-banner-text b { font-size: 13px; }
  .monitor-entries .leaders-banner-text small { display: none; }
  .entry-count { padding: 4px 7px; font-size: 10px; }

  /* ---------- 右侧栏标签横向滚动 ---------- */
  .rail-head { flex-wrap: wrap; gap: 8px; padding-bottom: 10px; }
  .rail-head .seg {
    flex: 1 1 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .rail-head .seg::-webkit-scrollbar { display: none; }
  .rail-head .seg button { white-space: nowrap; padding: 7px 11px; font-size: 12px; }

  /* ---------- 悬浮元素避开底部栏 ---------- */
  .support-fab {
    right: 14px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    width: 48px;
    height: 48px;
  }
  .support-fab svg { width: 22px; height: 22px; }
  .toasts {
    left: 12px;
    right: 12px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }

  /* ---------- 抽屉 ---------- */
  .sidebar {
    top: 0;
    height: 100dvh;
    max-height: 100dvh;
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  /* ---------- 图表与弹窗 ---------- */
  .chart-body { height: 264px; }
  .modal { padding: 10px; }
  .modal-card { max-height: calc(100dvh - 40px); }
}

/* 更窄的机型（≤420px）再收一档 */
@media (max-width: 420px) {
  .pagenav button { font-size: 9.5px; gap: 3px; }
  .pagenav button svg { width: 19px; height: 19px; }
  .brand-mobile .brand-text { font-size: 11.5px; letter-spacing: 0.04em; }
  .monitor-entries .leaders-banner-cta { display: none; }
  .page-head h2 { font-size: 18px; }
  .main, .page-view, .rail { padding-left: 10px; padding-right: 10px; }
}

/* 监控页的声音按钮在手机上保持「图标 + 文字」，不要被通用 .chip 规则压成方块 */
@media (max-width: 900px) {
  #soundBtn {
    width: auto;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    gap: 6px;
    justify-content: flex-start;
    flex: 0 1 auto;
    margin-right: auto;
  }
  #soundBtn svg { width: 15px; height: 15px; }
  #soundBtn span {
    display: inline;
    white-space: nowrap;
    font-size: 12px;
  }
}
@media (max-width: 420px) {
  #soundBtn span { font-size: 11px; }
}

/* 手机端：行情列表抽屉在其他板块也要能打开 */
@media (max-width: 900px) {
  .shell:not([data-page="home"]) > .sidebar.open { display: block; }
}

/* 手机端：框架卡片不要撑太高 */
@media (max-width: 900px) {
  .fw-grid, .fw-grid.three { gap: 10px; }
  .fw-card {
    min-height: 0;
    padding: 14px 15px;
    gap: 6px;
  }
  .fw-card .fw-state { margin-top: 10px; }
  .fw-card .btn { margin-top: 10px; }
  .page-note { margin-top: 12px; padding: 12px 14px; font-size: 11.5px; }
  .page-card-head { padding: 12px 14px; }
  .page-head .eyebrow { margin-bottom: 4px; }
}
