/* ==========================================================================
   股息观察 · 深海军蓝 / 金色 主题
   ========================================================================== */

:root {
  --bg: #060e1c;
  --bg-deep: #040a14;
  --panel: #0b1830;
  --panel-2: #0e1e3a;
  --panel-3: #122545;
  --line: rgba(145, 176, 220, 0.13);
  --line-strong: rgba(160, 192, 235, 0.22);
  --text: #e9effb;
  --muted: #93a7c8;
  --dim: #6b7f9f;
  --gold: #f3c969;
  --gold-strong: #ffd877;
  --gold-soft: rgba(243, 201, 105, 0.14);
  --gold-line: rgba(243, 201, 105, 0.35);
  --up: #ff6b7a;
  --up-soft: rgba(255, 107, 122, 0.13);
  --down: #2ed3a0;
  --down-soft: rgba(46, 211, 160, 0.13);
  --teal: #56d6c9;
  --blue: #7aa7ff;
  --radius: 18px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  --nav-h: 66px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
    system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

a {
  color: var(--gold);
  text-decoration: none;
}

/* ------------------------------------------------------------- background */
.ambient {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.55;
}

.ambient-a {
  top: -220px;
  left: -140px;
  width: 620px;
  height: 620px;
  background: radial-gradient(circle, rgba(28, 74, 148, 0.55), transparent 68%);
}

.ambient-b {
  right: -220px;
  bottom: -180px;
  width: 680px;
  height: 680px;
  background: radial-gradient(circle, rgba(243, 201, 105, 0.16), transparent 66%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(24, 54, 104, 0.55), transparent 70%),
    linear-gradient(180deg, #071226 0%, #050c18 46%, #040a14 100%);
}

/* ------------------------------------------------------------------ shell */
.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px calc(40px + var(--safe-bottom));
}

/* ----------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -16px;
  padding: 14px 16px 12px;
  background: rgba(6, 14, 28, 0.82);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(150deg, #ffe09a, #e5b24b 55%, #b8862d);
  box-shadow:
    0 6px 18px rgba(243, 201, 105, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.brand-mark span {
  font-size: 21px;
  font-weight: 800;
  color: #14213a;
  letter-spacing: -1px;
}

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

.brand-text h1 {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

#header-date {
  color: var(--gold);
}

.title-accent {
  color: var(--text);
}

.brand-text p {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  transition: 0.18s ease;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  color: var(--gold);
  border-color: var(--gold-line);
  background: var(--gold-soft);
}

.icon-btn.spinning svg {
  animation: spin 1s linear infinite;
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: linear-gradient(140deg, #ff8b6b, #ff4d6a);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(255, 77, 106, 0.4);
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffe094, #eec15e 55%, #d9a53f);
  color: #17233b;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(233, 187, 88, 0.22);
  transition: 0.18s ease;
}

.primary-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(233, 187, 88, 0.34);
}

.primary-btn:disabled {
  opacity: 0.55;
  transform: none;
  cursor: not-allowed;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: 0.16s ease;
}

.ghost-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.07);
}

.ghost-btn.gold {
  color: var(--gold);
  border-color: var(--gold-line);
  background: var(--gold-soft);
}

.ghost-btn.danger {
  color: #ff8896;
  border-color: rgba(255, 107, 122, 0.28);
  background: rgba(255, 107, 122, 0.08);
}

.ghost-btn.big {
  height: 40px;
  padding: 0 16px;
  font-size: 12.5px;
}

.text-btn {
  padding: 4px 6px;
  border: 0;
  background: none;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}

/* --------------------------------------------------------------- content */
.content {
  padding-top: 18px;
}

.notice-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(243, 201, 105, 0.24);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(243, 201, 105, 0.1), rgba(243, 201, 105, 0.03));
  font-size: 12px;
  color: var(--muted);
}

.notice-banner > div {
  min-width: 0;
}

.notice-banner strong {
  display: block;
  margin-bottom: 2px;
  color: var(--gold);
  font-size: 12.5px;
}

/* ---------------------------------------------------------------- summary */
.summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 22px;
}

.sum-card {
  position: relative;
  overflow: hidden;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(420px 160px at 100% 0%, rgba(48, 96, 176, 0.2), transparent 70%),
    linear-gradient(155deg, rgba(18, 37, 69, 0.92), rgba(8, 20, 38, 0.94));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.sum-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sum-card.primary {
  grid-column: 1 / -1;
  border-color: rgba(243, 201, 105, 0.24);
  background:
    radial-gradient(460px 200px at 92% -20%, rgba(243, 201, 105, 0.22), transparent 70%),
    linear-gradient(150deg, rgba(32, 48, 74, 0.95), rgba(10, 23, 43, 0.96));
}

.sum-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.sum-label .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.sum-value {
  margin-top: 7px;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.sum-value.gold {
  color: var(--gold);
  text-shadow: 0 0 26px rgba(243, 201, 105, 0.25);
}

.sum-value small {
  margin-left: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);
}

.sum-sub {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.sum-sub b {
  color: var(--muted);
  font-weight: 600;
}

.sum-sub .up {
  color: var(--up);
}

.sum-sub .down {
  color: var(--down);
}

.progress {
  position: relative;
  height: 6px;
  margin-top: 11px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b98f35, var(--gold), #ffe7a4);
  box-shadow: 0 0 12px rgba(243, 201, 105, 0.5);
  transition: width 0.6s ease;
}

.sum-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sum-actions .ghost-btn {
  height: 28px;
  font-size: 11px;
}

/* -------------------------------------------------------------- section head */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.section-title h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.section-title p {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--dim);
}

.controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.mini-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  transition: 0.16s ease;
}

.mini-search:focus-within {
  border-color: var(--gold-line);
  background: rgba(255, 255, 255, 0.05);
}

.mini-search svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.mini-search input {
  width: 132px;
  border: 0;
  outline: 0;
  background: none;
  font-size: 12px;
}

.mini-search input::placeholder {
  color: var(--dim);
}

.controls select {
  height: 34px;
  padding: 0 26px 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%),
    linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 13px) 14px, calc(100% - 9px) 14px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

.controls select:focus {
  border-color: var(--gold-line);
}

/* ------------------------------------------------------------------ cards */
.stock-list {
  display: grid;
  gap: 12px;
}

.stock-card {
  position: relative;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(560px 200px at 100% -30%, rgba(45, 92, 170, 0.18), transparent 70%),
    linear-gradient(160deg, rgba(15, 31, 58, 0.96), rgba(8, 19, 36, 0.97));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.stock-card:hover {
  border-color: rgba(160, 192, 235, 0.24);
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

.stock-card.is-stale {
  border-color: rgba(255, 176, 92, 0.26);
}

.stock-card.has-signal {
  border-color: rgba(243, 201, 105, 0.36);
}

.card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "identity quote"
    "yield pct";
  gap: 9px 14px;
  align-items: start;
}

.identity {
  grid-area: identity;
  min-width: 0;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.name-row h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.code {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.tag-etf {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(122, 167, 255, 0.14);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
}

.tag-signal {
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tag-stale {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 176, 92, 0.12);
  color: #ffb05c;
  font-size: 10px;
  font-weight: 600;
}

.identity .meta {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity .meta b {
  color: var(--muted);
  font-weight: 600;
}

.quote {
  grid-area: quote;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.quote .price {
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.quote .chg {
  margin-top: 1px;
  font-size: 11.5px;
  font-weight: 600;
}

.quote .chg.up {
  color: var(--up);
}

.quote .chg.down {
  color: var(--down);
}

.quote .chg.flat {
  color: var(--dim);
}

.quote .manual {
  margin-left: 4px;
  font-size: 9.5px;
  color: var(--gold);
  vertical-align: middle;
}

.yield-block {
  grid-area: yield;
  font-variant-numeric: tabular-nums;
}

.yield-block .yield-main {
  color: var(--gold);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.yield-block .yield-main small {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--dim);
  margin-left: 4px;
  letter-spacing: 0;
}

.yield-block .yield-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--dim);
}

.pct-block {
  grid-area: pct;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pct-top {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  font-size: 11px;
  color: var(--dim);
}

.pct-top b {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.pct-top b.high {
  color: var(--gold);
}

.pct-top b.low {
  color: var(--teal);
}

.pct-bar {
  position: relative;
  height: 6px;
  margin-top: 6px;
  border-radius: 99px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 10%),
    linear-gradient(90deg, rgba(86, 214, 201, 0.32), rgba(243, 201, 105, 0.28));
  overflow: hidden;
}

.pct-bar > i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(86, 214, 201, 0.9), rgba(243, 201, 105, 0.95));
  transition: width 0.5s ease;
}

.pct-bar > u {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18), 0 0 10px rgba(255, 255, 255, 0.5);
}

.pct-block .zone {
  margin-top: 4px;
  font-size: 10px;
  color: var(--dim);
}

/* --------------------------------------------------------------- card mid */
.card-mid {
  display: grid;
  gap: 9px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.boll-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.mini-label {
  margin-right: 2px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
}

.boll-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px 3px 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.boll-chip i {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  opacity: 0.6;
}

.boll-chip.pos-up {
  color: #ff9aa4;
  border-color: rgba(255, 107, 122, 0.3);
  background: rgba(255, 107, 122, 0.11);
}

.boll-chip.pos-midup {
  color: #f5cf7c;
  border-color: rgba(243, 201, 105, 0.3);
  background: rgba(243, 201, 105, 0.11);
}

.boll-chip.pos-mid {
  color: #a9bdda;
  border-color: rgba(169, 189, 218, 0.22);
  background: rgba(169, 189, 218, 0.08);
}

.boll-chip.pos-midlow {
  color: #79dbd1;
  border-color: rgba(86, 214, 201, 0.28);
  background: rgba(86, 214, 201, 0.1);
}

.boll-chip.pos-down {
  color: #69e2b8;
  border-color: rgba(46, 211, 160, 0.3);
  background: rgba(46, 211, 160, 0.11);
}

.boll-chip.empty {
  color: var(--dim);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.resonance {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 9.5px;
  font-weight: 700;
}

.ladder {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.ladder-items {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.ladder-item {
  padding: 4px 3px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.024);
  text-align: center;
  font-variant-numeric: tabular-nums;
  transition: 0.16s ease;
}

.ladder-item i {
  display: block;
  font-style: normal;
  font-size: 9px;
  color: var(--dim);
  line-height: 1.2;
}

.ladder-item b {
  display: block;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
}

.ladder-item.nearest {
  border-color: var(--gold-line);
  background: var(--gold-soft);
}

.ladder-item.nearest b {
  color: var(--gold);
}

/* -------------------------------------------------------------- card foot */
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.hold-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.hold-stats span {
  white-space: nowrap;
}

.hold-stats b {
  color: var(--text);
  font-weight: 650;
}

.hold-stats b.gold {
  color: var(--gold);
}

.hold-stats b.up {
  color: var(--up);
}

.hold-stats b.down {
  color: var(--down);
}

.hold-stats .empty-pos {
  color: var(--dim);
  opacity: 0.75;
}

.card-actions {
  display: flex;
  gap: 5px;
}

.card-actions .ghost-btn {
  height: 29px;
  padding: 0 9px;
  font-size: 11px;
}

/* -------------------------------------------------------------- skeleton */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  animation: shimmer 1.4s infinite;
}

.sk-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(13, 27, 51, 0.7);
}

.sk-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sk-row + .sk-row {
  margin-top: 14px;
}

.sk-line {
  height: 12px;
}

.sk-line.w40 {
  width: 40%;
}

.sk-line.w25 {
  width: 25%;
}

.sk-line.w18 {
  width: 18%;
}

.sk-line.w60 {
  width: 60%;
}

.sk-line.h20 {
  height: 20px;
}

.sk-line.h24 {
  height: 24px;
}

/* --------------------------------------------------------------- empty */
.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 54px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 4px;
  border-radius: 18px;
  border: 1px solid var(--gold-line);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 26px;
  font-weight: 800;
}

.empty-state h3 {
  font-size: 16px;
}

.empty-state p {
  max-width: 320px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--dim);
}

.empty-filter {
  padding: 34px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--dim);
  font-size: 12.5px;
  text-align: center;
}

/* --------------------------------------------------------------- footnote */
.footnote {
  margin-top: 22px;
  padding: 12px 2px;
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--dim);
  border-top: 1px solid var(--line);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 2px 0;
  font-size: 10.5px;
  color: var(--dim);
}

/* ------------------------------------------------------------------ fab */
.fab {
  display: none;
}

/* ------------------------------------------------------------ bottom nav */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  padding: 6px 6px calc(6px + var(--safe-bottom));
  background: rgba(6, 14, 28, 0.92);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid var(--line);
}

.bottom-nav button {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--dim);
  font-size: 10px;
  transition: 0.16s ease;
}

.bottom-nav button span {
  font-size: 17px;
  line-height: 1;
}

.bottom-nav button.active {
  color: var(--gold);
  background: rgba(243, 201, 105, 0.07);
}

.bottom-nav button i {
  position: absolute;
  top: 4px;
  right: calc(50% - 17px);
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ff4d6a;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
}

/* --------------------------------------------------------------- overlay */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(3, 8, 16, 0.74);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: fadeIn 0.18s ease;
}

.modal-panel {
  position: relative;
  width: min(660px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background:
    radial-gradient(520px 220px at 100% -10%, rgba(48, 96, 176, 0.22), transparent 70%),
    linear-gradient(160deg, #0e1e38, #081426);
  box-shadow: var(--shadow);
  animation: popIn 0.2s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 13px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.modal-title {
  padding-right: 34px;
}

.modal-title h2 {
  font-size: 19px;
  font-weight: 720;
}

.modal-title p {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--dim);
}

.modal-section {
  margin-top: 18px;
}

.modal-section > h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.modal-section > h3::before {
  content: "";
  width: 3px;
  height: 11px;
  border-radius: 2px;
  background: var(--gold);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- drawer */
.drawer-overlay {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}

.drawer-panel {
  width: min(700px, 100%);
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  border-left: 1px solid var(--line-strong);
  background:
    radial-gradient(560px 260px at 100% 0%, rgba(48, 96, 176, 0.2), transparent 70%),
    linear-gradient(170deg, #0d1c35, #071224);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.42);
  animation: slideIn 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
}

#drawer-content {
  padding: 22px 22px calc(30px + var(--safe-bottom));
}

.d-head {
  position: relative;
}

.d-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 40px;
}

.d-title h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 22px;
  font-weight: 750;
}

.d-title p {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--dim);
}

.d-title .close-x {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 19px;
}

.d-hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  background: var(--line);
}

.d-hero > div {
  padding: 11px 13px;
  background: rgba(9, 21, 40, 0.94);
  font-variant-numeric: tabular-nums;
}

.d-hero span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--dim);
}

.d-hero b {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  font-weight: 720;
  line-height: 1.25;
}

.d-hero b.gold {
  color: var(--gold);
}

.d-hero em {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  font-style: normal;
  color: var(--dim);
}

.d-hero em.up {
  color: var(--up);
}

.d-hero em.down {
  color: var(--down);
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 3px;
  margin: 16px -4px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 18, 34, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tab {
  flex: 1;
  min-width: 0;
  padding: 8px 4px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  transition: 0.16s ease;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--gold-soft);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(243, 201, 105, 0.2);
}

.d-body {
  padding-top: 14px;
  animation: fadeIn 0.18s ease;
}

/* ---------------------------------------------------------------- panels */
.panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.022);
}

.panel + .panel {
  margin-top: 10px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.panel-head h3 {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.panel-head .hint {
  font-size: 10.5px;
  color: var(--dim);
}

.panel-note {
  margin-top: 8px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--dim);
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.panel-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kv {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(145, 176, 220, 0.09);
  font-size: 11.5px;
}

.kv:last-child {
  border-bottom: 0;
}

.kv > span {
  color: var(--dim);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.kv > b {
  flex: none;
  font-weight: 650;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.kv > b.gold {
  color: var(--gold);
}

/* ---------------------------------------------------------------- tables */
.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data th {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-align: left;
}

table.data td {
  padding: 8px;
  border-bottom: 1px solid rgba(145, 176, 220, 0.07);
}

table.data tr:last-child td {
  border-bottom: 0;
}

table.data td.right,
table.data th.right {
  text-align: right;
}

table.data td.gold {
  color: var(--gold);
  font-weight: 650;
}

/* ----------------------------------------------------------------- forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--dim);
}

.field label .auto {
  margin-left: 4px;
  color: var(--gold);
  font-weight: 500;
  opacity: 0.8;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: rgba(5, 13, 26, 0.72);
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  transition: 0.16s ease;
}

.field textarea {
  min-height: 68px;
  resize: vertical;
  line-height: 1.55;
  font-size: 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(243, 201, 105, 0.5);
  background: rgba(5, 13, 26, 0.92);
  box-shadow: 0 0 0 3px rgba(243, 201, 105, 0.08);
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(107, 127, 159, 0.75);
}

.field .hint {
  font-size: 10px;
  line-height: 1.5;
  color: var(--dim);
}

input[type="date"],
input[type="datetime-local"] {
  color-scheme: dark;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(145, 176, 220, 0.09);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-copy {
  min-width: 0;
}

.switch-copy b {
  display: block;
  font-size: 12px;
  font-weight: 650;
}

.switch-copy span {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--dim);
}

.switch {
  position: relative;
  width: 40px;
  height: 23px;
  flex: none;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch i {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  transition: 0.18s ease;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #c9d5e8;
  transition: 0.18s ease;
}

.switch input:checked + i {
  background: linear-gradient(120deg, #d9a53f, #ffe094);
}

.switch input:checked + i::after {
  left: 20px;
  background: #17233b;
}

.seg {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 13, 26, 0.6);
}

.seg label {
  flex: 1;
  text-align: center;
}

.seg input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.seg span {
  display: block;
  padding: 7px 6px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  transition: 0.16s ease;
}

.seg input:checked + span.buy {
  background: rgba(255, 107, 122, 0.14);
  color: #ff8c99;
}

.seg input:checked + span.sell {
  background: rgba(46, 211, 160, 0.14);
  color: #57ddb1;
}

/* -------------------------------------------------------------- add modal */
.suggest-list {
  display: grid;
  gap: 4px;
  max-height: 190px;
  margin-top: 7px;
  overflow: auto;
}

.suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  color: var(--text);
  font-size: 12px;
}

.suggest-item:hover {
  border-color: var(--gold-line);
  background: var(--gold-soft);
}

.suggest-item span {
  color: var(--dim);
  font-size: 10.5px;
}

.preview-box {
  margin-top: 11px;
  min-height: 44px;
}

.preview-card {
  padding: 13px;
  border: 1px solid rgba(243, 201, 105, 0.25);
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(243, 201, 105, 0.08), rgba(243, 201, 105, 0.015));
}

.preview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.preview-top h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
}

.preview-top .p-price {
  font-size: 18px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 11px;
}

.preview-grid div {
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(5, 13, 26, 0.55);
}

.preview-grid span {
  display: block;
  font-size: 9.5px;
  color: var(--dim);
}

.preview-grid b {
  display: block;
  margin-top: 1px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.preview-grid b.gold {
  color: var(--gold);
}

.preview-note {
  margin-top: 9px;
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--dim);
}

.preview-warn {
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 176, 92, 0.25);
  border-radius: 9px;
  background: rgba(255, 176, 92, 0.08);
  color: #ffb05c;
  font-size: 11px;
}

/* ---------------------------------------------------------------- alerts */
.alert-list {
  display: grid;
  gap: 8px;
}

.alert-item {
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.alert-item.sell {
  border-left-color: var(--down);
}

.alert-item.buy {
  border-left-color: var(--gold);
}

.alert-item.dismissed {
  opacity: 0.5;
}

.alert-top {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.alert-side {
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.alert-item.buy .alert-side {
  background: var(--gold-soft);
  color: var(--gold);
}

.alert-item.sell .alert-side {
  background: var(--down-soft);
  color: var(--down);
}

.alert-top b {
  font-size: 12.5px;
  font-weight: 700;
}

.alert-top time {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--dim);
  white-space: nowrap;
}

.alert-item p {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
}

.alert-meta {
  margin-top: 6px;
  font-size: 10px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.alert-actions {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}

.alert-empty {
  padding: 36px 16px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

/* ------------------------------------------------------------------ toast */
.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-bottom));
  z-index: 220;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(12, 26, 48, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  animation: toastIn 0.2s ease;
  pointer-events: auto;
}

.toast::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.toast.error {
  border-color: rgba(255, 107, 122, 0.35);
}

.toast.error::before {
  background: var(--up);
  box-shadow: 0 0 8px var(--up);
}

.toast.success::before {
  background: var(--down);
  box-shadow: 0 0 8px var(--down);
}

.toast.hide {
  opacity: 0;
  transform: translateY(6px);
  transition: 0.3s ease;
}

/* ------------------------------------------------------------------ login */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(700px 420px at 50% 0%, rgba(36, 78, 148, 0.4), transparent 70%),
    linear-gradient(165deg, #071226, #040a14);
}

.login-card {
  width: min(380px, 100%);
  padding: 28px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(18, 37, 69, 0.96), rgba(8, 20, 38, 0.98));
  box-shadow: var(--shadow);
}

.login-card .brand-mark {
  width: 50px;
  height: 50px;
  margin-bottom: 16px;
  border-radius: 15px;
}

.login-card h2 {
  font-size: 21px;
  font-weight: 750;
}

.login-card p {
  margin-top: 4px;
  margin-bottom: 18px;
  font-size: 11.5px;
  color: var(--dim);
}

.login-card .primary-btn {
  width: 100%;
  margin-top: 4px;
}

.login-error {
  margin-top: 9px;
  font-size: 11px;
  color: var(--up);
}

/* ------------------------------------------------------------------ misc */
.muted {
  color: var(--dim);
}

.gold {
  color: var(--gold);
}

.up {
  color: var(--up) !important;
}

.down {
  color: var(--down) !important;
}

.flat {
  color: var(--dim) !important;
}

.nowrap {
  white-space: nowrap;
}

.spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.loading-line {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 2px;
  font-size: 11.5px;
  color: var(--dim);
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(243, 201, 105, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid-line {
  stroke: rgba(145, 176, 220, 0.1);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.chart .axis-text {
  fill: #6b7f9f;
  font-size: 9px;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}

.chart .line-upper {
  fill: none;
  stroke: rgba(255, 154, 164, 0.62);
  stroke-width: 1.2;
}

.chart .line-lower {
  fill: none;
  stroke: rgba(105, 226, 184, 0.62);
  stroke-width: 1.2;
}

.chart .line-mid {
  fill: none;
  stroke: rgba(243, 201, 105, 0.8);
  stroke-width: 1.3;
  stroke-dasharray: 4 3;
}

.chart .line-close {
  fill: none;
  stroke: #cfe0fb;
  stroke-width: 1.6;
}

.chart .line-yield {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.8;
}

.chart .area-yield {
  fill: rgba(243, 201, 105, 0.1);
}

.chart .area-band {
  fill: rgba(122, 167, 255, 0.07);
}

.chart .dot-current {
  fill: var(--gold);
  stroke: #12203a;
  stroke-width: 2;
}

.chart-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 10px;
  color: var(--dim);
}

.chart-legend i {
  display: inline-block;
  width: 9px;
  height: 2px;
  margin-right: 4px;
  vertical-align: middle;
  border-radius: 1px;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.rule-card {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.rule-card.buy {
  border-color: rgba(243, 201, 105, 0.22);
}

.rule-card.sell {
  border-color: rgba(46, 211, 160, 0.2);
}

.rule-card b {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
}

.rule-card.buy b {
  color: var(--gold);
}

.rule-card.sell b {
  color: var(--down);
}

.rule-card span {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--dim);
}

.lot-row,
.trade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(145, 176, 220, 0.09);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.lot-row:last-child,
.trade-row:last-child {
  border-bottom: 0;
}

.lot-row .lot-main,
.trade-row .trade-main {
  min-width: 0;
}

.lot-row .lot-main b,
.trade-row .trade-main b {
  font-weight: 650;
}

.lot-row .lot-main span,
.trade-row .trade-main span {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--dim);
}

.trade-badge {
  display: inline-block;
  min-width: 30px;
  margin-right: 5px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 750;
  text-align: center;
}

.trade-badge.buy {
  background: var(--up-soft);
  color: #ff8c99;
}

.trade-badge.sell {
  background: var(--down-soft);
  color: #57ddb1;
}

.method-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(122, 167, 255, 0.07);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--muted);
}

.warn-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 176, 92, 0.22);
  background: rgba(255, 176, 92, 0.07);
  font-size: 10.5px;
  line-height: 1.6;
  color: #ffbd78;
}

.divider {
  height: 1px;
  margin: 14px 0;
  background: var(--line);
}

/* -------------------------------------------------------------- keyframes */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* -------------------------------------------------------------- responsive */
@media (min-width: 720px) {
  .app-shell {
    padding-left: 24px;
    padding-right: 24px;
  }

  .topbar {
    margin-left: -24px;
    margin-right: -24px;
    padding: 16px 24px 14px;
  }

  .brand-text h1 {
    font-size: 21px;
  }

  .content {
    padding-top: 22px;
  }

  .summary {
    gap: 13px;
  }

  .sum-card {
    padding: 17px 18px;
  }

  .sum-value {
    font-size: 28px;
  }

  .stock-card {
    padding: 18px 20px;
  }

  .name-row h3 {
    font-size: 18px;
  }

  .quote .price {
    font-size: 25px;
  }

  .yield-block .yield-main {
    font-size: 24px;
  }

  .bottom-nav {
    display: none;
  }

  .app-shell {
    padding-bottom: 32px;
  }

  .toast-root {
    bottom: 28px;
  }
}

@media (min-width: 900px) {
  .summary {
    grid-template-columns: 1.45fr 1fr 1fr 1fr;
  }

  .sum-card.primary {
    grid-column: auto;
  }

  .card-head {
    grid-template-columns: minmax(0, 1.55fr) 112px 122px 188px;
    grid-template-areas: "identity quote yield pct";
    gap: 16px;
    align-items: center;
  }

  .quote {
    text-align: right;
  }

  .yield-block {
    text-align: right;
  }

  .pct-block {
    padding-left: 14px;
    border-left: 1px solid var(--line);
  }

  .card-mid {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 26px;
  }

  .ladder {
    justify-content: flex-end;
  }

  .ladder-items {
    max-width: 470px;
  }

  .d-hero {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mini-search input {
    width: 148px;
  }
}

@media (min-width: 1024px) {
  .stock-card {
    padding: 20px 22px;
  }

  .card-head {
    grid-template-columns: minmax(0, 1.7fr) 120px 130px 210px;
    gap: 20px;
  }

  .hold-stats {
    gap: 18px;
  }

  #drawer-content {
    padding: 26px 28px calc(36px + var(--safe-bottom));
  }
}

@media (max-width: 719px) {
  .app-shell {
    padding-bottom: calc(var(--nav-h) + 26px + var(--safe-bottom));
  }

  /* 手机端由底部导航承担添加 / 提醒 / 设置，顶栏只保留刷新与添加，避免挤压标题 */
  #alerts-btn,
  #settings-btn {
    display: none;
  }

  .summary .sum-card:last-child {
    grid-column: 1 / -1;
  }

  .brand-text h1 {
    font-size: 17px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .brand-mark span {
    font-size: 19px;
  }

  .add-btn {
    width: 40px;
    padding: 0;
    font-size: 0;
    gap: 0;
  }

  .add-btn svg {
    width: 18px;
    height: 18px;
  }

  .stock-card {
    padding: 15px 15px 14px;
  }

  .controls {
    width: 100%;
  }

  .mini-search {
    flex: 1 1 100%;
    min-width: 0;
  }

  .mini-search input {
    width: 100%;
  }

  .controls select {
    flex: 1 1 0;
    min-width: 0;
  }

  .modal-panel {
    padding: 20px 17px;
    border-radius: 18px;
  }

  .drawer-overlay {
    align-items: flex-end;
  }

  .drawer-panel {
    width: 100%;
    height: 94vh;
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    border-radius: 20px 20px 0 0;
    animation: sheetIn 0.24s cubic-bezier(0.2, 0.8, 0.3, 1);
  }

  #drawer-content {
    padding: 18px 15px calc(28px + var(--safe-bottom));
  }

  .d-title h2 {
    font-size: 20px;
  }

  .panel-grid,
  .panel-grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .rule-grid {
    grid-template-columns: 1fr;
  }

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

  .card-foot {
    align-items: flex-start;
  }

  .card-actions {
    width: 100%;
  }

  .card-actions .ghost-btn {
    flex: 1;
  }

  .footer {
    padding-bottom: 4px;
  }

  .toast-root {
    bottom: calc(var(--nav-h) + 16px + var(--safe-bottom));
  }
}

@keyframes sheetIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
}

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

/* scrollbars */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 8px;
  background: rgba(145, 176, 220, 0.22);
  background-clip: content-box;
}
