: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; }

/* ===================== boot ===================== */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  color: var(--muted);
  letter-spacing: 0.12em;
  font-size: 12px;
}
.boot-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #111;
  background: linear-gradient(145deg, var(--yellow-2), var(--yellow));
  box-shadow: 0 0 50px rgba(245, 197, 24, 0.35);
  animation: bootPulse 1.6s ease-in-out infinite;
}
.boot-mark svg { width: 30px; height: 30px; }
@keyframes bootPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(245, 197, 24, 0.28); }
  50% { transform: scale(1.06); box-shadow: 0 0 70px rgba(245, 197, 24, 0.5); }
}

/* ===================== 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;
}

/* ===================== shell ===================== */
.shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 384px;
  grid-template-rows: 64px minmax(0, 1fr);
  grid-template-areas:
    "top top top"
    "side main rail";
  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;
}
.global-search {
  position: relative;
  flex: 1;
  max-width: 380px;
  margin-left: 6px;
}
.global-search > svg, .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;
}
.global-search input, .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;
}
.global-search input:focus, .side-search input:focus {
  border-color: rgba(245, 197, 24, 0.5);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.07);
}
.search-results {
  position: absolute;
  top: 44px;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #0c121b;
  box-shadow: var(--shadow);
  max-height: 340px;
  overflow-y: auto;
}
.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.search-item:hover, .search-item.active { background: var(--panel-3); }
.search-item b { font-size: 13px; }
.search-item span { font-size: 11px; color: var(--muted); }
.search-item em { font-style: normal; font-family: var(--mono); font-size: 12px; }

.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; }
.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; gap: 3px; }
.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; }
.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-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;
}
.symbol-pick > span { font-size: 11px; color: var(--muted); }
.symbol-pick > div { display: flex; align-items: baseline; gap: 9px; }
.symbol-pick b { font-size: 15px; letter-spacing: 0.01em; }
.symbol-pick small { font-size: 11px; color: var(--muted-2); font-family: var(--mono); }
.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); }
.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; }

/* ===================== 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; }

/* ===================== 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) 350px; }
  .chart-legend { display: none; }
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: 64px auto auto;
    grid-template-areas:
      "top top"
      "side main"
      "side rail";
    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; }
  .global-search { max-width: none; margin-left: 0; }
  .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: auto;
    padding-top: 18px;
    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);
  }
  .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; }
  .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) {
  .global-search { display: none; }
  .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-row time {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.trade-row time { margin-left: auto; color: var(--muted-2); }
@media (max-width: 620px) {
  .trade-row time { display: none; }
}

.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-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); }

/* ===================== 卡密 / 用户库 ===================== */
.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; }
.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; }
.table-empty,
.table-error { padding: 18px; text-align: center; color: var(--muted-2); font-size: 11px; }
.table-error { color: var(--down); }
