/* AIQuant 终端样式 —— 沿用已确认的 UI 原型（深色终端风） */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body.x-body { background: #0B0E14; color: #E6E9EF; overflow-x: hidden; }
.x-app {
  --bg: #0B0E14; --card: #121722; --line: #1F2633; --muted: #8A93A6; --txt: #E6E9EF;
  --up: #0ECB81; --down: #F6465D; --gold: #F0B90B; --blue: #7C8CA8;
  --ui: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  display: block; max-width: none; margin: 0; padding: 0; gap: 0;
  font: 400 13px/1.5 var(--ui); color: var(--txt); background: var(--bg);
  min-height: 100vh;
}
.x-app * { box-sizing: border-box; }
.x-app button { font-family: inherit; cursor: pointer; }
.x-mono, .x-app .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.x-up { color: var(--up); } .x-down { color: var(--down); } .x-muted { color: var(--muted); }

/* sidebar */
.x-side {
  position: fixed; inset: 0 auto 0 0; width: 220px; z-index: 20;
  display: flex; flex-direction: column; padding: 20px 14px 16px;
  background: linear-gradient(180deg, #0F131C 0%, #0B0E14 100%); border-right: 1px solid var(--line);
}
.x-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.x-logo svg { width: 34px; height: 34px; filter: drop-shadow(0 0 8px rgba(240,185,11,.45)); flex: none; }
.x-logo b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.x-logo b span { color: var(--gold); }
.x-logo small { display: block; font-size: 12px; color: var(--muted); margin-top: -2px; }
.x-nav { display: flex; flex-direction: column; gap: 2px; }
.x-nav button {
  display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; text-align: left; position: relative;
  transition: background .15s, color .15s;
}
.x-nav button svg { width: 18px; height: 18px; flex: none; }
.x-nav button:hover { background: #161C28; color: var(--txt); }
.x-nav button.is-active { background: linear-gradient(90deg, rgba(240,185,11,.16), rgba(240,185,11,.03)); color: var(--gold); }
.x-nav button.is-active::before {
  content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--gold); box-shadow: 0 0 10px var(--gold);
}
.x-side__foot { margin-top: auto; display: grid; gap: 14px; }
.x-label { font-size: 12px; color: var(--muted); margin: 0 0 6px 2px; }
.x-seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; gap: 2px; border-radius: 10px; background: #0B0E14; border: 1px solid var(--line); }
.x-seg button { height: 44px; min-width: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.x-seg button:hover { color: var(--txt); }
.x-seg button.is-on { background: rgba(240,185,11,.14); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(240,185,11,.35); }
.x-seg button[data-mode="实盘"] { color: #c46a76; }
.x-seg button[data-mode="实盘"].is-on { background: #3A1820; color: #FF8A98; box-shadow: inset 0 0 0 1px #8A2E3C; }
.x-livewarn { display: none; font-size: 12px; color: var(--down); margin: 6px 2px 0; }
.x-livewarn.is-on { display: block; }
.x-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.x-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: #0B0E14; background-color: #F0B90B; background-image: linear-gradient(135deg, #F8D33A, #F0B90B 60%, #D9A300); }
.x-user b { display: block; font-size: 13px; font-weight: 600; }
.x-user small { font-size: 12px; color: var(--muted); }

/* main */
.x-main { margin-left: 220px; min-height: 100vh; display: flex; flex-direction: column; }
.x-top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px;
  background: rgba(11,14,20,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.x-top h1 { margin: 0 12px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.x-pills { display: flex; gap: 8px; flex-wrap: nowrap; min-width: 0; overflow: hidden; }
.x-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 12px; color: var(--muted); white-space: nowrap; }
.x-pill b { color: var(--txt); font-weight: 500; }
.x-pill .x-mono { color: var(--txt); }
.x-led { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px rgba(14,203,129,.18); animation: x-pulse 2s infinite; }
.x-led--gold { background: var(--gold); box-shadow: 0 0 0 3px rgba(240,185,11,.18); }
@keyframes x-pulse { 50% { box-shadow: 0 0 0 5px rgba(14,203,129,.05); } }
.x-stop {
  margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 10px; border: 0;
  background: linear-gradient(180deg, #FF5A6F, #E23A51); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(246,70,93,.5), 0 6px 22px rgba(246,70,93,.35); transition: transform .1s, filter .15s;
}
.x-stop:hover { filter: brightness(1.08); } .x-stop:active { transform: translateY(1px); }
.x-stop svg { width: 16px; height: 16px; }

.x-content { padding: 20px 24px 8px; display: grid; gap: 16px; }
.x-content[hidden] { display: none; }
.x-card {
  position: relative; background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0) 40%), var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; transition: border-color .2s, box-shadow .2s; min-width: 0;
}
.x-card:hover { border-color: #2A3344; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.x-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.x-card__head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0; }
.x-card__head .x-r { margin-left: auto; }

/* KPI */
.x-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.x-kpi { padding: 14px 16px 12px; overflow: hidden; }
.x-kpi p { margin: 0; font-size: 12px; color: var(--muted); }
.x-kpi strong { display: block; margin: 6px 0 2px; font: 600 22px/1.2 var(--mono); letter-spacing: -.02em; white-space: nowrap; }
.x-kpi strong small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.x-kpi .x-sub { font-size: 12px; color: var(--muted); white-space: nowrap; }
.x-kpi svg { display: block; width: 100%; height: 34px; margin-top: 8px; }
.x-kpi--hero { border-color: rgba(240,185,11,.28); box-shadow: inset 0 0 40px rgba(240,185,11,.05); }

/* main row */
.x-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.x-eq { height: 430px; display: flex; flex-direction: column; }
.x-eq__meta { display: flex; align-items: baseline; gap: 12px; margin: -4px 0 6px; }
.x-eq__meta strong { font: 600 24px/1.2 var(--mono); }
.x-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-left: auto; }
.x-legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.x-legend i.x-dash { background: repeating-linear-gradient(90deg, #6B7488 0 4px, transparent 4px 7px); box-shadow: none; }
.x-tabs { display: inline-flex; padding: 3px; border-radius: 9px; background: #0B0E14; border: 1px solid var(--line); }
.x-tabs button { height: 28px; min-width: 46px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 500 12px var(--mono); }
.x-tabs button:hover { color: var(--txt); }
.x-tabs button.is-on { background: var(--gold); color: #0B0E14; box-shadow: 0 0 14px rgba(240,185,11,.4); }
.x-chart { position: relative; flex: 1; min-height: 0; }
.x-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.x-chart text { font: 12px var(--mono); fill: var(--muted); }
.x-tip {
  position: absolute; pointer-events: none; z-index: 3; min-width: 168px; padding: 10px 12px; border-radius: 10px;
  background: rgba(18,23,34,.94); border: 1px solid #2A3344; box-shadow: 0 10px 30px rgba(0,0,0,.45); backdrop-filter: blur(8px);
  font-size: 12px; opacity: 0; transition: opacity .12s;
}
.x-tip.is-on { opacity: 1; }
.x-tip p { margin: 0; display: flex; justify-content: space-between; gap: 14px; }
.x-tip p + p { margin-top: 4px; }
.x-tip .x-tip__d { color: var(--muted); margin-bottom: 6px; font-family: var(--mono); }

/* feed */
.x-feed { height: 430px; display: flex; flex-direction: column; padding-bottom: 8px; }
.x-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--up); }
.x-feed ul { list-style: none; margin: 0 -8px; padding: 0 8px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: #2A3344 transparent; }
.x-dec { position: relative; padding: 10px 10px 10px 18px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.x-dec::before { content: ""; position: absolute; left: 5px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: #3A4458; }
.x-dec::after { content: ""; position: absolute; left: 8px; top: 28px; bottom: -10px; width: 1px; background: var(--line); }
.x-dec:last-child::after { display: none; }
.x-dec:hover { background: #171D2A; }
.x-dec.is-new { animation: x-in .6s ease-out; }
.x-dec.is-new::before { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
@keyframes x-in { from { opacity: 0; transform: translateY(-8px); background: rgba(240,185,11,.1); } }
.x-dec__top { display: flex; align-items: center; gap: 8px; }
.x-dec__time { font: 12px var(--mono); color: var(--muted); }
.x-dec__sym { font: 600 13px var(--mono); }
.x-act { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 6px; }
.x-act--long { color: var(--up); background: rgba(14,203,129,.13); }
.x-act--short { color: var(--down); background: rgba(246,70,93,.13); }
.x-act--close { color: #B4BCCB; background: rgba(138,147,166,.16); }
.x-act--wait { color: #9DB0D0; background: rgba(124,140,168,.16); }
.x-verdict { margin-left: auto; font-size: 12px; padding: 0 7px; border-radius: 6px; border: 1px solid; white-space: nowrap; }
.x-verdict--ok { color: var(--up); border-color: rgba(14,203,129,.35); }
.x-verdict--cut { color: var(--gold); border-color: rgba(240,185,11,.4); }
.x-verdict--no { color: var(--down); border-color: rgba(246,70,93,.4); }
.x-conf { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; font-size: 12px; color: var(--muted); }
.x-conf span:nth-child(2) { flex: 1; height: 4px; border-radius: 4px; background: #1F2633; overflow: hidden; }
.x-conf span:nth-child(2) i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #8a6a06, var(--gold)); }
.x-conf b { font: 500 12px var(--mono); color: var(--txt); }
.x-dec p { margin: 0; font-size: 12px; color: #B4BCCB; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-dec.is-open p { white-space: normal; color: var(--txt); }

/* positions */
.x-tablewrap { overflow-x: auto; margin: 0 -18px -16px; }
.x-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.x-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 8px 12px; border-bottom: 1px solid var(--line); }
.x-table td { padding: 12px 12px; border-bottom: 1px solid #181E2A; font-family: var(--mono); transition: background .6s; }
.x-table th:first-child, .x-table td:first-child { padding-left: 18px; }
.x-table th:last-child, .x-table td:last-child { padding-right: 18px; text-align: right; }
.x-table tbody tr { transition: background .15s; }
.x-table tbody tr:hover { background: #161C28; }
.x-table tbody tr:last-child td { border-bottom: 0; }
.x-table td.x-sym { font-weight: 600; font-family: var(--ui); }
.x-table td.x-sym small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.x-side-tag { font-family: var(--ui); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; }
.x-lev { font-size: 12px; padding: 1px 6px; border-radius: 5px; background: #1B2230; color: var(--gold); }
.x-flash-up { background: rgba(14,203,129,.16) !important; transition: none !important; }
.x-flash-down { background: rgba(246,70,93,.16) !important; transition: none !important; }
.x-btn-sm { height: 30px; padding: 0 14px; border-radius: 8px; border: 1px solid #2E3747; background: #1A2030; color: var(--txt); font-size: 12px; font-weight: 500; transition: all .15s; }
.x-btn-sm:hover { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px rgba(240,185,11,.2); }
.x-empty { padding: 28px; text-align: center; color: var(--muted); font-family: var(--ui) !important; }

/* bottom */
.x-row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.x-trader { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: #0F131C; border: 1px solid var(--line); transition: border-color .15s; }
.x-trader + .x-trader { margin-top: 10px; }
.x-trader:hover { border-color: #2A3344; }
.x-trader__ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(240,185,11,.12); color: var(--gold); }
.x-trader__ic svg { width: 18px; height: 18px; }
.x-trader__body { min-width: 0; flex: 1; }
.x-trader__body b { font-size: 14px; font-weight: 600; }
.x-trader__body small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-state { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; margin-left: 6px; }
.x-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.x-state.is-run { color: var(--up); } .x-state.is-pause { color: var(--muted); }
.x-trader__pnl { font: 600 13px var(--mono); text-align: right; white-space: nowrap; }
.x-trader__pnl small { display: block; font: 12px var(--ui); color: var(--muted); }
.x-switch { width: 40px; height: 24px; border-radius: 999px; border: 0; padding: 0; background: #2A3344; position: relative; flex: none; transition: background .2s, box-shadow .2s; }
.x-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #E6E9EF; transition: transform .2s; }
.x-switch[aria-checked="true"] { background: var(--gold); box-shadow: 0 0 12px rgba(240,185,11,.45); }
.x-switch[aria-checked="true"]::after { transform: translateX(16px); background: #0B0E14; }
.x-bar { margin-bottom: 13px; }
.x-bar__l { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.x-bar__l b { font: 500 12px var(--mono); color: var(--txt); }
.x-bar__t { height: 6px; border-radius: 6px; background: #1F2633; overflow: hidden; }
.x-bar__t i { display: block; height: 100%; border-radius: 6px; background: var(--up); transition: width .4s; }
.x-bar__t i.x-warn { background: var(--gold); }
.x-safe { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 9px 12px; border-radius: 10px; background: rgba(14,203,129,.07); border: 1px solid rgba(14,203,129,.2); font-size: 12px; color: var(--muted); }
.x-safe b { color: var(--up); font-weight: 500; }
.x-cost { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.x-cost div { padding: 10px 12px; border-radius: 10px; background: #0F131C; border: 1px solid var(--line); }
.x-cost p { margin: 0; font-size: 12px; color: var(--muted); }
.x-cost strong { display: block; font: 600 18px/1.3 var(--mono); margin-top: 2px; }
.x-model { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px dashed #2E3747; font-size: 12px; color: var(--muted); }
.x-model b { color: var(--txt); font-weight: 500; }
.x-model em { font-style: normal; color: var(--gold); }

.x-foot { display: flex; justify-content: space-between; gap: 16px; padding: 14px 24px 20px; font-size: 12px; color: var(--muted); }
.x-foot span:last-child { color: #B07A83; }

.x-placeholder { flex: 1; display: grid; place-items: center; padding: 60px 24px; text-align: center; }
.x-placeholder[hidden] { display: none; }
.x-placeholder .x-ph-ic { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: rgba(240,185,11,.1); color: var(--gold); box-shadow: 0 0 30px rgba(240,185,11,.15); }
.x-placeholder h2 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.x-placeholder p { margin: 0; color: var(--muted); }

/* modal + toast */
.x-modal { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; background: rgba(5,7,11,.7); backdrop-filter: blur(4px); }
.x-modal.is-on { display: grid; animation: x-fade .15s; }
@keyframes x-fade { from { opacity: 0; } }
.x-dialog { width: 420px; padding: 24px; border-radius: 14px; background: var(--card); border: 1px solid rgba(246,70,93,.4); box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 40px rgba(246,70,93,.12); }
.x-dialog__ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(246,70,93,.14); color: var(--down); margin-bottom: 14px; }
.x-dialog h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.x-dialog p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.x-dialog__btns { display: flex; justify-content: flex-end; gap: 10px; }
.x-dialog__btns button { height: 40px; padding: 0 18px; border-radius: 10px; font-size: 14px; font-weight: 500; border: 1px solid #2E3747; background: #1A2030; color: var(--txt); }
.x-dialog__btns button:hover { border-color: #46526A; }
.x-dialog__btns .x-danger { border: 0; background: linear-gradient(180deg, #FF5A6F, #E23A51); color: #fff; font-weight: 600; }
/* 金色主按钮（二次验证「确认」、非危险确认框）：需高于 .x-dialog__btns button 的优先级，否则显示为普通灰按钮 */
.x-dialog__btns .x-btn--gold { border: 0; background: linear-gradient(180deg, #F8D33A, #F0B90B); color: #0B0E14; font-weight: 600; }
.x-dialog__btns .x-btn--gold:hover { filter: brightness(1.05); }
.x-dialog__btns button:disabled { opacity: .5; cursor: not-allowed; }
.x-toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 10px 16px; border-radius: 10px; background: #1A2030; border: 1px solid #2E3747; box-shadow: 0 10px 30px rgba(0,0,0,.4); font-size: 13px; transition: all .25s; }
.x-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.x-app :focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (max-width: 1280px) {
  .x-kpi strong { font-size: 19px; }
  .x-pill--opt { display: none; }
}
@media (max-width: 1120px) {
  .x-side { width: 196px; } .x-main { margin-left: 196px; }
  .x-kpis { gap: 10px; } .x-kpi { padding: 12px; } .x-kpi strong { font-size: 17px; }
  .x-row3 { gap: 10px; } .x-cost strong { font-size: 16px; }
  .x-legend { display: none; }
}
@media (max-width: 1000px) {
  .x-side { position: static; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .x-logo { padding: 0; }
  .x-nav { order: 3; flex: 1 1 100%; flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .x-nav button { flex: none; gap: 8px; }
  .x-nav button.is-active::before { left: 12px; right: 12px; top: auto; bottom: 2px; width: auto; height: 2px; border-radius: 2px; }
  .x-side__foot { margin: 0 0 0 auto; display: flex; align-items: center; gap: 12px; }
  .x-side__foot .x-label { display: none; }
  .x-seg { width: 200px; }
  .x-side__foot > div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .x-livewarn { margin: 0; }
  .x-main { margin-left: 0; }
  .x-top { position: static; height: auto; flex-wrap: wrap; padding: 12px 16px; }
  .x-pills { flex-wrap: wrap; order: 3; flex: 1 1 100%; overflow: visible; }
  .x-pill--opt { display: inline-flex; }
  .x-content { padding: 16px; }
  .x-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .x-row, .x-row3 { grid-template-columns: minmax(0, 1fr); }
  .x-eq { height: 380px; } .x-feed { height: 420px; }
  .x-foot { padding: 14px 16px 20px; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .x-side__foot { margin: 0; flex: 1 1 100%; justify-content: space-between; }
  .x-side__foot > div:first-child { flex: 1; min-width: 0; }
  .x-seg { flex: 1; width: auto; }
  .x-user small { display: none; }
  .x-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x-kpi--hero { grid-column: 1 / -1; }
  .x-card__head { flex-wrap: wrap; }
  .x-eq { height: 400px; }
  .x-eq__meta { flex-wrap: wrap; gap: 4px 10px; }
  .x-eq__meta strong { font-size: 20px; }
  .x-tabs button { min-width: 44px; height: 36px; }
  .x-chart text { font-size: 12px; }
  .x-dialog { width: calc(100vw - 32px); }
  .x-trader { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .x-app *, .x-app *::before, .x-app *::after { animation: none !important; transition: none !important; } }
    
/* ======================= 扩展组件（真实功能页） ======================= */
.x-app input, .x-app select, .x-app textarea { font-family: inherit; }
.x-field { display: grid; gap: 6px; min-width: 0; }
.x-field > span { font-size: 12px; color: var(--muted); }
.x-field small { font-size: 12px; color: var(--muted); }
.x-input, .x-select, .x-textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid #2A3344; background: #0B0E14;
  color: var(--txt); font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.x-textarea { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.6; font-family: var(--mono); font-size: 12px; }
.x-input:focus, .x-select:focus, .x-textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(240,185,11,.12); }
.x-input.x-mono { font-family: var(--mono); }
.x-select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #8A93A6 50%), linear-gradient(135deg, #8A93A6 50%, transparent 50%); background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.x-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.x-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.x-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.x-span2 { grid-column: span 2; } .x-spanall { grid-column: 1 / -1; }
.x-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid #2E3747; background: #1A2030; color: var(--txt); font-size: 13px; font-weight: 500; white-space: nowrap; transition: all .15s; }
.x-btn:hover { border-color: var(--gold); color: var(--gold); }
.x-btn:disabled { opacity: .5; cursor: not-allowed; }
.x-btn--gold { border: 0; background: linear-gradient(180deg, #F8D33A, #F0B90B); color: #0B0E14; font-weight: 600; box-shadow: 0 4px 16px rgba(240,185,11,.25); }
.x-btn--gold:hover { color: #0B0E14; filter: brightness(1.05); }
.x-btn--danger { border-color: rgba(246,70,93,.5); color: #FF8A98; }
.x-btn--danger:hover { border-color: var(--down); color: var(--down); }
.x-btn--ghost { background: transparent; }
.x-btn-sm.x-danger-sm:hover { border-color: var(--down); color: var(--down); box-shadow: 0 0 12px rgba(246,70,93,.2); }
.x-btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.x-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid #2A3344; background: #0F131C; color: var(--muted); font-size: 12px; cursor: pointer; user-select: none; transition: all .15s; }
.x-chip.is-on { color: var(--gold); border-color: rgba(240,185,11,.45); background: rgba(240,185,11,.1); }
.x-chip button { border: 0; background: none; color: inherit; padding: 0; font-size: 14px; line-height: 1; }
.x-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.x-tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: #1B2230; color: var(--muted); white-space: nowrap; }
.x-tag--gold { color: var(--gold); background: rgba(240,185,11,.12); }
.x-tag--up { color: var(--up); background: rgba(14,203,129,.12); }
.x-tag--down { color: var(--down); background: rgba(246,70,93,.12); }
.x-note { padding: 10px 12px; border-radius: 10px; font-size: 12px; color: var(--muted); background: #0F131C; border: 1px solid var(--line); line-height: 1.7; }
.x-note--warn { color: #E9C46A; background: rgba(240,185,11,.07); border-color: rgba(240,185,11,.3); }
.x-note--danger { color: #FF8A98; background: rgba(246,70,93,.07); border-color: rgba(246,70,93,.35); }
.x-note--ok { color: var(--up); background: rgba(14,203,129,.07); border-color: rgba(14,203,129,.3); }
.x-pre { margin: 0; padding: 12px 14px; border-radius: 10px; background: #080A0F; border: 1px solid var(--line); font: 12px/1.65 var(--mono); color: #C9D1DE; white-space: pre-wrap; word-break: break-word; max-height: 520px; overflow: auto; }
.x-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 16px; overflow-x: auto; }
.x-subtabs button { height: 40px; padding: 0 14px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.x-subtabs button.is-on { color: var(--gold); border-bottom-color: var(--gold); }
.x-list-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 10px; background: #0F131C; border: 1px solid var(--line); }
.x-list-row + .x-list-row { margin-top: 10px; }
.x-list-row b { font-weight: 600; }
.x-list-row .x-grow { flex: 1; min-width: 0; }
.x-list-row small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.x-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--txt); }
.x-toggle input { display: none; }
.x-toggle i { width: 36px; height: 20px; border-radius: 999px; background: #2A3344; position: relative; flex: none; transition: background .2s; }
.x-toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #E6E9EF; transition: transform .2s; }
.x-toggle input:checked + i { background: var(--gold); }
.x-toggle input:checked + i::after { transform: translateX(16px); background: #0B0E14; }
.x-range { width: 100%; accent-color: var(--gold); }
.x-cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.x-tcard { display: grid; gap: 12px; }
.x-tcard__head { display: flex; align-items: center; gap: 10px; }
.x-tcard__head b { font-size: 15px; }
.x-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.x-kv div { padding: 8px 10px; border-radius: 9px; background: #0F131C; border: 1px solid var(--line); min-width: 0; }
.x-kv p { margin: 0; font-size: 12px; color: var(--muted); }
.x-kv strong { display: block; font: 600 14px/1.4 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-meta { font-size: 12px; color: var(--muted); display: grid; gap: 3px; }
.x-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.x-meta b { color: var(--txt); font-weight: 500; }
.x-rank { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 600 13px var(--mono); background: #1B2230; color: var(--muted); }
.x-rank.r1 { background: rgba(240,185,11,.18); color: var(--gold); }
.x-timeline { display: grid; gap: 12px; }
.x-tl { display: grid; grid-template-columns: 150px repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.x-tl > div { padding: 12px 14px; border-right: 1px solid #181E2A; min-width: 0; font-size: 12px; }
.x-tl > div:last-child { border-right: 0; }
.x-tl h4 { margin: 0 0 6px; font-size: 12px; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.x-tl h4 i { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-size: 12px; background: #1B2230; color: var(--muted); }
.x-tl .x-tl__time { background: #0F131C; }
.x-tl .x-tl__time b { display: block; font: 600 14px var(--mono); }
.x-tl p { margin: 0; color: #C3CAD7; line-height: 1.6; word-break: break-word; }
.x-tl .x-clip { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.x-tl.is-open .x-clip { -webkit-line-clamp: unset; }
.x-snapgrid { display: grid; grid-template-columns: auto auto; gap: 2px 10px; font: 12px var(--mono); color: #C3CAD7; }
.x-snapgrid span:nth-child(odd) { color: var(--muted); font-family: var(--ui); }
.x-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.x-filters .x-field { min-width: 150px; }
.x-pager { display: flex; justify-content: center; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }
.x-candles { position: relative; height: 560px; }
.x-candles svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.x-legend2 { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.x-legend2 i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.x-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.x-metric { padding: 14px; border-radius: 12px; background: #0F131C; border: 1px solid var(--line); }
.x-metric h3 { margin: 0 0 10px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.x-metric h3 i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.x-metric dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 12px; }
.x-metric dt { color: var(--muted); } .x-metric dd { margin: 0; font-family: var(--mono); text-align: right; }
.x-qr { width: 180px; height: 180px; padding: 10px; background: #fff; border-radius: 12px; }
.x-qr svg { width: 100%; height: 100%; }
.x-spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: x-rot .7s linear infinite; vertical-align: -2px; }
@keyframes x-rot { to { transform: rotate(360deg); } }
.x-checks { display: grid; gap: 6px; margin-top: 10px; font-size: 12px; }
.x-checks div { display: flex; gap: 8px; } .x-checks b { min-width: 72px; }
.x-dialog { max-height: calc(100vh - 40px); overflow: auto; }
.x-dialog--wide { width: 760px; max-width: calc(100vw - 32px); border-color: #2A3344; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.x-dialog--form { width: 560px; max-width: calc(100vw - 32px); border-color: #2A3344; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.x-dialog__body { display: grid; gap: 14px; margin-bottom: 20px; }
.x-dialog .x-input { margin: 0; }
.x-dec .x-dec__meta { margin-top: 6px; font-size: 12px; color: var(--muted); display: none; }
.x-dec.is-open .x-dec__meta { display: block; }
.x-dec__trader { font-size: 12px; color: var(--muted); }
.x-pill.is-bad .x-led { background: var(--down); box-shadow: 0 0 0 3px rgba(246,70,93,.18); animation: none; }
.x-pill.is-idle .x-led { background: #6B7488; box-shadow: none; animation: none; }
.x-safe.is-bad { background: rgba(246,70,93,.07); border-color: rgba(246,70,93,.3); }
.x-safe.is-bad b { color: var(--down); }
.x-safe.is-bad .x-led { background: var(--down); }
.x-bar__t i.x-bad { background: var(--down); }
.x-user { cursor: default; }
.x-logout { margin-left: auto; border: 0; background: none; color: var(--muted); padding: 6px; border-radius: 8px; }
.x-logout:hover { color: var(--txt); background: #1A2030; }
.x-empty-card { text-align: center; padding: 36px 20px; color: var(--muted); }
.x-empty-card h3 { margin: 0 0 6px; color: var(--txt); font-size: 16px; }
.x-empty-card p { margin: 0 0 14px; }
.x-steps { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* login */
.x-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(900px 500px at 70% -10%, rgba(240,185,11,.09), transparent), #0B0E14; }
.x-login__card { width: 400px; max-width: 100%; padding: 30px 28px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.5); display: grid; gap: 16px; }
.x-login__card .x-logo { padding: 0 0 4px; }
.x-login__card h2 { margin: 0; font-size: 18px; font-weight: 600; }
.x-login__card p { margin: 0; color: var(--muted); font-size: 12px; }
.x-login__err { color: var(--down); font-size: 12px; min-height: 18px; }
.x-hidden { display: none !important; }

@media (max-width: 1100px) {
  .x-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x-tl { grid-template-columns: 1fr 1fr; } .x-tl > div { border-bottom: 1px solid #181E2A; }
  .x-metrics { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .x-grid2, .x-grid3, .x-grid4 { grid-template-columns: minmax(0, 1fr); }
  .x-span2 { grid-column: auto; }
  .x-tl { grid-template-columns: 1fr; }
  .x-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .x-candles { height: 420px; }
}

/* 敏感操作二次验证弹窗（叠在普通弹窗之上） */
.x-reauth { z-index: 70; }
.x-reauth .x-dialog { border-color: rgba(240,185,11,.4); box-shadow: 0 20px 60px rgba(0,0,0,.6), 0 0 40px rgba(240,185,11,.1); }
.x-reauth .x-dialog__body { display: grid; gap: 12px; margin-bottom: 16px; }

/* ======================= 版本徽标 / 在线更新 ======================= */
.x-logo__txt { min-width: 0; display: grid; justify-items: start; }
.x-ver {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 5px; padding: 2px 8px;
  border-radius: 6px; border: 1px solid var(--line); background: #121722; color: var(--muted);
  font: 500 11px/1.5 var(--mono); text-align: left; max-width: 100%; cursor: default;
}
.x-ver:disabled { opacity: 1; }
.x-ver.is-click { cursor: pointer; transition: border-color .15s, color .15s, box-shadow .15s; }
.x-ver.is-click:hover { border-color: #46526A; color: var(--txt); }
.x-ver.is-update { border-color: rgba(240,185,11,.45); background: rgba(240,185,11,.08); color: #E9C46A; }
.x-ver.is-update.is-click:hover { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px rgba(240,185,11,.25); }
.x-ver__new { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); font-family: var(--ui); }
.x-ver__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: x-pulse 1.8s ease-in-out infinite; flex: none; }
.x-ver.is-busy .x-ver__dot { background: var(--blue); box-shadow: none; }
@keyframes x-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.x-gold { color: var(--gold); }
.x-changelog { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #0F131C; }
.x-changelog li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.x-changelog li:last-child { border-bottom: 0; }
.x-changelog code { color: var(--gold); font-size: 12px; }
.x-changelog span { overflow-wrap: anywhere; }
.x-changelog small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.x-update-prog { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.x-upinfo > div { display: grid; gap: 4px; padding: 12px; border-radius: 10px; background: #0F131C; border: 1px solid var(--line); min-width: 0; }
.x-upinfo > div > span { font-size: 12px; }
.x-upinfo b { font-size: 16px; font-weight: 600; }
.x-upinfo small { font-size: 12px; color: var(--muted); }
@media (max-width: 1000px) { .x-ver { margin-top: 2px; } .x-logo small { display: none; } }
@media (max-width: 640px) { .x-changelog li { grid-template-columns: auto minmax(0, 1fr); } .x-changelog small { display: none; } }
