:root {
  --bg: #07090c;
  --bg-2: #0e1218;
  --card: #12171f;
  --line: #232a35;
  --text: #e8edf4;
  --muted: #8b97a8;
  --gold: #f0b90b;
  --up: #ef454a;
  --down: #0ecb81;
}

:root[data-red-up="0"] {
  --up: #0ecb81;
  --down: #ef454a;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0.01em;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.app {
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(240, 185, 11, 0.08), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(59, 130, 246, 0.08), transparent 45%),
    var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 9, 12, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.brand b { color: var(--gold); }
.pnl-chips {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: stretch;
}
.pnl-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  min-width: 108px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 4px 10px;
  line-height: 1.15;
}
.pnl-chip span { font-size: 10px; color: var(--muted); }
.pnl-chip b { font-size: 14px; font-weight: 800; }
.pnl-chip i.chip-sub {
  font-style: normal;
  font-size: 9px;
  color: var(--muted);
}
.tabs .tab[data-tab="news"] { margin-left: 4px; }
.pnl-chip em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
  max-width: 176px;
  text-align: right;
  line-height: 1.25;
}
.chip-vscroll {
  display: block;
  overflow: hidden;
  max-width: 176px;
  text-align: right;
  font-style: normal;
  color: var(--muted);
}
.chip-flash {
  display: block;
  position: relative;
  overflow: hidden;
  height: 1.4em;
  max-width: 176px;
  text-align: right;
  font-style: normal;
  color: var(--muted);
}
.chip-flash-track { display: block; height: 1.4em; }
.chip-flash-track span {
  position: absolute;
  right: 0;
  left: 0;
  height: 1.4em;
  line-height: 1.4em;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  animation-name: chip-flash-cycle;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
@keyframes chip-flash-cycle {
  0%, 8% { opacity: 0; transform: translateY(5px); }
  12%, 22% { opacity: 1; transform: translateY(0); }
  28%, 100% { opacity: 0; transform: translateY(-4px); }
}
.chip-vscroll-1 { height: 1.4em; }
.chip-vscroll-2 { height: 2.8em; }
.chip-vscroll-4 { height: 4.8em; }
.chip-vscroll-track {
  display: flex;
  flex-direction: column;
  animation: chip-vscroll 18s linear infinite;
}
.chip-vscroll-track span {
  display: block;
  height: 1.4em;
  line-height: 1.4em;
  font-size: 12px;
  white-space: nowrap;
}
@keyframes chip-vscroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
.trade-watch-head {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.trade-search {
  margin-top: 10px;
}
.trade-nav {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) auto minmax(96px, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.trade-nav .k { margin: 0; min-width: 0; justify-self: center; }
.trade-nav-side { display: block; }
.coin-title-main { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.coin-title-main b { font-size: 19px; }
.title-chain { font-style: normal; font-weight: 400; font-size: 15px; color: var(--muted); }
.sheet-price { text-align: center; font-size: 16px; margin: 2px 0 8px; }
.sheet-price b { font-size: 19px; margin-left: 4px; }
.alert-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
}
.alert-item.editing { border-color: var(--gold); }
.alert-item-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-ops { display: flex; gap: 6px; flex-shrink: 0; }
.alert-ops .ghost { padding: 2px 8px; font-size: 12px; }
.star-filter { font-size: 16px; line-height: 1; color: var(--muted); }
.star-filter[data-on="1"] { color: var(--gold); }
.top10-spark-lg svg { width: 100%; height: 64px; }
.topn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dd-tabs { display: flex; gap: 6px; margin: 8px 0; }
.star-pop {
  position: fixed;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--card, #1a1a1a);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  min-width: 150px;
}
.star-pop .tab { text-align: left; white-space: nowrap; }
.star-choose {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  background: var(--card, #1a1a1a);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
  min-width: 120px;
}
.star-choose .star-pop-btn {
  font-size: 12px;
  padding: 4px 8px;
  white-space: nowrap;
  text-align: left;
  line-height: 1.2;
}
/* 1013：星标弹层里「已加入」的项以前是黄底+金字，文字看不见；改成统一：已加入=淡金底+金边+白字+✓，未加入=普通暗底 */
.star-choose .star-pop-btn, .star-choose .star-pop-btn[data-on="0"] { background: transparent; color: var(--text); border: 1px solid var(--line); }
.star-choose .star-pop-btn[data-on="1"] { background: rgba(240, 185, 11, 0.16); color: var(--text); border: 1px solid var(--gold); font-weight: 600; }
.topn-cell { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.topn-cell .top10-spark svg { width: 100%; height: 40px; }
.topn-cell b { color: var(--text); }
.token-info { display: flex; flex-direction: column; gap: 6px; }
.token-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed var(--line);
  padding: 4px 0;
  font-size: 13px;
}
.token-info-row > span:last-child { text-align: right; word-break: break-all; }
.unlock-pane { display: flex; flex-direction: column; gap: 6px; }
.unlock-bar {
  height: 12px;
  background: var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin: 6px 0 2px;
}
.unlock-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #f0a500); }
.trade-nav-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.trade-nav .trade-close { min-width: 64px; }
.pos-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.pos-name > b { font-size: 13px; }
.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.pos-badge-long { background: #f6465d; }
.pos-badge-short { background: #0ecb81; }
.pos-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pos-tag {
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 18px;
}
.trade-watch-head .ticket-field { flex: 1; }
.kline-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kline-toggle[data-on="1"] {
  border-color: var(--gold);
  color: var(--gold);
}
.ticket-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.ticket-title {
  flex: 1;
  min-width: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.th-set { position: relative; text-align: right; min-width: 72px; }
.th-set .col-menu { display: inline-flex; justify-content: flex-end; }
.th-warn {
  margin-left: 4px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  border-radius: 6px;
  padding: 0 5px;
  font-size: 11px;
  cursor: pointer;
}
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  margin-left: 4px;
}
.pos-book-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-start; }
.pos-book-tools {
  float: none;
  display: inline-flex;
  gap: 6px;
  font-weight: 500;
  margin-left: 0;
}
.pos-book-sub { gap: 6px; }
.pos-tag-bsc {
  background: #f3ba2f;
  color: #111;
  font-weight: 700;
}
.top10-spark { margin-top: 2px; }
.top10-spark svg { width: 72px; height: 22px; }
.alert-event {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.alert-event .coin-logo {
  width: 28px;
  height: 28px;
  background: #11151c;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  object-fit: contain;
  flex: none;
}
.alert-coin {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 8px;
}
.sheet-pane { margin: 8px 0 12px; }
.alert-kind-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:8px 0; max-height:220px; overflow:auto; }
.alert-kind-options .tab { text-align:left; white-space:normal; }
.sheet-pnl { font-size: 13px; font-weight: 700; font-style: normal; margin-left: 8px; }
.ticket-title i { font-style: normal; font-size: 13px; margin-left: 8px; }
.coin-title-lg { font-size: 19px; font-weight: 700; }
.coin-title-lg span { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.coin-title-lg b { font-size: 19px; }
.coin-title-lg .coin-price { font-style: normal; font-size: 19px; font-weight: 700; letter-spacing: 0.2px; }
.coin-title-lg .coin-logo { width: 24px; height: 24px; }
.k.coin.coin-title-lg { font-size: 19px; }
.sheet-tabs .star-tab {
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  min-width: 36px;
}
.sheet-tabs .star-tab[data-on="1"] { color: var(--gold); }
.holder-alert-box { margin-top: 8px; }
.pos-row td {
  background: transparent;
}
.pos-row-danger td {
  background: rgba(246, 70, 93, 0.28);
  color: #fff;
}
.pos-name-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.pos-flash {
  display: inline-flex;
  position: relative;
  min-width: 52px;
  height: 16px;
  overflow: hidden;
  margin-left: 4px;
  vertical-align: middle;
}
.pos-flash-line {
  position: static;
  min-width: 0;
  height: auto;
  overflow: visible;
  margin-left: 0;
  flex-wrap: wrap;
  gap: 6px;
}
.pos-flash i {
  position: absolute;
  left: 0;
  top: 0;
  font-style: normal;
  font-size: 11px;
  color: #ffd6dc;
  white-space: nowrap;
  animation: pos-flash-cycle 2.4s ease-in-out infinite;
}
.pos-flash-line i {
  position: static;
  background: rgba(0, 0, 0, 0.38);
  border-radius: 4px;
  padding: 1px 6px;
  animation: pos-pop 1.4s ease-in-out infinite;
}
@keyframes pos-flash-cycle {
  0%, 20% { opacity: 0; transform: scale(0.92); }
  35%, 65% { opacity: 1; transform: scale(1); }
  80%, 100% { opacity: 0; transform: scale(1.04); }
}
@keyframes pos-pop {
  0%, 100% { opacity: 0.55; transform: translateY(2px); }
  40% { opacity: 1; transform: translateY(0); }
}
.market-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 16px 24px;
  overflow: auto;
}
.market-sheet .sheet-card {
  width: min(560px, 100%);
  background: var(--card, #12151c);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px 16px 18px;
}
.ratio-alert { margin-top: 8px; }
.watch-coin .coin-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.2; }
.watch-coin .coin-text b { font-size: 13px; }
.watch-delist { color: #39c6d8; cursor: pointer; }
.status-detail-link { border: 0; background: none; padding: 0; color: #39c6d8; cursor: pointer; font: inherit; }
.status-detail-link:hover { text-decoration: underline; }
.status-sheet-card { max-height: 80vh; overflow: auto; }
.status-article { white-space: pre-wrap; line-height: 1.55; max-height: 42vh; overflow: auto; }
.mine-pnl-loss { color: #20c765; }
.alert-watch-star { color: var(--gold); font-size:18px; flex:none; }
.alert-watch-star[data-alert-watch] { color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; line-height: 1; }
.alert-watch-star[data-alert-watch][data-on="1"] { color: var(--gold); }
.alert-watch-star[data-alert-watch]:hover { color: var(--gold); }
.alert-watch-star[data-grp="g1"] { color:#e83e8c; }
.alert-watch-star[data-grp="g2"] { color:#22a7f0; }
.alert-watch-star[data-grp="c0"] { color:#ef4444; }
.alert-watch-star[data-grp="c1"] { color:#f97316; }
.alert-watch-star[data-grp="c2"] { color:#eab308; }
.alert-watch-star[data-grp="c3"] { color:#22c55e; }
.alert-watch-star[data-grp="c4"] { color:#06b6d4; }
.alert-watch-star[data-grp="c5"] { color:#3b82f6; }
.alert-watch-star[data-grp="c6"] { color:#a855f7; }
.pos-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pos-actions .ghost, .pos-actions .danger { padding: 6px 8px; font-size: 12px; }
.pos-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
}
.pos-edit input { max-width: 140px; }
.pnl-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.pnl-board > div {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
}
.pnl-board .v { font-size: 18px; }
.live {
  font-size: 11px;
  color: var(--down);
  border: 1px solid rgba(14, 203, 129, 0.35);
  padding: 2px 8px;
  border-radius: 99px;
}
.tabs { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.tab, .ghost, .primary, .danger {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 8px 12px;
}
.tab[data-on="1"], .primary {
  background: var(--gold);
  color: #111;
  border-color: var(--gold);
  font-weight: 700;
}
.danger { color: var(--up); }
.search {
  min-width: 180px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
}

.wrap { max-width: 1280px; margin: 0 auto; padding: 20px; }
.grid { display: grid; gap: 14px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-metrics { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.metrics-wrap { display: grid; gap: 8px; }
.metrics-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.metrics-bar .muted { font-size: 12px; }
.metric-hide { font-size: 12px; padding: 4px 10px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.k { color: var(--muted); font-size: 12px; }
.v { font-size: 22px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; align-items: center; }
.toolbar.modes { align-items: center; margin-bottom: 0; flex-wrap: wrap; }
.col-menu { margin-left: auto; position: relative; }
.col-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 228px;
  max-height: min(70vh, 560px);
  overflow: auto;
  background: #121821;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  display: grid;
  gap: 2px;
}
.col-group {
  font-size: 11px;
  color: var(--muted);
  padding: 8px 8px 2px;
  letter-spacing: 0.04em;
}
.col-pop label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text, #eaecef);
  cursor: pointer;
}
.col-pop label:hover { background: rgba(255,255,255,0.04); }
.col-pop input { accent-color: var(--gold); }
.col-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.col-row label { flex: 1; min-width: 0; }
.col-move { display: inline-flex; gap: 4px; flex-shrink: 0; }
.col-move .th-dir:disabled { opacity: 0.35; cursor: default; }
.col-gear { min-width: 64px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 8px; text-align: left; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #10151c; position: sticky; top: 0; z-index: 1; }
.th-with-sort {
  white-space: nowrap;
  vertical-align: middle;
}
.th-with-sort .th-label { vertical-align: middle; }
.th-sort-btns {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  margin-left: 6px;
  vertical-align: middle;
}
.th-dir {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  border-radius: 4px;
  min-width: 16px;
  min-height: 12px;
  padding: 0 3px;
  font-size: 8px;
  font-weight: 700;
  line-height: 12px;
}
.th-dir:hover { color: var(--text); }
.th-dir[data-on="1"] {
  background: var(--gold);
  color: #111;
  border-color: var(--gold);
}
tr:hover td { background: rgba(255,255,255,0.02); cursor: pointer; }
.card[data-on="1"], .rate-card[data-on="1"] {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(240, 185, 11, 0.35);
}
.star { border: 0; background: none; font-size: 16px; padding: 0 4px; color: var(--muted); }
.star[data-on="1"] { color: var(--gold); }
.coin { display: inline-flex; align-items: center; gap: 8px; }
.coin-logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1a2230;
  flex: none;
  object-fit: cover;
  display: block;
}
.v.coin { gap: 10px; }
.v.coin .coin-logo { width: 28px; height: 28px; }
.k.coin { gap: 6px; }
.k.coin .coin-logo { width: 18px; height: 18px; }

.spark { width: 132px; height: 36px; display: block; }
.spark-wide { width: 100%; height: 88px; }
.coin-text { display: flex; flex-direction: column; line-height: 1.2; }
.cn-name { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 500; }
.board {
  display: grid;
  grid-template-columns: 1.7fr 0.9fr;
  gap: 12px;
  margin-top: 12px;
}
.kline { width: 100%; height: 188px; display: block; background: var(--bg-2); border-radius: 10px; }
.depth { display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.depth-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 6px;
  font-size: 12px;
}
.depth-row i {
  position: absolute;
  inset: 0 auto 0 0;
  opacity: 0.18;
}
.depth-row.ask i { background: var(--up); }
.depth-row.bid i { background: var(--down); }
.depth-row.ask b { color: var(--up); }
.depth-row.bid b { color: var(--down); }
.depth-mid {
  text-align: center;
  font-weight: 800;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.deriv { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-top: 16px; }
.deriv-head { margin-top: 16px; }
.deriv-metrics { margin-top: 12px; }
.deriv .table-wrap table { min-width: 980px; }
.fund-board table { min-width: 720px; }
.mobile-nav { display: none; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.empty .linkish {
  display: inline;
  border: 0;
  padding: 0;
  background: none;
  color: var(--gold);
  font-weight: 700;
}
.desktop-only { display: flex; }
.detail {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.form { display: grid; gap: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
input, select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 10px;
}
.alert-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #1b2230;
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 12px 14px;
  max-width: 320px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  z-index: 40;
}
.btn-buy, .btn-sell {
  flex: 1;
  font-weight: 800;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  text-align: center;
  text-decoration: none;
}
.btn-buy { background: var(--up); color: #fff; border-color: var(--up); }
.btn-sell { background: var(--down); color: #07140f; border-color: var(--down); }
.btn-buy[data-on="0"], .btn-sell[data-on="0"] {
  background: var(--card);
  color: var(--text);
  border-color: var(--line);
}
.alpha-board { margin-top: 0; }
.alpha-board-card { margin-top: 0; }
.alpha-warn {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--up) 16%, var(--card));
  border: 1px solid color-mix(in srgb, var(--up) 45%, var(--line));
  color: var(--text);
  font-weight: 600;
}
.alpha-board .alpha-tabs { flex-wrap: wrap; }
.alpha-table { width: 100%; min-width: 0; }
.alpha-table th, .alpha-table td { font-size: 12px; vertical-align: top; }
.alpha-table .mono { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.alpha-stats { display: grid; gap: 10px; }
.alpha-stats > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.trade-grid-list { grid-template-columns: 1fr; }
.ticket-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ticket-fields input { min-width: 0; width: 100%; }
.ticket-field {
  display: grid;
  gap: 4px;
}
.ticket-field span {
  font-size: 11px;
  color: var(--muted);
}
.trade-watch {
  position: relative;
  margin-bottom: 10px;
  z-index: 6;
}
.trade-watch .ticket-field { margin: 0; }
.trade-pick {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 8;
  display: grid;
  gap: 2px;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.trade-pick button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.trade-pick button:hover,
.trade-pick button[data-on="1"] { background: var(--bg-2); }
.trade-pick .coin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.trade-pick small {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
}
.sound-row {
  display: grid;
  grid-template-columns: minmax(8rem, max-content) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.sound-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
  align-items: center;
}
.sound-row > button[data-action="save-sound"] {
  grid-column: 3;
  grid-row: 1;
}
a.ghost { display: inline-flex; align-items: center; justify-content: center; }

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(240, 185, 11, 0.08), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(59, 130, 246, 0.08), transparent 45%),
    var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px 24px;
  display: grid;
  gap: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.auth-card .brand { font-size: 22px; margin-bottom: 2px; }
.auth-tabs { margin: 6px 0 4px; }
.auth-card .primary { width: 100%; margin-top: 6px; }
.auth-card .primary:disabled { opacity: 0.6; cursor: wait; }
.auth-error { color: var(--up); font-size: 13px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-chip span {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}
.perk {
  flex: none;
  font-size: 10px;
  color: #111;
  background: var(--gold);
  border-radius: 99px;
  padding: 2px 7px;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .cards-metrics { grid-template-columns: repeat(3, 1fr); }
  .deriv, .trade-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .wrap { padding: 12px; }
  .topbar {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
  }
  .topbar .brand { order: 1; font-size: 15px; min-width: 0; }
  .pnl-chips {
    order: 2;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: calc(100% - 90px);
  }
  .pnl-chip {
    min-width: 0;
    padding: 3px 8px;
  }
  .pnl-chip b { font-size: 13px; }
  .pnl-chip em { max-width: 110px; font-size: 9px; }
  .chip-vscroll { max-width: 110px; }
  .sound-row { grid-template-columns: minmax(5.5rem, max-content) minmax(0, 1fr) auto; }
  .sound-row > span { grid-column: 1; }
  .sound-choice { grid-column: 2; grid-row: 1; }
  .sound-row > button[data-action="save-sound"] { grid-column: 3; grid-row: 1; }
  .search {
    order: 3;
    flex: 1 1 100%;
    width: auto;
    min-width: 0;
  }
  .user-chip {
    order: 4;
    width: auto;
    flex: none;
    justify-content: flex-start;
    min-width: 0;
    gap: 6px;
  }
  .user-chip span { max-width: 88px; }
  .user-chip .ghost { padding: 6px 10px; flex: none; }
  .topbar > [data-action="color"] {
    order: 5;
    margin-left: auto;
    padding: 6px 10px;
    flex: none;
  }
  .pnl-board { grid-template-columns: 1fr; }
  .cards-3, .cards-metrics, .detail, .board { grid-template-columns: 1fr; }
  .desktop-only { display: none; }
  .toolbar { gap: 6px; margin: 12px 0; }
  .toolbar .tab, .toolbar .ghost { padding: 6px 10px; font-size: 13px; }
  .th-sort-btns { gap: 1px; margin-left: 4px; }
  .th-dir {
    min-width: 16px;
    min-height: 12px;
    padding: 0 3px;
    font-size: 8px;
    line-height: 12px;
    border-radius: 4px;
  }
  th, td { padding: 9px 6px; }
  .auth-screen { padding: 16px 14px; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
  .auth-card { padding: 20px 16px 16px; width: 100%; }
  .auth-card .brand { font-size: 20px; }
  .auth-card input, .auth-card select { font-size: 16px; }
  .app { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  table { min-width: 0 !important; }
  th[data-col="spark"], td[data-col="spark"],
  th[data-col="high"], td[data-col="high"],
  th[data-col="low"], td[data-col="low"],
  th[data-col="range"], td[data-col="range"],
  th[data-col="vol"], td[data-col="vol"],
  th[data-col="fundIn"], td[data-col="fundIn"],
  th[data-col="mcap"], td[data-col="mcap"],
  th[data-col="oi"], td[data-col="oi"],
  th[data-col="oiSz"], td[data-col="oiSz"],
  th[data-col="index"], td[data-col="index"],
  th[data-col="ls"], td[data-col="ls"],
  th[data-col="taker"], td[data-col="taker"],
  th[data-col="liq1h"], td[data-col="liq1h"],
  th[data-col="liq24h"], td[data-col="liq24h"] { display: none; }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 9, 12, 0.94);
    border-top: 1px solid var(--line);
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mobile-nav button {
    border: 0;
    background: none;
    padding: 10px 2px;
    font-size: 11px;
    color: var(--muted);
  }
  .mobile-nav button[data-on="1"] {
    color: var(--gold);
    font-weight: 700;
  }
  .toast { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}

.fund-bars { width: 100%; height: 88px; display: block; }
.perk.free { color: var(--muted); border: 1px solid var(--line); background: transparent; }
.perk.standard { color: #0a3d2e; background: #7dffb8; border: 1px solid #5ee0a0; }
.perk.pro { color: #111; background: var(--gold); border: 1px solid var(--gold); }
.plan-tiers { margin: 12px 0 4px; overflow-x: auto; }
.plan-tiers table { width: 100%; border-collapse: collapse; font-size: 12px; }
.plan-tiers th, .plan-tiers td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: center; }
.plan-tiers th:first-child, .plan-tiers td:first-child { text-align: left; white-space: nowrap; }
.plan-tiers thead th { font-size: 11px; color: var(--muted); font-weight: 600; }
.plan-tiers + .muted { margin-top: 8px; font-size: 12px; }
.news-wrap { display: grid; gap: 14px; }
.news-list { display: grid; gap: 0; }
.news-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.news-item:last-child { border-bottom: 0; }
.news-item strong { display: block; font-weight: 700; }
.news-tag {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.news-tag[data-tag="上新"] { color: var(--up); border-color: var(--up); }
.news-tag[data-tag="下架"] { color: var(--down); border-color: var(--down); }
.news-tag[data-tag="活动"] { color: #f5c14a; border-color: #f5c14a; }
[data-live="ticket-risk"] { margin-top: 6px; font-size: 12px; }

.install-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #1b2230;
  border: 1px solid var(--gold);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
  font-size: 13px;
}
.install-bar span { flex: 1; min-width: 0; }
.install-bar .primary, .install-bar .ghost { flex: none; padding: 7px 10px; }
.auth-screen .install-bar { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.home-wrap, .me-wrap { display: grid; gap: 14px; }
.home-links { display: flex; flex-wrap: wrap; gap: 8px; }
.home-watch { display: grid; gap: 0; margin-top: 8px; }
.home-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  padding: 10px 0;
  text-align: left;
}
.home-row:last-child { border-bottom: 0; }
.home-row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (min-width: 901px) {
  .install-bar { bottom: 18px; max-width: 520px; left: 50%; right: auto; transform: translateX(-50%); }
}

.star-choose { max-height: 60vh; overflow-y: auto; }
.coin-info-line { font-size: 12px; margin: 2px 0 6px; }

/* 自选星标配色：留意(g1)=洋红 #e83e8c（1012：跟默认金星区分），关注(g2)=青蓝 #22a7f0；行内主星标按所属分类上色，筛选按钮/弹层里的 .gstar 同色 */
.gstar { font-style: normal; font-size: 1em; line-height: 1; margin-right: 3px; display: inline-block; }
.gstar-g1 { color: #e83e8c; }
.gstar-g2 { color: #22a7f0; }
button.star + .gstar { margin-left: 2px; margin-right: 0; font-size: 12px; }
button.star[data-grp="g1"], .tab.star-tab[data-grp="g1"] { color: #e83e8c; }
button.star[data-grp="g2"], .tab.star-tab[data-grp="g2"] { color: #22a7f0; }

/* 费率收入徽标：标题随周期直接切换（1d/7d/30d/90d/180d），固定最小宽度避免切换时抖动 */
.pnl-chip span[data-live="nav-fund-label"] { white-space: nowrap; min-width: 7.2em; display: inline-block; }

/* 预警规则与触发记录各占一半，独立滚动。 */
.alert-rules-card, .alert-events-card { grid-column: span 1; min-width: 0; max-height: 680px; overflow-y: auto; }
.alerts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.alert-category-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 8px 0 12px; }
.alert-category-tabs .tab { font-size: 12px; padding: 5px 7px; }
@media (max-width: 900px) {
  .alerts-grid { grid-template-columns: 1fr; }
  .alert-rules-card, .alert-events-card { grid-column: 1 / -1; max-height: none; min-height: 0; }
}

/* 修正表 1012：自定义分类星标 红/橙/黄/绿/青/蓝/紫（按创建顺序）；自选未分类 = 默认金色星 */
.gstar-c0 { color: #ef4444; } .gstar-c1 { color: #f97316; } .gstar-c2 { color: #eab308; } .gstar-c3 { color: #22c55e; }
.gstar-c4 { color: #06b6d4; } .gstar-c5 { color: #3b82f6; } .gstar-c6 { color: #a855f7; }
button.star[data-grp="c0"], .tab.star-tab[data-grp="c0"] { color: #ef4444; }
button.star[data-grp="c1"], .tab.star-tab[data-grp="c1"] { color: #f97316; }
button.star[data-grp="c2"], .tab.star-tab[data-grp="c2"] { color: #eab308; }
button.star[data-grp="c3"], .tab.star-tab[data-grp="c3"] { color: #22c55e; }
button.star[data-grp="c4"], .tab.star-tab[data-grp="c4"] { color: #06b6d4; }
button.star[data-grp="c5"], .tab.star-tab[data-grp="c5"] { color: #3b82f6; }
button.star[data-grp="c6"], .tab.star-tab[data-grp="c6"] { color: #a855f7; }
button.star ~ .gstar { margin-left: 1px; margin-right: 0; font-size: 11px; }
.circ-row { align-items: center; flex-wrap: wrap; gap: 10px; }

/* 1013-2103：行情页「⚙ 设置」浮在表头最右（24H最低 上方），不单独占一列 */
.market-wrap { position: relative; }
.market-wrap > .float-set { position: absolute; top: 6px; right: 10px; z-index: 6; }
.market-wrap > .float-set .col-gear { background: var(--card, #1a1a1a); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.market-wrap > .float-set .col-pop { right: 0; left: auto; }
.trade-list-card > .toolbar.modes { margin: 0 0 8px; }
.kmid-box { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.kmid-table { width: 100%; font-size: 12px; margin: 6px 0; }
.kmid-table th, .kmid-table td { text-align: left; padding: 3px 6px; }

/* r5（1014b）：上架时间 / 已流通 行 —— 行高与黄色按钮一致，放进一个浅框里 */
.list-filter-line { align-items: center; min-height: 38px; gap: 12px; }
.list-filter-line .check-inline { font-size: 13px; padding: 4px 0; }
.list-filter-box {
  display: grid; gap: 6px; margin: 4px 0 12px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
.list-filter-box > .row { margin: 0; }

/* r7（1016 修正表 01）：自选星标按钮选中时不再铺黄色底，只用分类颜色的星标表示（留意=洋红、关注=青蓝、自定义分组各自颜色、未分组=金色） */
.tab.star-tab[data-on="1"] {
  background: transparent;
  border-color: var(--line);
  box-shadow: none;
  font-weight: 400;
}
.tab.star-tab[data-on="1"]:not([data-grp]), .tab.star-tab[data-on="1"][data-grp=""] { color: var(--gold); }
.tab.star-tab[data-on="1"] { font-size: 20px; }
