:root {
  color-scheme: dark;
  --page: #0b1018;
  --side: #0e151f;
  --panel: #111a25;
  --raised: #182330;
  --line: #243241;
  --line-light: #2e4050;
  --text: #edf3f8;
  --muted: #99aabb;
  --dim: #889caf;
  --mint: #60e7bf;
  --mint-ink: #06241e;
  --red: #ff8996;
  --radius: 16px;
  --sidebar: 224px;
  font-family: Geist, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  background: var(--page);
  color: var(--text);
  font-size: 14px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
h1, h2, p { margin: 0; }
small { font-size: 12px; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; vertical-align: middle; }
.numeric, .records td, .details dd, .account-metrics strong { font-variant-numeric: tabular-nums; }
.up { color: var(--mint); }
.down { color: var(--red); }
.subdued { color: var(--dim); font-size: 12px; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 5;
  display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line);
  padding: 28px 15px 16px;
}
.brand, .mobile-brand { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 730; letter-spacing: -.7px; }
.brand { padding: 0 9px; margin-bottom: 38px; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-weight: 450; font-size: 11px; letter-spacing: 1.1px; }
.logo {
  width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  gap: 3px; padding: 0 6px; background: var(--mint); box-shadow: 0 3px 18px #53e2b42b; flex: 0 0 auto;
}
.logo i { display: block; background: #08392e; width: 4px; border-radius: 2px; transform: skewY(-26deg); }
.logo i:nth-child(1) { height: 10px; margin-top: 8px; }
.logo i:nth-child(2) { height: 16px; }
.logo i:nth-child(3) { height: 22px; margin-bottom: 7px; }
.sidebar nav { display: grid; gap: 5px; }
.nav-link {
  border: 1px solid transparent; background: transparent; border-radius: 9px; display: flex;
  align-items: center; gap: 12px; min-height: 45px; padding: 0 12px; color: var(--muted);
  font-size: 13px; font-weight: 550; white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--raised); }
.nav-link.active { background: #172e2e; color: var(--mint); border-color: #245043; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 15px; }
.profile { display: flex; align-items: center; gap: 10px; padding: 15px 7px 6px; border-top: 1px solid var(--line); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: #22413b; color: #a5f8dc; font-size: 14px; font-weight: 650;
}
.profile strong, .profile small { display: block; }
.profile strong { font-size: 12px; }
.profile small { color: var(--muted); margin-top: 3px; font-size: 11px; }
.mobile-brand, .mobile-nav, .nav-short { display: none; }

.workspace { margin-left: var(--sidebar); }
.topbar {
  height: 66px; border-bottom: 1px solid var(--line); padding: 0 30px; display: flex;
  align-items: center; justify-content: space-between; gap: 12px; background: #0d141d;
}
.breadcrumb, .top-tools { display: flex; align-items: center; gap: 11px; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb .icon { width: 14px; height: 14px; }
.breadcrumb strong { color: var(--text); font-weight: 550; }
.top-tools { gap: 16px; }
.search-button {
  height: 34px; min-width: 148px; display: flex; align-items: center; gap: 7px; border-radius: 8px;
  color: var(--muted); background: #111b27; border: 1px solid var(--line); padding: 0 8px;
  font-size: 12px;
}
.search-button:hover { border-color: var(--line-light); color: var(--text); }
.search-button .icon { width: 16px; height: 16px; }
kbd { margin-left: auto; border: 1px solid var(--line-light); padding: 0 5px; border-radius: 4px; color: var(--dim); line-height: 16px; }
.mode {
  display: inline-flex; gap: 7px; align-items: center; background: #102821; color: #88e8c3;
  border: 1px solid #245344; border-radius: 999px; white-space: nowrap; padding: 5px 10px; font-size: 11px;
}
.mode i, .breadth i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mode i { box-shadow: 0 0 9px #5ef1bb76; }
.main { max-width: 1536px; margin: 0 auto; padding: 26px 30px 40px; }
.page-title { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.page-title h1 { font-size: 29px; letter-spacing: .01em; font-weight: 720; line-height: 1.25; }
.page-title p { margin-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; min-height: 38px;
  border: 1px solid transparent; border-radius: 9px; padding: 0 13px; font-size: 13px; font-weight: 650;
}
.button .icon { width: 16px; height: 16px; }
.button.primary { background: var(--mint); color: var(--mint-ink); }
.button.primary:hover { background: #86f6d4; }
.button.secondary { border-color: var(--line-light); background: var(--raised); }
.button.secondary:hover { border-color: var(--mint); }
.button.wide { width: 100%; }

.dashboard { display: grid; grid-template-columns: minmax(0, 2.05fr) minmax(255px, 1fr); align-items: start; gap: 18px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.panel h2 { font-size: 16px; font-weight: 670; letter-spacing: .012em; }
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 62px; padding: 12px 18px;
}
.panel-glyph {
  display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px;
  color: var(--mint); border: 1px solid #2b4f46; background: #1a332f;
}
.panel-glyph .icon { width: 16px; height: 16px; }
.balance-panel {
  padding: 20px 20px 13px; min-height: 318px;
  background: radial-gradient(ellipse at 79% -40%, #1d483f 0%, transparent 69%), linear-gradient(135deg, #13232b, #111a25 70%);
  border-color: #28423f;
}
.balance-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.balance-label { display: flex; align-items: center; gap: 7px; color: #b4c8ce; }
.balance-label h2 { font-weight: 560; font-size: 13px; }
.icon-button {
  width: 27px; height: 27px; display: inline-grid; place-items: center; padding: 0;
  border: 0; border-radius: 6px; color: var(--muted); background: transparent;
}
.icon-button:hover { color: var(--text); background: var(--raised); }
.icon-button .icon { width: 17px; height: 17px; }
.balance-value { font-size: clamp(28px, 3.3vw, 46px); font-weight: 690; letter-spacing: -.04em; line-height: 1.23; white-space: nowrap; }
.balance-value span { color: #9eafbe; font-size: 13px; font-weight: 560; letter-spacing: .03em; margin-left: 2px; }
.balance-meta { margin-top: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 11px; }
.change { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 630; white-space: nowrap; }
.change .icon { width: 15px; height: 15px; }
.segment { display: flex; border: 1px solid #304550; border-radius: 8px; background: #101c254d; padding: 2px; gap: 2px; flex-shrink: 0; }
.segment button {
  font-size: 11px; border: 0; border-radius: 5px; background: transparent; color: var(--muted);
  padding: 5px 7px; white-space: nowrap;
}
.segment button[aria-pressed="true"] { background: #27483f; color: #a4f7da; }
.segment button:hover { color: var(--text); }
.chart { width: 100%; display: block; }
.balance-chart, .hidden-chart { height: 169px; margin-top: 9px; }
.hidden-chart { display: grid; place-items: center; color: var(--dim); }
.estimate { margin-top: 7px; font-size: 11px; color: var(--dim); }

.pulse { min-height: 318px; align-self: stretch; }
.pulse-body { padding: 0 17px 12px; }
.breadth { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 4px; }
.breadth span { display: flex; align-items: center; gap: 5px; }
.breadth-meter {
  width: 100%; height: 6px; appearance: none; display: block; border: 0; border-radius: 9px;
  overflow: hidden; background: #943d51;
}
.breadth-meter::-webkit-meter-bar { height: 6px; border: 0; background: #943d51; }
.breadth-meter::-webkit-meter-optimum-value, .breadth-meter::-webkit-meter-suboptimum-value, .breadth-meter::-webkit-meter-even-less-good-value { background: #60e7bf; }
.breadth-meter::-moz-meter-bar { background: #60e7bf; }
.picks { margin-top: 8px; }
.pick {
  min-width: 0; min-height: 63px; display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid var(--line); padding: 7px 0;
}
.pick:last-child { border-bottom: 0; }
.pick:hover .pick-name strong { color: var(--mint); }
.pick-name, .pick-price { display: grid; gap: 4px; }
.pick-name strong, .pick-price strong { font-size: 13px; font-weight: 650; }
.pick-name small { color: var(--dim); font-size: 11px; }
.pick-price, .search-results .pick > .numeric { margin-left: auto; text-align: right; }
.pick-price small { font-size: 11px; }
.instrument-icon {
  position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  font-size: 12px; font-weight: 700; background: #1c3449; color: #a5d5ff; border: 1px solid #ffffff16;
}
.instrument-icon small {
  position: absolute; display: grid; place-items: center; right: -5px; bottom: -3px; width: 19px; height: 17px;
  background: #233248; color: #d0dff1; border: 2px solid var(--panel); border-radius: 9px; font-size: 7px;
}
.instrument-icon.indigo { background: #24314c; color: #b6c8ff; }
.instrument-icon.violet { background: #382d4e; color: #ddc0ff; }
.instrument-icon.pink { background: #442b40; color: #f2b4de; }
.instrument-icon.gold { background: #42341d; color: #f5ca76; }
.instrument-icon.silver { background: #2e3d4c; color: #c7dae7; }
.instrument-icon.teal { background: #224138; color: #94eac8; }

.quotes .section-head { min-height: 54px; padding-bottom: 3px; }
.market-tabs { display: flex; gap: 6px; padding: 10px 17px 13px; overflow-x: auto; }
.market-tabs button {
  background: #16212e; color: var(--muted); border: 1px solid #273747; border-radius: 7px;
  padding: 6px 11px; white-space: nowrap; font-size: 12px; flex-shrink: 0;
}
.market-tabs button:hover { color: var(--text); }
.market-tabs button[aria-pressed="true"] { background: #1b3632; border-color: #31584e; color: var(--mint); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { color: var(--dim); font-size: 11px; font-weight: 530; white-space: nowrap; background: #151f2b; }
td, th { padding: 10px 9px; }
td:first-child, th:first-child { padding-left: 18px; }
td:last-child, th:last-child { padding-right: 18px; }
tbody tr + tr td { border-top: 1px solid var(--line); }
tbody tr:hover { background: #16212b; }
.quote-table th:nth-child(n + 3), .quote-table td:nth-child(n + 3) { text-align: right; }
.quote-table td { height: 58px; }
.quote-table .trade-cell { width: 35px; padding-left: 4px; }
.ticker { display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.ticker strong, .ticker small { display: block; }
.ticker strong { font-size: 13px; font-weight: 670; }
.ticker small { font-size: 11px; color: var(--dim); margin-top: 3px; }
a.ticker:hover strong { color: var(--mint); }
.sparkline { width: clamp(65px, 8vw, 126px); height: 26px; display: block; }
.quote-price { white-space: nowrap; font-weight: 630; }
.chip { border-radius: 6px; padding: 4px 6px; }
.chip.up { background: #1c3a32; }
.chip.down { background: #372731; }
.row-link { display: inline-grid; place-items: center; min-width: 22px; min-height: 28px; color: var(--dim); }
.row-link:hover { color: var(--mint); }
.row-link .icon { width: 14px; height: 14px; }

.news-list { padding: 0 17px 9px; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: #73dbbf; font-size: 12px; white-space: nowrap; }
.text-link:hover { color: #a9f9e1; }
.text-link .icon { width: 14px; height: 14px; }
.news-row {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 65px; background: transparent;
  padding: 8px 0; text-align: left; border: 0; border-top: 1px solid var(--line);
}
.news-row > .icon { margin-left: auto; color: var(--dim); width: 14px; }
.news-row:hover strong { color: var(--mint); }
.news-icon { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; border-radius: 8px; color: #9bbdc9; background: #1d2e3c; }
.news-icon .icon { width: 16px; height: 16px; }
.news-copy { display: grid; gap: 5px; }
.news-copy strong { font-size: 12px; font-weight: 600; line-height: 1.5; }
.news-meta { color: var(--dim); font-size: 11px; display: flex; gap: 6px; align-items: center; }
.news-meta i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.all-news .news-row { min-height: 76px; }
.all-news .news-copy strong { font-size: 14px; }

.instrument { padding-bottom: 16px; }
.instrument .section-head { padding-bottom: 4px; padding-top: 17px; }
.instrument-data { padding: 10px 18px 0; }
.instrument-data .change { margin-top: 6px; }
.instrument-chart { height: 255px; width: calc(100% - 36px); margin: 12px auto 0; }
.form-body { padding: 0 18px 19px; display: grid; gap: 13px; }
.field { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.field input, .field select {
  width: 100%; min-height: 40px; padding: 0 10px; border: 1px solid var(--line-light);
  border-radius: 8px; color: var(--text); background: #0d151f; font-size: 14px;
}
.side-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 9px; }
.side-switch button { min-height: 33px; background: transparent; border: 0; border-radius: 6px; color: var(--muted); }
.side-switch button[aria-pressed="true"] { color: var(--mint); background: #1c3a32; }
.side-switch button[data-value="sell"][aria-pressed="true"] { color: var(--red); background: #372731; }
.details { display: grid; gap: 7px; margin: 0; color: var(--muted); font-size: 12px; }
.details div { display: flex; justify-content: space-between; gap: 10px; }
.details dd { margin: 0; color: var(--text); }
.form-error { color: var(--red); font-size: 12px; }
.form-error:empty { display: none; }
.account-layout { display: grid; gap: 18px; }
.account-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 18px 20px; gap: 16px; }
.account-metrics > div { background: #141f2a; border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 8px; }
.account-metrics span { font-size: 12px; color: var(--muted); }
.account-metrics strong { font-size: 20px; white-space: nowrap; }
.records td { white-space: nowrap; font-size: 13px; padding-top: 15px; padding-bottom: 15px; }
.empty { min-height: 160px; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; color: var(--muted); padding: 15px; }

dialog {
  width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0;
  border: 1px solid var(--line-light); border-radius: 15px; background: var(--panel); color: var(--text);
  box-shadow: 0 18px 60px #0008;
}
dialog::backdrop { background: #050910bc; backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 16px; }
.dialog-body { padding: 16px 17px; }
.article { color: var(--muted); line-height: 1.75; }
.article p { white-space: pre-wrap; overflow-wrap: anywhere; }
.article > * + * { margin-top: 9px; }
.search-results { overflow: auto; max-height: min(390px, 50dvh); padding-right: 6px; }
.no-results { margin: 15px 0 2px; color: var(--muted); }
#toast {
  position: fixed; right: 22px; bottom: 24px; z-index: 10; display: flex; align-items: center; gap: 8px;
  opacity: 0; pointer-events: none; border: 1px solid #36745e; background: #19392e; color: #c6ffec;
  padding: 11px 13px; border-radius: 9px; box-shadow: 0 6px 24px #0006; transition: opacity .15s;
}
#toast.visible { opacity: 1; }
.startup { display: grid; justify-items: center; place-content: center; gap: 14px; min-height: 66vh; color: var(--muted); }

@media (max-width: 1110px) {
  :root { --sidebar: 184px; }
  .main, .topbar { padding-left: 20px; padding-right: 20px; }
  .dashboard { gap: 14px; }
  .quote-table th, .quote-table td { padding-left: 6px; padding-right: 6px; }
  .quote-table th:first-child, .quote-table td:first-child { padding-left: 15px; }
  .quote-table th:last-child, .quote-table td:last-child { padding-right: 12px; }
}
@media (max-width: 950px) and (min-width: 741px) {
  :root { --sidebar: 66px; }
  .sidebar { padding-left: 9px; padding-right: 9px; }
  .brand { padding: 0; justify-content: center; }
  .brand > span:nth-child(2), .nav-long, .profile > div { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .nav-link { justify-content: center; padding: 0; }
  .sidebar-bottom button { font-size: 0; gap: 0; }
  .profile { justify-content: center; padding-left: 0; padding-right: 0; }
}
@media (max-width: 740px) {
  .sidebar, .breadcrumb, .nav-long { display: none; }
  .workspace { margin-left: 0; }
  .mobile-brand { display: flex; gap: 8px; font-size: 19px; }
  .mobile-brand .logo { width: 30px; height: 30px; border-radius: 8px; transform: scale(.96); }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px;
    position: fixed; inset: auto 0 0; z-index: 5; background: #101824;
    border-top: 1px solid var(--line); padding: 5px 9px max(6px, env(safe-area-inset-bottom));
  }
  .mobile-nav .nav-link { display: grid; justify-content: center; justify-items: center; gap: 3px; min-height: 44px; padding: 4px; }
  .mobile-nav .nav-short { display: block; font-size: 10px; }
  .mobile-nav .nav-link .icon { width: 18px; height: 18px; }
  .topbar { height: 58px; padding: 0 16px; }
  .top-tools { gap: 8px; }
  .search-button { min-width: 35px; justify-content: center; }
  .search-button span, .search-button kbd { display: none; }
  .main { padding: 19px 14px calc(75px + env(safe-area-inset-bottom)); }
  .page-title { align-items: center; margin-bottom: 16px; }
  .page-title h1 { font-size: 24px; }
  .page-title p { margin-top: 5px; font-size: 11px; }
  .dashboard { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .dashboard:not(.trade-layout) .quotes { grid-row: 2; }
  .balance-panel { min-height: 0; padding: 13px 13px 12px; }
  .balance-chart, .hidden-chart { height: 139px; }
  .section-head { min-height: 54px; padding-left: 13px; padding-right: 13px; }
  .instrument-chart { height: 185px; }
  .pulse { min-height: 0; }
  .account-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-left: 12px; padding-right: 12px; }
  .account-metrics > div { padding: 10px; }
  .account-metrics strong { font-size: 16px; }
  #toast { right: 13px; bottom: calc(67px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .quote-table .trade-cell { display: none; }
  .quote-table th:nth-child(4), .quote-table td:nth-child(4) { padding-right: 11px; }
  .sparkline { width: 55px; }
  .quote-table td:first-child, .quote-table th:first-child { padding-left: 10px; }
  .quote-table .ticker { gap: 8px; }
  .quote-table .instrument-icon { width: 28px; height: 28px; font-size: 10px; }
  .quote-price, .quote-table .ticker strong { font-size: 12px; }
  .market-tabs { gap: 5px; padding-inline: 11px; }
  .market-tabs button { padding-inline: 8px; }
}
@media (max-width: 355px) {
  .balance-value { font-size: 25px; }
  .balance-value span { font-size: 10px; }
  .segment button { padding-left: 4px; padding-right: 4px; }
  .sparkline { width: 40px; }
  .quote-table .ticker small { font-size: 10px; }
  .quote-table .chip { padding: 3px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  #toast { transition: none; }
}
