:root {
  --bg: #070d18;
  --panel: #0c1424;
  --card: #10192c;
  --line: #243044;
  --txt: #e7eef8;
  --muted: #8ea0b8;
  --gold: #e6b422;
  --gold2: #f3d27a;
  --goldbg: #3a3118;
  --red: #ff4d57;
  --green: #2fce7b;
  --blue: #3b82f6;
  --ask: #e11d48;
  --side: 188px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); font: 13px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.shell { height: 100vh; display: flex; flex-direction: column; }
.top {
  min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 4px 10px;
  background: #070d18; border-bottom: 1px solid #182234; flex: none;
}
.top-main { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-width: 0; flex: 1; overflow-x: auto; overflow-y: hidden; white-space: nowrap; padding: 4px 0; }
.top-main > * { flex: none; }
.top-main::-webkit-scrollbar { height: 5px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .5px; margin-right: 6px; flex: none; }
.brand img { width: 28px; height: 28px; object-fit: contain; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: #121a2b; border: 1px solid #243044; border-radius: 999px; padding: 3px 10px; color: var(--muted); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #ff4d57; display: inline-block; }
.dot.on { background: #2fce7b; }
.top .grow { flex: 1; }
.px { font-variant-numeric: tabular-nums; font-weight: 700; color: white; border-radius: 6px; padding: 2px 8px; }
.px.bid { background: #2563eb; }
.px.ask { background: #e11d48; }
.top select, .mini {
  background: #121a2b; border: 1px solid #2a3b55; color: var(--txt); border-radius: 6px; padding: 3px 6px;
}
.metrics { color: var(--muted); white-space: nowrap; }
.metrics b { color: var(--txt); font-weight: 600; }
.btn {
  border: 1px solid var(--gold); color: var(--gold2); background: transparent; border-radius: 8px; padding: 4px 12px; white-space: nowrap;
}
.btn:hover { background: rgba(230,180,34,.12); }
.btn.red { background: #e11d48; border-color: #e11d48; color: #fff; }
.btn.red:hover { background: #be123c; }
.btn.tiny { padding: 2px 8px; border-radius: 7px; }
.btn.fill { background: var(--gold); color: #1a1404; font-weight: 700; }
.btn.fill:hover { background: var(--gold2); }
.btn.wide { width: 100%; padding: 10px 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.body { flex: 1; min-height: 0; display: flex; }
.side {
  width: var(--side); flex: none; background: #080f1c; border-right: 1px solid #182234;
  display: flex; flex-direction: column; overflow: auto;
}
.side.slim { width: 64px; }
.side.slim .lab, .side.slim .navbtn span:not(.ico), .side.slim .grp { display: none; }
.grp { color: #6d7c93; font-size: 12px; padding: 14px 16px 4px; }
.navbtn {
  width: 100%; text-align: left; background: transparent; border: 0; color: #d5deea;
  padding: 8px 14px; display: flex; gap: 8px; align-items: center; border-left: 3px solid transparent;
}
.navbtn.active { background: var(--goldbg); color: var(--gold2); border-left-color: var(--gold); }
.navbtn .ico { width: 18px; flex: none; text-align: center; font-size: 15px; line-height: 1; font-family: "Segoe UI Emoji", "Segoe UI Symbol", sans-serif; }
.sidefoot { margin-top: auto; padding: 10px; display: flex; justify-content: center; }
.collapse { width: 36px; height: 28px; border-radius: 14px; border: 1px solid #2a3b55; background: #10192c; color: var(--muted); }
.content { flex: 1; min-width: 0; min-height: 0; position: relative; }
.view { display: none; height: 100%; overflow: auto; }
.view.on { display: block; }
.view.live.on { display: block; overflow: hidden; }
.livegrid {
  height: 100%; display: grid;
  grid-template-columns: minmax(0,1fr) 292px;
  grid-template-rows: auto minmax(160px,1fr) 168px;
  gap: 10px; padding: 10px;
}
.hero { grid-column: 1; grid-row: 1; }
.chartcard { grid-column: 1; grid-row: 2; }
.bots { grid-column: 1; grid-row: 3; }
.rail { grid-column: 2; grid-row: 1 / span 3; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.hero { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 12px; padding: 12px; }
.bull {
  background: #05080f; border-radius: 10px; min-height: 168px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; border: 1px solid #1b2638;
}
.bull img { width: 92px; height: 92px; object-fit: contain; }
.play {
  border: 0; background: transparent; color: #fff; font-size: 18px; display: flex; align-items: center; gap: 8px;
}
.play.running { color: #ff6b73; }
.play .ic { width: 18px; height: 18px; margin-right: 0; }
.ic { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; flex: none; }
.collapse .ic { margin-right: 0; vertical-align: middle; }
.btn.on { border-color: var(--gold); color: var(--gold); }
.meta { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; color: var(--muted); }
.meta-row b { color: var(--txt); font-weight: 650; }
.summary {
  color: #d5deea; min-height: 36px; max-height: 40px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.chartcard { min-height: 0; display: flex; flex-direction: column; padding: 8px 10px 10px; position: relative; }
.chartcard.fs { position: fixed; inset: 8px; z-index: 40; }
.toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.tfs { display: flex; gap: 4px; }
.tfs button, .chips button {
  border: 1px solid #2a3b55; background: #0e1728; color: #d5deea; border-radius: 6px; padding: 2px 8px;
}
.tfs button.on, .chips button.on { border-color: var(--gold); color: var(--gold2); }
.checks { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.checks label { display: flex; gap: 4px; align-items: center; }
.chartbox { position: relative; flex: 1; min-height: 0; border-radius: 8px; overflow: hidden; background: #0c1424; }
.chartbox canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.chart-label { position: absolute; right: 74px; top: 8px; color: #9aabC2; font-size: 12px; }
.bots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 0; }
.bot { padding: 10px 12px; overflow: auto; }
.bot h3 { margin: 0 0 6px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bot p { margin: 3px 0; color: #d5deea; }
.bot .muted, .muted { color: var(--muted); }
.barline { height: 3px; background: #243044; border-radius: 2px; margin: 6px 0; }
.barline i { display: block; height: 100%; width: 0; background: var(--gold); }
.rail { min-height: 0; display: flex; flex-direction: column; padding: 10px; }
.railhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.railhead h2 { margin: 0; font-size: 16px; }
.chips { display: flex; gap: 4px; margin-bottom: 8px; }
.siglist { overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.sig { background: #0c1424; border-radius: 8px; padding: 8px 10px; }
.sigtop { display: flex; justify-content: space-between; align-items: baseline; }
.sell { color: var(--red); font-weight: 800; letter-spacing: .4px; }
.buy { color: var(--green); font-weight: 800; }
.hold { color: var(--gold2); font-weight: 700; }
.up { color: #ff5d6c; }
.down { color: #2fce7b; }
.page { padding: 16px 18px 28px; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.pagehead h2 { margin: 0; font-size: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.form label, .stack label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.form .wide, .stack .wide { grid-column: 1 / -1; }
.form.one { grid-template-columns: minmax(0, 1fr); }
#formConnect { width: min(400px, calc(100vw - 32px)); }

/* 新订单 */
.toolbar .neworder { border-color: var(--gold); color: var(--gold2); background: rgba(230,180,34,.1); }
.toolbar .neworder:hover { background: rgba(230,180,34,.18); }
#formOrder, #formModify { width: min(380px, calc(100vw - 32px)); }
.dock-body tr[data-row] { cursor: default; }
.dock-body tr[data-row]:hover td, .dock-body tr.sel td { background: #121c30; }
.stepper { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px; }
.stepper input { text-align: center; border-radius: 0; font-variant-numeric: tabular-nums; }
.stepper button { border: 1px solid #2a3b55; background: #0e1728; color: #d5deea; font-size: 18px; cursor: pointer; }
.stepper button:first-child { border-radius: 8px 0 0 8px; border-right: 0; }
.stepper button:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.stepper button:hover { background: #15213a; }
.o-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.o-pair label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 12px; }
.o-note { margin: 0; font-size: 12px; line-height: 1.5; }
.o-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.o-btns button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border: 0; border-radius: 10px; color: #fff; cursor: pointer; font-size: 13px; }
.o-btns b { font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.o-btns .o-sell { background: linear-gradient(180deg, #e5484d, #c4343a); }
.o-btns .o-buy { background: linear-gradient(180deg, #2f7cf6, #1f62d0); }
.o-btns button:hover:not(:disabled) { filter: brightness(1.08); }
.o-btns.o-pend { grid-template-columns: 1fr; }
.o-btns .o-place.buy { background: linear-gradient(180deg, #2f7cf6, #1f62d0); }
.o-btns .o-place.sell { background: linear-gradient(180deg, #e5484d, #c4343a); }
.o-btns .o-place b { font-size: 15px; }
.o-btns.hidden, .o-pair.hidden, label.hidden { display: none; }
.o-kind { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 12px; border: 1px solid #2a3b55; border-radius: 9px; overflow: hidden; }
.o-kind button { height: 32px; border: 0; background: #0e1728; color: var(--muted); font-size: 13px; cursor: pointer; }
.o-kind button + button { border-left: 1px solid #2a3b55; }
.o-kind button.on { background: rgba(230,180,34,.12); color: var(--gold2); font-weight: 600; }
.dock-sub { padding: 8px 10px 4px; color: var(--muted); font-size: 12px; border-top: 1px solid #1b2638; }

/* K 线右键菜单 */
.ctxmenu { position: fixed; z-index: 80; min-width: 200px; padding: 4px; background: #121c30; border: 1px solid #2a3b55; border-radius: 9px; box-shadow: 0 18px 44px rgba(0,0,0,.5); font-size: 13px; }
.ctxmenu.hidden { display: none; }
.ctx-item { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 10px 0 6px; border: 0; border-radius: 6px; background: none; color: #d5deea; text-align: left; cursor: pointer; white-space: nowrap; font-size: 13px; user-select: none; box-sizing: border-box; }
.ctx-item:hover, .ctx-item.open { background: rgba(230,180,34,.12); color: #fff; }
.ctx-item.buy .ctx-lbl { color: #7fb0ff; }
.ctx-item.sell .ctx-lbl { color: #ff8f94; }
.ctx-item.dim { opacity: .45; cursor: default; }
.ctx-ico { display: grid; place-items: center; width: 18px; height: 18px; color: var(--gold2); flex: none; }
.ctx-ico .ic { width: 14px; height: 14px; margin: 0; }
.ctx-lbl { flex: 1; }
.ctx-arrow { color: var(--muted); }
.ctx-sep { height: 1px; margin: 4px 6px; background: #22314a; }
.ctx-sub { display: none; position: absolute; left: 100%; top: -5px; min-width: 150px; padding: 4px; background: #121c30; border: 1px solid #2a3b55; border-radius: 9px; box-shadow: 0 18px 44px rgba(0,0,0,.5); }
.ctxmenu.flip .ctx-sub { left: auto; right: 100%; }
.ctx-item.has-sub:hover > .ctx-sub, .ctx-item.open > .ctx-sub { display: block; }
@media (max-width: 760px) {
  /* 手机上子菜单直接展开在下方 */
  .ctx-item.has-sub { flex-wrap: wrap; height: auto; min-height: 34px; }
  .ctx-item { height: 34px; }
  .ctx-sub, .ctxmenu.flip .ctx-sub { position: static; flex-basis: 100%; margin: 2px 0 4px; box-shadow: none; }
  .ctx-item.has-sub:hover > .ctx-sub { display: none; }
  .ctx-item.open > .ctx-sub { display: block; }
}
.o-btns button:disabled { opacity: .55; cursor: wait; }

/* K 线下方：持仓明细 / 历史订单 */
/* 卡片不高时面板让出空间：K 线至少留一半高度，面板最少 3 行左右，多出的滚动 */
.dock { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; margin-top: 8px; }
.chartcard:has(.dock-body:not(.hidden)) .chartbox { min-height: max(160px, 50%); }
.dock-bar { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.dock-tab { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid #2a3b55; border-radius: 7px; background: #0e1728; color: #d5deea; font-size: 12px; cursor: pointer; flex: none; }
.dock-tab .ic { width: 14px; height: 14px; margin: 0; }
.dock-tab:hover { border-color: #3a4f70; }
.dock-tab.on { border-color: var(--gold); color: var(--gold2); background: rgba(230,180,34,.08); }
.dock-tab .cnt { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #1a1405; font-size: 11px; line-height: 18px; text-align: center; }
.dock-range { display: inline-flex; margin-left: 6px; border: 1px solid #2a3b55; border-radius: 7px; overflow: hidden; flex: none; }
.dock-range button { height: 26px; padding: 0 9px; border: 0; background: #0e1728; color: var(--muted); font-size: 12px; cursor: pointer; }
.dock-range button + button { border-left: 1px solid #2a3b55; }
.dock-range button.on { color: var(--gold2); background: rgba(230,180,34,.1); }
.dock-sum { flex: 1; min-width: 0; text-align: right; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-batch { display: inline-flex; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.dock-batch.hidden { display: none; }
.dock-batch button { height: 26px; padding: 0 10px; border: 1px solid rgba(255,90,90,.35); border-radius: 7px; background: rgba(255,90,90,.06); color: #ff9b9b; font-size: 12px; cursor: pointer; white-space: nowrap; }
.dock-batch button:hover:not(:disabled) { background: rgba(255,90,90,.16); color: #ffc1c1; }
.dock-batch button:disabled { opacity: .38; cursor: not-allowed; }
.dock-bar .dlg-x { margin-left: auto; flex: none; }
.dock-batch:not(.hidden) ~ .dlg-x { margin-left: 0; }
.dock-sum + .dlg-x { margin-left: 0; }
.dock-body { margin-top: 6px; flex: 0 1 220px; min-height: 96px; overflow: auto; border: 1px solid #1b2638; border-radius: 8px; background: #0c1424; }
.dock-body > div > .muted { padding: 14px 12px; }
.dock-body table { font-size: 12px; }
.dock-body th, .dock-body td { padding: 6px 10px; white-space: nowrap; }
.chartcard.fs .dock-body { flex-basis: 260px; }
@media (max-width: 760px) {
  .dock-bar { flex-wrap: wrap; row-gap: 6px; }
  .dock-sum { order: 5; flex-basis: 100%; text-align: left; }
  .dock-range { margin-left: 0; }
  .dock-batch { order: 5; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; margin-left: 0; scrollbar-width: none; gap: 5px; }
  .dock-batch button { flex: 1 0 auto; padding: 0 7px; }
  /* 面板展开时卡片随内容变高，K 线保持原来的高度 */
  .chartcard:has(.dock-body:not(.hidden)):not(.fs) { height: auto; max-height: none; }
  .chartcard:has(.dock-body:not(.hidden)):not(.fs) .chartbox { flex: none; height: min(46dvh, 420px); }
  .dock-body { flex: none; height: 220px; }
}
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.dialog .dlg-head h3 { margin: 0; line-height: 28px; }
.dlg-x { display: grid; place-items: center; width: 28px; height: 28px; margin-right: -4px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.dlg-x:hover { background: rgba(255,255,255,.06); color: var(--txt); }
input, select, textarea {
  background: #0c1424; border: 1px solid #2a3b55; border-radius: 8px; padding: 7px 8px; outline: none;
}
textarea { min-height: 180px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
.check { flex-direction: row !important; align-items: center; gap: 6px !important; color: var(--txt) !important; }
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid #1b2638; text-align: left; vertical-align: top; }
th { background: #121a2e; color: var(--muted); font-weight: 600; position: sticky; top: 0; }
.note { color: #c5d0e0; font-size: 12px; line-height: 1.55; max-width: 460px; }
.split { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 12px; min-height: 420px; }
.listbtn { width: 100%; text-align: left; background: #0c1424; border: 1px solid #243044; border-radius: 8px; padding: 8px; margin-bottom: 6px; }
.listbtn.on { border-color: var(--gold); color: var(--gold2); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.stat { padding: 12px; }
.stat b { display: block; font-size: 20px; margin-top: 4px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 50;
}
.ecbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 10px; }
.ecgroup { display: flex; flex-wrap: wrap; gap: 4px; }
.ecgroup .btn.on { background: var(--gold); color: #1a1404; }
.ecbar input, .ecbar select { background: #121a2b; border: 1px solid #2a3b55; color: var(--txt); border-radius: 6px; padding: 3px 6px; }
.ecnext { margin-bottom: 10px; padding: 8px 12px; }
.ectable tr.ecday td { background: #121a2b; color: var(--gold2); font-weight: 600; }
.ectable tr.ecrow { cursor: pointer; }
.ectable tr.ecrow:hover td { background: #121c30; }
.ectable tr.past td { opacity: .55; }
.ectable tr.soon td { background: rgba(230,180,34,.12); }
.imp3 { color: var(--red); }
.imp2 { color: var(--gold); }
.imp1, .imp0 { color: var(--muted); }
.codeline { display: flex; gap: 8px; align-items: stretch; }
.codeline input { flex: 1; min-width: 0; }
.srvpick { position: relative; display: block; }
.srvlist { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 70; max-height: 240px; overflow: auto; background: #0c1424; border: 1px solid #2a3b55; border-radius: 8px; padding: 4px; display: block; }
.srvlist .grouphead { padding: 6px 8px 2px; color: var(--muted); font-size: 12px; }
.srvlist button { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--txt); padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.srvlist button:hover { background: rgba(230,180,34,.14); color: var(--gold2); }
.srvlist .srvmsg { padding: 6px 8px; color: var(--muted); font-size: 12px; }
.pwd-wrap { position: relative; display: block; width: 100%; }
.pwd-wrap input { width: 100%; padding-right: 38px; box-sizing: border-box; }
.pwd-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px 6px; line-height: 1; border-radius: 6px; }
.pwd-toggle:hover, .pwd-toggle:focus-visible { color: var(--gold2); background: rgba(230,180,34,.12); outline: none; }
.pwd-toggle svg { display: block; width: 18px; height: 18px; }
/* 登录 / 注册 / 修改密码 */
.overlay.gate { background: radial-gradient(ellipse at 50% 30%, rgba(230,180,34,.10), transparent 60%), rgba(3,6,12,.78); }
.dialog.gatebox { width: min(360px, calc(100vw - 32px)); padding: 24px 24px 18px; border-radius: 16px; background: linear-gradient(180deg, #121d33, #0d1626); border-color: #26344d; }
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.gate-brand img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(230,180,34,.35)); }
.gate-brand b { display: block; font-size: 18px; letter-spacing: .5px; background: linear-gradient(90deg, #f6dd8c, #e6b422); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate-brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.gate-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #0a1220; border: 1px solid #1f2b40; border-radius: 10px; padding: 3px; margin-bottom: 18px; }
.gate-tabs button { border: 0; background: transparent; color: var(--muted); padding: 7px 0; border-radius: 8px; font-weight: 600; transition: background-color .15s, color .15s; }
.gate-tabs button:hover { color: var(--txt); }
.gate-tabs button.on { background: #1a2740; color: var(--gold2); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 2px 8px rgba(0,0,0,.25); }
.gate-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.gate-head h3 { margin: 0; font-size: 16px; }
.gate-back { border: 1px solid #2a3b55; background: transparent; color: var(--muted); width: 28px; height: 28px; border-radius: 8px; font-size: 18px; line-height: 1; }
.gate-back:hover { color: var(--gold2); border-color: var(--gold); }
.gate-panel { display: flex; flex-direction: column; gap: 14px; }
.gate-panel.hidden { display: none; }
.gate-panel > label { display: flex; flex-direction: column; gap: 6px; color: #aab7ca; font-size: 12px; }
.gate-panel input { padding: 10px 12px; border-radius: 10px; background: #0a1220; font-size: 14px; }
.gate-panel .codeline .btn { border-radius: 10px; padding: 0 12px; min-width: 96px; }
.gate-links { display: flex; justify-content: space-between; margin-top: -6px; }
.gate-submit { width: 100%; padding: 11px 12px; border-radius: 10px; font-size: 15px; margin-top: 4px; letter-spacing: .5px; box-shadow: 0 8px 20px rgba(230,180,34,.18); }
.gate-submit:disabled { opacity: .7; box-shadow: none; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; }
.linkbtn:hover { color: var(--gold2); }
.gate-err { margin: 12px 0 0; min-height: 0; font-size: 12px; color: #ffb3b8; }
.gate-err:not(:empty) { padding: 8px 10px; border-radius: 8px; background: rgba(255,77,87,.1); border: 1px solid rgba(255,77,87,.3); }
.gatebox { position: relative; }
.gate-close { position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
.gate-close:hover { background: rgba(255,255,255,.06); color: var(--txt); }
.overlay.confirm { z-index: 60; }
.confirmbox { width: min(420px, calc(100vw - 32px)); }
.confirmbox h3 { margin: 0 0 10px; }
.confirmbox p { margin: 0; line-height: 1.6; white-space: pre-line; }
.dialog { width: min(560px, calc(100vw - 32px)); background: #10192c; border: 1px solid #2a3b55; border-radius: 12px; padding: 14px; }
.dialog h3 { margin: 0 0 10px; }
.dialog .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.pop { position: absolute; z-index: 5; top: 42px; left: 10px; width: min(640px, 80%); background: #10192c; border: 1px solid #2a3b55; border-radius: 10px; padding: 8px; max-height: 240px; overflow: auto; }
#toast {
  position: fixed; right: 16px; bottom: 16px; z-index: 70; display: flex; flex-direction: column; gap: 6px;
}
.toast { background: #1b2436; border: 1px solid var(--gold); color: var(--txt); padding: 8px 12px; border-radius: 8px; }
.about { max-width: 760px; color: #d5deea; line-height: 1.7; }
.about h2 { color: white; }
kbd { border: 1px solid #2a3b55; border-radius: 4px; padding: 0 4px; }
.model-card { padding: 14px 16px; margin-bottom: 12px; }
.model-card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.model-card .form { max-width: 320px; grid-template-columns: 1fr; }
.model-card .form.wide3 { max-width: none; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.model-card .row { display: flex; gap: 18px; flex-wrap: wrap; }
.acct-row { display: grid; grid-template-columns: 1.1fr 1fr 1.15fr .9fr auto; gap: 10px; margin-bottom: 12px; }
.acct-card { padding: 14px; min-height: 132px; }
.acct-card .who { font-size: 22px; font-weight: 700; margin: 8px 0 6px; }
.acct-card .vip { color: var(--gold2); font-weight: 700; }
.acct-card .pts { font-size: 22px; font-weight: 700; margin: 6px 0 10px; }
.acct-card .pts.neg { color: var(--red); }
.acct-card .pts.pos { color: var(--gold2); }
.price-line, .vip-line { margin: 4px 0; color: #d5deea; }
.vip-line { background: none; border: 0; color: #d5deea; padding: 0; cursor: pointer; display: block; text-align: left; }
.vip-line b { color: var(--gold2); font-weight: 700; }
.acct-actions { display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.billhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.billfilters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.billfilters label { color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.billfilters input, .billfilters select { width: 160px; }
.pager { display: flex; justify-content: flex-end; gap: 8px; align-items: center; margin-top: 8px; color: var(--muted); }
.paydlg { width: min(420px, calc(100vw - 32px)); }
.paypresets { display: flex; gap: 8px; margin: 8px 0; }
.paypresets .btn { flex: 1; }
.paygot { color: var(--gold2); font-weight: 700; margin: 8px 0; }
/* ---------- 统一视觉层：滚动条、数字、交互状态、层次 ---------- */
:root { --card2: #0e1728; --ring: rgba(230,180,34,.45); --ease: cubic-bezier(.2,.7,.2,1); }
* { scrollbar-width: thin; scrollbar-color: rgba(142,160,184,.28) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(142,160,184,.22); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(230,180,34,.55); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
::selection { background: rgba(230,180,34,.35); color: #fff; }

/* 价格、盈亏、表格数字等宽对齐，刷新时不跳动 */
td, .metrics b, .px, .stat b, .sig, .acct-card .pts, #mCd, #monCd, .pager span { font-variant-numeric: tabular-nums; }

.btn, .navbtn, .tfs button, .chips button, .listbtn, .collapse, input, select, textarea, .card, .vip-line {
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
input:hover, select:hover, textarea:hover { border-color: #3a4d6b; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(230,180,34,.14); }
input::placeholder, textarea::placeholder { color: #5f6f86; }
.btn:active:not(:disabled) { transform: translateY(1px); }

/* 顶栏 */
.top { background: linear-gradient(180deg, #0a1222, #070d18); box-shadow: 0 1px 0 rgba(255,255,255,.02), 0 6px 18px rgba(0,0,0,.25); position: relative; z-index: 2; }
.brand span { background: linear-gradient(90deg, #f6dd8c, #e6b422); -webkit-background-clip: text; background-clip: text; color: transparent; }
.px { box-shadow: inset 0 -1px 0 rgba(0,0,0,.2); min-width: 72px; text-align: center; }

/* 侧栏 */
.side { background: linear-gradient(180deg, #091121, #070d18); }
.grp { font-size: 11px; letter-spacing: .08em; color: #5d6c83; padding: 16px 16px 6px; }
.navbtn { margin: 1px 8px; width: calc(100% - 16px); border-radius: 8px; border-left: 0; padding: 7px 10px; color: #b9c5d6; position: relative; }
.navbtn:hover { background: rgba(255,255,255,.04); color: #e7eef8; }
.navbtn.active { background: linear-gradient(90deg, rgba(230,180,34,.18), rgba(230,180,34,.04)); color: var(--gold2); }
.navbtn.active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.navbtn .ico { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; opacity: .85; }
.navbtn .ico .ic { width: 17px; height: 17px; margin: 0; }
.navbtn.active .ico { opacity: 1; }
.side.slim .navbtn { justify-content: center; padding: 9px 0; }
.collapse:hover { border-color: var(--gold); color: var(--gold2); }

/* 卡片层次 */
.card { background: linear-gradient(180deg, #111c31, var(--card2)); border-color: #1f2b40; box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 8px 24px rgba(0,0,0,.18); }
.bull { background: radial-gradient(ellipse at 50% 35%, rgba(230,180,34,.12), transparent 65%), #05080f; }
.chartbox { background: #0a1220; border: 1px solid #172236; }
.sig { background: #0b1322; border: 1px solid #172236; transition: border-color .15s var(--ease); }
.sig:hover { border-color: #2a3b55; }
.tfs button:hover, .chips button:hover { border-color: #3a4d6b; color: #fff; }
.tfs button.on, .chips button.on { background: rgba(230,180,34,.12); }

/* 表格 */
.tablewrap { background: #0b1322; border-color: #1c2840; }
th { font-size: 12px; letter-spacing: .02em; background: #101a2d; border-bottom-color: #22304a; z-index: 1; }
tbody tr:hover td { background: rgba(255,255,255,.025); }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 弹窗与提示 */
.overlay { background: rgba(3,6,12,.62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeIn .15s var(--ease); }
.dialog { box-shadow: 0 24px 60px rgba(0,0,0,.5); border-color: #2a3b55; animation: popIn .18s var(--ease); }
.toast { background: rgba(20,29,46,.96); border: 1px solid #2a3b55; border-left: 3px solid var(--gold); box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: slideIn .2s var(--ease); max-width: 360px; }
.pop, .srvlist { box-shadow: 0 16px 40px rgba(0,0,0,.45); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(12px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1100px) {
  .acct-row, .model-card .form.wide3 { grid-template-columns: 1fr; }
  .livegrid { grid-template-columns: 1fr; grid-template-rows: none; overflow: auto; height: auto; }
  .hero, .chartcard, .bots, .rail { grid-column: 1; grid-row: auto; }
  .chartcard { min-height: 420px; }
  .rail { max-height: 480px; }
  .hero { grid-template-columns: 1fr; }
  .form, .grid2, .split { grid-template-columns: 1fr; }
}

/* 顶部：交易账号连接状态和账号合成一组；右上角用户菜单 */
.acct-chip { display: flex; align-items: center; flex: none; border: 1px solid #243044; border-radius: 8px; background: #0e1626; overflow: hidden; }
.acct-chip .btn { border: 0; border-radius: 0; padding: 4px 10px; align-self: stretch; }
.acct-chip .btn.ok { color: #2fce7b; background: rgba(47,206,123,.1); border-right: 1px solid #243044; }
.acct-chip .btn.ok:hover { background: rgba(47,206,123,.18); }
.acct-chip .metrics { padding: 0 10px; }
.usermenu { position: relative; flex: none; }
.userbtn { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px 0 6px; border-radius: 999px; border: 1px solid #2a3b55; background: #10192c; color: var(--txt); }
.userbtn:hover, .userbtn[aria-expanded="true"] { border-color: var(--gold); color: var(--gold2); }
.userbtn .ico { width: 20px; height: 20px; border-radius: 50%; background: #1b2740; display: grid; place-items: center; }
.userbtn .ico .ic, .userbtn .caret .ic { margin: 0; width: 13px; height: 13px; }
.userbtn .caret { display: flex; color: var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; padding: 6px; border-radius: 10px; background: #0d1527; border: 1px solid #243044; box-shadow: 0 12px 32px rgba(0,0,0,.45); z-index: 50; animation: popIn .12s ease-out; }
.menuhead { padding: 8px 10px 10px; border-bottom: 1px solid #1c2840; margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.menuhead b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.menuhead span { color: var(--muted); font-size: 12px; }
.menuitem { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--txt); text-align: left; }
.menuitem .ic { margin: 0; width: 15px; height: 15px; color: var(--muted); }
.menuitem:hover { background: #16213a; }
.menuitem.active { color: var(--gold2); }
.menuitem.active .ic { color: var(--gold2); }
.menuitem.danger { color: #ff6b74; }
.menuitem.danger .ic { color: #ff6b74; }
.menusep { height: 1px; background: #1c2840; margin: 4px 2px; }
#userLabel { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 品牌区动画：canvas 垫在标志和按钮下面 */
.bull { position: relative; overflow: hidden; }
.bull .fountain { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.bull img, .bull .play { position: relative; z-index: 1; }
.bull img { filter: drop-shadow(0 4px 14px rgba(242,196,67,.35)); }

/* 开始 / 停止下单：金色胶囊按钮，运行中换成红色描边并带呼吸点 */
.bull { gap: 16px; padding: 18px 0 16px; }
.bull .play {
  margin-top: 4px; min-width: 132px; height: 36px; padding: 0 20px; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600; letter-spacing: 2px; border-radius: 999px;
  color: #1a1404; background: linear-gradient(180deg, #ffe08a, #e6b422 55%, #c8940f);
  border: 1px solid rgba(255,236,160,.7);
  box-shadow: 0 4px 16px rgba(230,180,34,.35), inset 0 1px 0 rgba(255,255,255,.45);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.bull .play:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 6px 22px rgba(230,180,34,.5), inset 0 1px 0 rgba(255,255,255,.45); }
.bull .play:active { transform: translateY(0); }
.bull .play .ic { width: 13px; height: 13px; }
.bull .play.running {
  color: #ff8a90; background: rgba(225,29,72,.12); border-color: rgba(255,107,115,.6);
  box-shadow: 0 0 0 1px rgba(225,29,72,.15), 0 4px 18px rgba(225,29,72,.25);
}
.bull .play.running:hover { background: rgba(225,29,72,.2); }
.bull .play.running .ic { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }

/* 右侧日历悬停详情：浮在卡片左边，配色同 K 线详情框 */
.railtip { position: fixed; z-index: 60; width: 230px; padding: 10px 12px; border-radius: 6px; background: rgba(10,16,28,.95); border: 1px solid rgba(230,180,34,.85); box-shadow: 0 10px 28px rgba(0,0,0,.45); font-size: 12px; color: #d5deea; pointer-events: none; font-variant-numeric: tabular-nums; }
.railtip .rt-time { color: #e7eef8; margin-bottom: 6px; }
.railtip .rt-row { display: flex; justify-content: space-between; line-height: 20px; }
.railtip .rt-row span, .railtip .rt-grid span { color: #9aabc2; }
.railtip .rt-grid { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 3px 10px; margin-top: 6px; padding-top: 6px; border-top: 1px solid #1c2840; }
.railtip .rt-grid span.cur { color: var(--gold2); }
.railtip .rt-sum { margin-top: 6px; padding-top: 6px; border-top: 1px solid #1c2840; color: #9aabc2; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* 悬停详情的周期：分两列从上往下排，当前周期用底色标出 */
.railtip .rt-grid { grid-template-columns: 1fr 1fr; grid-auto-flow: column; gap: 3px 8px; }
.railtip .rt-tf { display: flex; justify-content: space-between; padding: 2px 6px; border-radius: 4px; }
.railtip .rt-tf.cur { background: rgba(230,180,34,.16); box-shadow: inset 0 0 0 1px rgba(230,180,34,.45); }
.railtip .rt-tf.cur span { color: var(--gold2); }
/* 电脑上动画区和右边文字一样高：缩小标志和按钮，高度跟着右边内容走 */
/* 按钮贴底，标志在上方剩余空间里居中，外圈动画不被按钮挡住 */
.bull { min-height: 0; padding: 0 0 10px; gap: 0; justify-content: flex-start; }
.bull img { width: 64px; height: 64px; margin: auto 0; }
.bull .play { margin-top: 0; height: 32px; min-width: 120px; padding: 0 18px; font-size: 13px; }
.bull .play .ic { width: 11px; height: 11px; }

/* 多模型协同 */
.ensmodes { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 10px; }
.ensmode { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid #22304a; border-radius: 8px; background: #0b1322; cursor: pointer; transition: border-color .15s, background .15s; }
.ensmode input { display: none; }
.ensmode b { font-size: 13px; }
.ensmode span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.ensmode:hover { border-color: #2f4262; }
.ensmode.on { border-color: var(--gold); background: rgba(230,180,34,.08); }
.ensmode.on b { color: var(--gold2); }
@media (max-width: 1100px) { .ensmodes { grid-template-columns: 1fr; } }
.votecard { padding: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.vote { display: grid; grid-template-columns: 140px 90px minmax(0,1fr); gap: 10px; align-items: baseline; font-size: 13px; }
.vote span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote em { font-style: normal; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.railtip .rt-votes { margin-top: 6px; padding-top: 6px; border-top: 1px solid #1c2840; }
.railtip .rt-vh { color: #9aabc2; margin-bottom: 2px; }
.railtip .vote { grid-template-columns: minmax(0,1fr) auto; font-size: 12px; line-height: 20px; }

/* ---------- 手机端（≤760px）：底部标签栏、两行顶栏、单列内容、底部弹出的对话框 ---------- */
.tabbar, .sidemask, .sidehead { display: none; }
.chartbox canvas { touch-action: pan-y; }
@media (max-width: 760px) {
  html, body { font-size: 14px; }
  .shell { height: 100vh; height: 100dvh; }
  /* iOS 输入框字号小于 16px 会自动放大页面 */
  input, select, textarea { font-size: 16px; }

  /* 顶栏：第一行 标志 + 账号 + 操作，第二行 行情横向滑动 */
  .top { flex-wrap: wrap; gap: 6px 8px; padding: calc(6px + env(safe-area-inset-top)) 12px 0; }
  .brand { margin-right: 0; }
  .brand span { display: none; }
  .acct-chip { min-width: 0; flex: 1 1 0; max-width: max-content; }
  .acct-chip .metrics { overflow: hidden; text-overflow: ellipsis; min-width: 0; padding: 0 8px; }
  .acct-chip .btn { padding: 6px 10px; }
  .top-actions { gap: 6px; }
  #btnPause { width: 34px; height: 32px; padding: 0; display: grid; place-items: center; }
  #btnPause > span { display: none; }
  #btnPause .ic { margin: 0; }
  .userbtn { height: 32px; }
  #userLabel { max-width: 64px; }
  .top-main { order: 10; flex: 1 0 100%; margin: 0 -12px; padding: 6px 12px 8px; border-top: 1px solid #142036; scrollbar-width: none; }
  .top-main::-webkit-scrollbar { display: none; }
  .menuitem { padding: 11px 12px; }

  /* 侧栏收进「更多」：从底部滑出 */
  .side, .side.slim {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 45; width: auto; max-height: 78dvh;
    border-right: 0; border-top: 1px solid #22304a; border-radius: 16px 16px 0 0;
    padding: 4px 4px calc(64px + env(safe-area-inset-bottom));
    transform: translateY(105%); transition: transform .22s var(--ease); box-shadow: 0 -16px 40px rgba(0,0,0,.45);
    display: grid; grid-template-columns: 1fr 1fr; align-content: start;
  }
  .side.open { transform: none; }
  .side .sidehead { display: block; grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 12px; padding: 12px 0 0; }
  .side .sidehead::before { content: ""; display: block; width: 36px; height: 4px; border-radius: 2px; background: #2a3b55; margin: 0 auto 10px; }
  .side .grp, .side.slim .grp { display: block; grid-column: 1 / -1; padding: 12px 12px 4px; }
  .side .navbtn, .side.slim .navbtn { margin: 2px 4px; width: auto; padding: 11px 12px; justify-content: flex-start; background: #0e1728; border: 1px solid #1c2840; }
  .side.slim .navbtn span:not(.ico) { display: inline; }
  .side .navbtn.active::before { display: none; }
  .side .navbtn.active { border-color: rgba(230,180,34,.5); }
  .sidefoot { display: none; }
  .sidemask { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(3,6,12,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidemask.on { opacity: 1; pointer-events: auto; }

  .tabbar {
    display: flex; flex: none; position: relative; z-index: 46; background: rgba(8,13,25,.97); border-top: 1px solid #1c2840;
    padding: 4px 4px env(safe-area-inset-bottom); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 5px; border: 0; background: none; color: #7f8fa6; font-size: 11px; -webkit-tap-highlight-color: transparent; }
  .tab .ico { display: grid; place-items: center; width: 24px; height: 24px; }
  .tab .ic { width: 21px; height: 21px; margin: 0; }
  .tab.active { color: var(--gold2); }

  /* 实时面板：单列滚动，顺序为 下单区 → K 线 → 多空日历 → 风控和持仓 */
  .view.live.on { overflow: auto; -webkit-overflow-scrolling: touch; }
  .livegrid { grid-template-columns: minmax(0,1fr); gap: 10px; padding: 10px; }
  .hero { order: 1; padding: 10px; gap: 10px; }
  .chartcard { order: 2; height: 64dvh; min-height: 340px; max-height: 560px; padding: 8px; }
  .rail { order: 3; max-height: 420px; }
  .bots { order: 4; grid-template-columns: 1fr; }
  .bull { min-height: 0; padding: 34px 0 8px; gap: 10px; }
  .bull img { width: 72px; height: 72px; }
  .bull .play { margin-top: 16px; height: 32px; min-width: 112px; padding: 0 16px; font-size: 13px; letter-spacing: 1px; }
  .bull .play .ic { width: 11px; height: 11px; }
  .meta { gap: 6px; }
  .meta-row { gap: 6px 14px; }
  .meta > .meta-row:not(:last-child) { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
  .meta > .meta-row:not(:last-child) .btn { justify-self: start; }
  .meta-row .btn.tiny { padding: 5px 12px; }
  .summary { max-height: none; -webkit-line-clamp: 3; }
  .toolbar, .checks { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -8px 6px; padding: 0 8px; }
  .toolbar::-webkit-scrollbar, .checks::-webkit-scrollbar { display: none; }
  .toolbar > *, .checks > * { flex: none; }
  .toolbar .grow { display: none; }
  .toolbar .btn.tiny { padding: 5px 10px; }
  .tfs button { padding: 5px 10px; }
  .checks label { white-space: nowrap; padding: 2px 0; }
  .chart-label { right: 64px; }
  .chartcard.fs { inset: 0; border-radius: 0; height: auto; max-height: none; padding-top: calc(8px + env(safe-area-inset-top)); }
  /* 设了横向滚动的条在纵向 flex 里会被压扁，固定高度不参与收缩 */
  .chips { overflow-x: auto; scrollbar-width: none; flex: none; padding-bottom: 2px; }
  .toolbar, .checks { flex: none; }
  .chips button { flex: none; padding: 5px 10px; }
  .railtip { width: min(260px, calc(100vw - 24px)); }
  .pop { width: calc(100% - 20px); }

  /* 普通页面 */
  .page { padding: 12px 12px 24px; }
  .pagehead { flex-wrap: wrap; }
  th, td { padding: 8px; }
  th, td:not(:last-child) { white-space: nowrap; }
  .pagehead h2 { font-size: 18px; }
  .btn { padding: 7px 14px; }
  .btn.tiny { padding: 4px 10px; }
  .billfilters label { flex: 1 1 140px; }
  .billfilters input, .billfilters select { width: 100%; }
  .cards { grid-template-columns: 1fr 1fr; }
  .model-card { padding: 12px; }
  .vote { grid-template-columns: minmax(0,1fr) auto; }
  .vote em { grid-column: 1 / -1; white-space: normal; }
  .paypresets { flex-wrap: wrap; }
  .paypresets .btn { flex: 1 1 40%; }

  /* 对话框从底部弹出；登录框保持居中 */
  .overlay:not(.gate) { align-items: flex-end; }
  .overlay:not(.gate) > .dialog {
    width: 100% !important; max-height: 90dvh; overflow: auto; border-radius: 16px 16px 0 0; border-bottom: 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: sheetUp .22s var(--ease);
  }
  .overlay:not(.gate) .dialog .row .btn { flex: 1; padding: 10px 12px; }

  #toast { left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); align-items: center; }
  .toast { max-width: 100%; }
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }

/* 重置 / 修改密码标题：.dialog h3 的下边距会把标题顶高，和返回键对不齐 */
.dialog .gate-head h3 { margin: 0; line-height: 28px; }
.gate-back { display: grid; place-items: center; padding: 0; flex: none; }
.gate-back .ic { width: 16px; height: 16px; margin: 0; }

/* 交易账号连接中断、自动重连中 */
.acct-chip .btn.wait { color: #f3d27a; background: rgba(230,180,34,.12); border-right: 1px solid #243044; }
.acct-chip .btn.wait .ic { animation: breathe 1.2s ease-in-out infinite; }

/* AI 成长 */
.growth-intro { max-width: 900px; line-height: 1.7; margin: 0 0 12px; }
.growth-stats { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 12px; }
.growth-stats .stat { display: flex; flex-direction: column; gap: 2px; }
.growth-stats .stat b.small { font-size: 14px; line-height: 1.4; margin: 6px 0 2px; }
.growth-main { margin-bottom: 14px; }
.growth-main h3 { margin: 0 0 10px; font-size: 15px; }
.lesson { padding: 10px 12px; border: 1px solid #22304a; border-radius: 8px; background: #0b1322; margin-bottom: 8px; }
.lesson.off { opacity: .6; }
.lesson .ltext { color: var(--txt); line-height: 1.55; }
.lesson .ltag { margin-left: 6px; font-size: 11px; color: var(--gold2); border: 1px solid rgba(230,180,34,.4); border-radius: 4px; padding: 0 4px; }
.lesson .lmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12px; margin-top: 4px; }
.lesson .lmeta b { color: var(--txt); }
.lesson .lact { display: flex; gap: 6px; margin-top: 8px; }
.growth-old { margin-top: 10px; color: var(--muted); }
.growth-old summary { cursor: pointer; margin-bottom: 8px; }
.trend { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 6px 0 0; border-bottom: 1px solid #22304a; overflow-x: auto; }
.tbar { flex: 1 0 26px; max-width: 48px; height: 100%; display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; position: relative; }
.tbar i { display: block; width: 100%; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--gold2), #b8860b); }
.tbar span { font-size: 11px; color: var(--muted); }

/* 模型接入：只有“其他（OpenAI 兼容）”需要填地址和模型名 */





/* 自有模型：列表 + 弹窗，只有“其他（OpenAI 兼容）”需要填地址和模型名 */
#umForm .custom-only { display: none; }
#umForm.is-custom .custom-only { display: flex; }
#umForm.is-custom .pick-only { display: none; }
#umForm .codeline select { flex: 1; min-width: 0; }
#aiMine .pagehead { margin-bottom: 10px; }
#aiMine td.acts { white-space: nowrap; }
#aiMine td.acts .btn { margin-right: 4px; }
.tagx { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; line-height: 18px; border: 1px solid; }
.tagx.ok { color: var(--green); border-color: rgba(47,206,123,.4); background: rgba(47,206,123,.08); }
.tagx.no { color: #ff8a90; border-color: rgba(255,77,87,.4); background: rgba(255,77,87,.08); }
#umForm > label { min-width: 0; }
@media (max-width: 1100px) { #umForm { grid-template-columns: minmax(0, 1fr); } }

.goto-strategy { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); }
#aiEns .form.wide3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { #aiEns .form.wide3 { grid-template-columns: minmax(0, 1fr); } }

/* 右下角 AI 对话 */
.aifab {
  position: fixed; right: 20px; bottom: 20px; z-index: 48; display: flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px 0 14px; border-radius: 999px; border: 1px solid rgba(255,236,160,.6);
  color: #1a1404; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(180deg, #ffe08a, #e6b422 55%, #c8940f);
  box-shadow: 0 10px 28px rgba(230,180,34,.35), inset 0 1px 0 rgba(255,255,255,.45);
  transition: transform .15s, box-shadow .15s;
}
.aifab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(230,180,34,.45), inset 0 1px 0 rgba(255,255,255,.45); }
.aifab .ico { display: grid; place-items: center; }
.aifab .ic { width: 20px; height: 20px; margin: 0; }
.aifab.on { filter: brightness(.92); }
.aichat {
  position: fixed; right: 20px; bottom: 80px; z-index: 49; width: min(400px, calc(100vw - 40px)); height: min(600px, calc(100vh - 120px));
  display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  background: #0d1527; border: 1px solid #2a3b55; box-shadow: 0 24px 60px rgba(0,0,0,.55); animation: popIn .18s var(--ease);
}
.aichat-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 14px; border-bottom: 1px solid #1c2840; background: linear-gradient(180deg, #121d33, #0d1527); }
.aichat-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.aichat-head b { color: var(--gold2); }
.aichat-head span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aichat-x { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 20px; line-height: 1; }
.aichat-x:hover { background: rgba(255,255,255,.06); color: var(--txt); }
.aichat-list { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.aichat-empty { color: var(--muted); font-size: 13px; line-height: 1.7; padding: 8px 4px; }
.msg { display: flex; flex-direction: column; max-width: 88%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.ai { align-self: flex-start; }
.msg .bubble { padding: 8px 11px; border-radius: 12px; line-height: 1.6; word-break: break-word; }
.msg.me .bubble { background: rgba(230,180,34,.16); border: 1px solid rgba(230,180,34,.35); color: #f6e7b5; border-bottom-right-radius: 4px; }
.msg.ai .bubble { background: #111c31; border: 1px solid #22304a; color: #dbe4f0; border-bottom-left-radius: 4px; }
.msg .meta { color: #5f6f86; font-size: 11px; margin-top: 2px; }
.typing { display: flex; gap: 4px; padding: 12px 14px !important; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--gold2); animation: breathe 1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.aichat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 10px; }
.aichat-quick button { border: 1px solid #2a3b55; background: #0e1728; color: #cfd9e6; border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.aichat-quick button:hover { border-color: var(--gold); color: var(--gold2); }
.aichat-input { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid #1c2840; }
.aichat-input textarea { flex: 1; min-height: 40px; max-height: 120px; resize: none; }
.aichat-input .btn { align-self: flex-end; padding: 8px 14px; }
@media (max-width: 760px) {
  .aifab { right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); height: 46px; padding: 0 14px 0 12px; }
  .aifab .lbl { display: none; }
  .aifab { width: 46px; justify-content: center; padding: 0; }
  .aichat { left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: 82dvh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheetUp .22s var(--ease); z-index: 60; }
}
