:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-h: #1d4ed8;
  --danger: #dc2626;
  --up: #16a34a;
  --down: #dc2626;
  --warn: #d97706;
  --r: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }

/* ============ 通用卡片面板 ============ */
.tech { background: var(--panel); border: 1px solid #eef0f3; border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 14px rgba(16,24,40,.04); }

/* ============ 登录 ============ */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.loading-text { color: var(--muted); font-size: 14px; letter-spacing: 2px; }
.login-card { width: 100%; max-width: 380px; padding: 30px 28px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.logo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex: none; }
.login-brand h1 { margin: 0; font-size: 19px; font-weight: 700; }
.login-brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.error { margin: 12px 0 0; color: var(--down); font-size: 13px; }
.login-switch { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.login-switch a { color: var(--primary); cursor: pointer; text-decoration: none; }
.login-switch a:hover { text-decoration: underline; }

/* ============ 按钮 ============ */
.btn { border: 0; border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, opacity .15s; color: #fff; white-space: nowrap; }
.btn:hover { filter: brightness(1.04); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-h); }
.btn-danger { background: var(--danger); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { background: #f9fafb; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-mini { padding: 5px 12px; font-size: 13px; border-radius: 7px; border: 0; color: #fff; font-weight: 500; cursor: pointer; }
.btn-mini-danger { background: var(--danger); }
.btn-mini-ghost { background: #fff; border: 1px solid var(--line); color: var(--text); }
.btn-mini-ghost:hover { background: #f9fafb; }

/* ============ 顶栏 ============ */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 22px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-status { display: flex; align-items: center; gap: 12px; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge-on { color: var(--up); border-color: rgba(22,163,74,.35); background: rgba(22,163,74,.07); }
.badge-off { color: var(--warn); border-color: rgba(217,119,6,.35); background: rgba(217,119,6,.07); }
.updated { font-size: 12px; color: var(--muted); }

main { max-width: 1480px; margin: 0 auto; padding: 16px 22px 60px; }

/* ============ KPI ============ */
.kpi-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kpi { padding: 16px 18px; }
.kpi-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12px; color: var(--muted); margin-left: 8px; font-weight: 400; }

/* ============ 两栏布局 ============ */
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 14px; align-items: start; margin-top: 14px; }
.layout-main { min-width: 0; }
.layout-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 60px; }
.side-box { padding: 14px 16px; }
.add-panel { margin-top: 10px; }
.add-panel .field { margin-bottom: 10px; }

.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.panel-title i { width: 3px; height: 14px; border-radius: 2px; background: var(--primary); }

/* 顶部添加账号面板（折叠） */
.add-panel-box { padding: 16px 18px; margin-bottom: 14px; }
.add-form { display: grid; grid-template-columns: 1fr 1fr 1.5fr 1fr auto; gap: 10px; align-items: end; }
.add-form .field { margin-bottom: 0; }
.msg { margin: 12px 0 0; font-size: 13px; }
.msg.ok { color: var(--up); }
.msg.err { color: var(--down); }

/* ============ 区块标题 ============ */
.sec-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; font-size: 15px; font-weight: 600; }
.sec-title::before { content: ''; width: 4px; height: 15px; border-radius: 2px; background: var(--primary); }
.muted { color: var(--muted); font-weight: 400; font-size: 12px; }

/* ============ 账号卡片 ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.card { padding: 16px 18px; }
.card-off { opacity: .55; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-acct { font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.pill { font-size: 12px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.pill-on { color: var(--up); background: rgba(22,163,74,.1); }
.pill-stale { color: var(--warn); background: rgba(217,119,6,.1); }
.pill-off { color: var(--muted); background: #f3f4f6; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.kv-span2 { grid-column: 1 / -1; }
.ml-danger { color: #dc2626 !important; }
.ml-warn { color: #d97706 !important; }
.ml-ok { color: #16a34a !important; }
.note-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; vertical-align: middle; }
.note-btn:hover { color: var(--primary); }
.pause-btn { background: none; border: 0; padding: 0; cursor: pointer; line-height: 0; vertical-align: middle; opacity: .85; transition: opacity .15s, transform .1s; }
.pause-btn:hover { opacity: 1; transform: scale(1.06); }
.pause-btn:active { transform: scale(.96); }
.pause-btn svg { display: block; }

/* 币种标签 */
.cur-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 4px; margin-left: 6px; vertical-align: middle; letter-spacing: 0; }
.cur-usc { background: #fef3c7; color: #b45309; }
.cur-usd { background: #dbeafe; color: #1d4ed8; }
.cur-other { background: #f3f4f6; color: #6b7280; }

/* 持仓方向标签 */
.dir-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 4px; margin-right: 6px; }
.dir-buy { background: rgba(22,163,74,.1); color: #16a34a; }
.dir-sell { background: rgba(220,38,38,.1); color: #dc2626; }
.dir-both { background: rgba(217,119,6,.1); color: #d97706; }

/* ============ 专业账户卡片（高级感） ============ */
.acct-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #eef0f3;
  box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 4px 14px rgba(16,24,40,.04);
  transition: box-shadow .2s ease, transform .2s ease;
}
.acct-card:hover { box-shadow: 0 2px 6px rgba(16,24,40,.06), 0 12px 28px rgba(16,24,40,.09); }

.acct-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.acct-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

.acct-tags { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.acct-tag-item { color: var(--muted); }
.acct-online { margin-left: auto; color: var(--up); font-size: 12px; letter-spacing: .5px; }

/* 暂停状态：只淡化内容区，顶部「已暂停」和 恢复图标 保持清晰 */
.acct-paused { background: #fbfbfd; border-color: #f1e4e4; }
.acct-paused .acct-body { opacity: .55; filter: grayscale(.6); }
.acct-paused-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 4px; background: #fee2e2; color: #dc2626; white-space: nowrap; }
.acct-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 余额：细体大字（高级感核心） */
.acct-balance { font-size: 34px; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -1px; line-height: 1.1; margin-top: 18px; text-align: right; }
/* 品种名 + 余额同一行（左品种 / 右金额） */
.acct-money { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 14px; }
.acct-money .acct-balance { margin-top: 0; flex: 1; min-width: 0; }
.acct-money-sym { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; flex: none; }
.acct-balance-label { font-size: 11px; color: #9ca3af; text-align: right; margin-top: 3px; letter-spacing: 1.5px; text-transform: uppercase; }

.acct-details { margin-top: 16px; border-top: 1px solid #f0f1f3; }
.acct-row { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; font-size: 13px; }
.acct-row:not(:last-child) { border-bottom: 1px solid #f7f8fa; }
.acct-row > span:first-child { color: var(--muted); }
.acct-row > span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; }

/* 风险：进度条可视化 */
.acct-risk { margin-top: 14px; }
.acct-risk-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin-bottom: 6px; }
.acct-risk-head > span:first-child { color: var(--muted); }
.acct-risk-head > span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.acct-risk-bar { height: 4px; border-radius: 2px; background: #f0f1f3; overflow: hidden; }
.acct-risk-fill { height: 100%; border-radius: 2px; transition: width .3s ease; }

.acct-btn { margin-top: 16px; padding: 11px; border: 0; border-radius: 10px; background: #d97706; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; }
.acct-btn:hover { background: #b45309; }
.acct-btn:active { background: #92400e; }

/* ============ 卡片统一结构 ============ */
.card-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-head-main { min-width: 0; flex: 1; }
.card-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card-main-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 12px 0 8px; letter-spacing: -.5px; }
.card-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 5px 0; font-size: 13px; }
.card-row .k { color: var(--muted); }
.card-row .v { font-variant-numeric: tabular-nums; font-weight: 500; }

.pos-head-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pos-symbol { font-size: 17px; font-weight: 700; }
.pos-profit { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============ 备注弹窗 ============ */
.modal-mask { position: fixed; top: 0; left: 0; right: 0; bottom: 0; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 12px; padding: 22px 24px; width: 100%; max-width: 360px; box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.modal h3 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.modal input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none; color: var(--text); }
.modal input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.confirm-text { margin: 0; font-size: 14px; color: #4b5563; line-height: 1.65; white-space: pre-line; }

/* ============ 会员管理弹窗 ============ */
.modal-xl { max-width: 760px; max-height: 90vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.user-box-title { margin: 16px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.user-add-box { background: #f9fafb; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.user-form { display: flex; gap: 8px; }
.user-form input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; outline: none; color: var(--text); background: #fff; }
.user-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.user-accs-input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-family: inherit; resize: vertical; outline: none; color: var(--text); background: #fff; line-height: 1.8; font-variant-numeric: tabular-nums; }
.user-accs-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.user-accs-hint { margin: 6px 0 0; font-size: 12px; }

/* 会员表格 */
.users-table-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: auto; max-height: 240px; background: #fff; }
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table thead th { position: sticky; top: 0; text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted); background: #f9fafb; border-bottom: 1px solid var(--line); white-space: nowrap; }
.users-table tbody td { padding: 10px 12px; border-bottom: 1px solid #f0f1f3; }
.users-table tbody tr:last-child td { border-bottom: 0; }
.users-table tbody tr:hover { background: #f9fafb; }
.ut-name { font-weight: 600; }
.ut-phone { font-variant-numeric: tabular-nums; color: var(--muted); }
.ut-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ut-bal { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; color: #15803d; white-space: nowrap; }
.ut-actions { text-align: right; white-space: nowrap; }
.ut-actions .btn-mini + .btn-mini { margin-left: 6px; }
.kv { display: flex; flex-direction: column; gap: 1px; }
.kv-k { font-size: 12px; color: var(--muted); }
.kv-v { font-size: 15px; font-variant-numeric: tabular-nums; font-weight: 600; }
.card-error { font-size: 13px; color: var(--warn); line-height: 1.55; }
.card-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; }

/* ============ 表格 ============ */
.table-box { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
thead th { text-align: left; padding: 11px 14px; font-size: 12px; font-weight: 600; color: var(--muted); background: #f9fafb; border-bottom: 1px solid var(--line); }
tbody td { padding: 11px 14px; border-bottom: 1px solid #f0f1f3; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9fafb; }
th.r, td.r { text-align: right; }
.tag { display: inline-block; padding: 1px 9px; border-radius: 5px; font-size: 12px; font-weight: 500; }
.tag-buy { color: #dc2626; background: rgba(220,38,38,.1); }
.tag-sell { color: #16a34a; background: rgba(22,163,74,.1); }
/* 盈亏配色：盈利红 / 亏损绿（与"红=多 / 绿=空"一致） */
.pos { color: #dc2626; }
.neg { color: #16a34a; }
.empty { margin: 0; padding: 28px; text-align: center; color: var(--muted); font-size: 13px; }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #1f2937; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 13px; z-index: 99; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-width: 88%; text-align: center; }

/* ============ 响应式 ============ */
@media (max-width: 1199px) {
  .kpi-row { grid-template-columns: repeat(3, 1fr); }
  .layout { grid-template-columns: 1fr; }
  .layout-side { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .layout-side .side-box:last-child { grid-column: 1 / -1; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 767px) {
  body { font-size: 13px; }
  main { padding: 10px 12px 50px; }
  .topbar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
  .topbar-title { font-size: 14px; }
  .topbar-right { flex: 1 1 100%; justify-content: space-between; flex-wrap: wrap; }
  #btn-close-all { flex: 1 1 100%; order: -1; padding: 11px 14px; }
  .updated { display: none; }
  /* 手机端状态行：实时 + 指标 + 密码 + 退出 强制一行 */
  .topbar-status { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .topbar-status .badge { flex: none; }
  .topbar-status .gi-top { flex: 1 1 auto; font-size: 11px; gap: 4px; min-width: 0; white-space: nowrap; }
  .topbar-status .btn-sm { flex: none; padding: 7px 10px; font-size: 12px; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 12px 14px; }
  .kpi-value { font-size: 20px; }
  .kpi-sub { display: block; margin-left: 0; margin-top: 2px; }
  .layout-side { display: flex; flex-direction: column; }
  .chart { height: 200px; }
  .cards { grid-template-columns: 1fr; gap: 10px; }
  .acct-card { padding: 16px; }
  .acct-balance { font-size: 28px; }
  .add-form { grid-template-columns: 1fr; }
  table { font-size: 12px; }
  thead th { padding: 9px 10px; }
  tbody td { padding: 9px 10px; }
  .login-wrap { padding: 16px; }
  .login-card { padding: 24px 20px; }
  .btn { padding: 11px 14px; }
  .btn-mini { padding: 9px 14px; }
  .card-actions .btn-mini { padding: 10px 14px; }
}

/* ============ 手机端持仓卡片（参考 App 风格） ============ */
.desktop-only { display: block; }
.mobile-only { display: none; }
.pos-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.pos-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px 12px; }
.pc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pc-dir { font-size: 13px; font-weight: 600; padding: 2px 8px; border-radius: 5px; color: #fff; flex: none; }
.pc-dir-buy { background: #dc2626; }
.pc-dir-sell { background: #16a34a; }
.pc-symbol { font-size: 18px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-balance { font-size: 25px; font-weight: 700; margin: 2px 0 10px; font-variant-numeric: tabular-nums; }
.pc-profit { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-main { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.pc-lots { font-size: 15px; color: var(--muted); }
.pc-price { font-size: 14px; font-variant-numeric: tabular-nums; }
.pc-meta { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.pc-actions { display: flex; gap: 8px; }
.pc-btn { flex: 1; padding: 11px; border: 0; border-radius: 8px; background: #f3f4f6; color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer; }
.pc-btn:active { background: #e5e7eb; }
.pc-btn-danger { background: #fef2f2; color: var(--danger); }
.pc-btn-danger:active { background: #fee2e2; }

@media (max-width: 767px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }
  .pos-cards { grid-template-columns: 1fr; }
}
/* 持仓三项：成本 / 现价 / 止损 —— 三等分，恒为一行 */
.q-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin-top: 10px; font-size: 11px; font-variant-numeric: tabular-nums; }
.q-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.q-row-1 { grid-template-columns: 1fr; }
.q-row-ref { background: #f1f5f9; border-style: dashed; color: #64748b; }
.q-row-ref em { color: #94a3b8; }
.q-cell { display: flex; align-items: baseline; gap: 3px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-cell em { font-style: normal; color: var(--muted); font-size: 10px; flex: none; }
/* 有止损 → 整行变绿（提示已设保护） */
.q-row.q-row-has-sl { background: #dcfce7; border-color: #86efac; color: #15803d; }
.q-row.q-row-has-sl em { color: #15803d; font-weight: 600; }

/* 持仓品种实时价格 */
.acct-quotes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.acct-quotes span { background: #f8fafc; border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); white-space: normal; max-width: 100%; }
.acct-quotes .q-i { white-space: nowrap; display: inline-block; }
.acct-quotes b { font-weight: 600; margin-right: 5px; }
.acct-quotes em { font-style: normal; color: var(--muted); margin: 0 4px 0 8px; font-size: 12px; }
.acct-quotes-ref span { background: #f1f5f9; border-style: dashed; color: #64748b; font-size: 12px; padding: 3px 8px; max-width: 100%; white-space: normal; }
.acct-quotes-ref b { color: #475569; }
.acct-quotes-ref em { margin: 0 3px 0 5px; font-size: 11px; }
.acct-quotes-ref .q-rmb { white-space: nowrap; display: inline-block; }
/* ============ 添加到桌面提示 ============ */
.install-tip { position: fixed; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: 0 10px 34px rgba(16,24,40,.18); z-index: 95; animation: tipIn .3s ease; }
@keyframes tipIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.install-tip-text { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.install-tip-text strong { font-size: 14px; color: var(--text); }
/* ============ iOS 添加主屏幕引导 ============ */
.ios-steps { display: flex; flex-direction: column; gap: 14px; margin: 6px 0 10px; }
.ios-step { display: flex; gap: 10px; align-items: flex-start; }
.ios-step-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.ios-step-body { display: flex; flex-direction: column; gap: 3px; }
.ios-step-body strong { font-size: 14px; }
.ios-step-body > span { color: var(--muted); font-size: 12px; }
.ios-mock-bar { display: flex; gap: 14px; align-items: center; justify-content: center; background: #f3f4f6; border-radius: 8px; padding: 8px 12px; margin-top: 6px; font-size: 15px; color: #9ca3af; }
.ios-mock-bar .ios-share { background: var(--primary); color: #fff; border-radius: 6px; padding: 2px 9px; animation: sharePulse 1.4s ease-in-out infinite; }
@keyframes sharePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .6; transform: scale(1.06); } }
/* 开多/开空按钮 */
/* 方向配色：红=开多 / 绿=开空 / 橙=平仓 */
.btn-open-buy { background: #dc2626; }
.btn-open-buy:hover { background: #b91c1c; }
.btn-open-sell { background: #16a34a; }
.btn-open-sell:hover { background: #15803d; }
#btn-close-all { background: #d97706; }
#btn-close-all:hover { background: #b45309; }
/* 会员开仓权限开关 */
.btn-mini-on { background: #16a34a; color: #fff; }
.btn-mini-on:hover { background: #15803d; }
/* 卡片操作行（开多/开空/一键平仓） */
.acct-actions { display: flex; gap: 8px; margin-top: 12px; }
.acct-actions .acct-btn { flex: 1; margin: 0; }
.acct-btn-buy { background: #dc2626; color: #ffffff; }
.acct-btn-buy:hover { background: #b91c1c; }
.acct-btn-sell { background: #16a34a; color: #ffffff; }
.acct-btn-sell:hover { background: #15803d; }
/* M1 指标行（仅管理员显示） */
.acct-indicators { display: flex; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.acct-indicators b { color: var(--text); font-variant-numeric: tabular-nums; margin-left: 2px; }
.acct-indicators .bias-long { color: #dc2626; }
.acct-indicators .bias-short { color: #16a34a; }
/* 顶部全局指标行（仅管理员） */
.global-indicators-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 12px 0 4px; font-size: 13px; color: var(--muted); box-shadow: 0 1px 3px rgba(16,24,40,.05); }
.global-indicators-box .gi-symbol { font-size: 15px; color: var(--text); font-weight: 700; margin-right: 4px; }
.global-indicators-box b { color: var(--text); font-variant-numeric: tabular-nums; margin-left: 3px; }
.global-indicators-box .bias-long { color: #dc2626; }
.global-indicators-box .bias-short { color: #16a34a; }
/* 顶栏全局指标（实时后，仅管理员） */
.gi-top { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.gi-top .gi-item b { color: var(--text); font-variant-numeric: tabular-nums; margin-left: 2px; }
.gi-top .gi-sep { color: var(--line); }
.gi-top.bias-long, .gi-top.bias-long b, .gi-top.bias-long .gi-item { color: #dc2626; }
.gi-top.bias-short, .gi-top.bias-short b, .gi-top.bias-short .gi-item { color: #16a34a; }
.gi-top.bias-mid, .gi-top.bias-mid b, .gi-top.bias-mid .gi-item { color: #ca8a04; }

/* ============ 账户总览标题栏 + 刷新按钮 ============ */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 12px; }
.sec-head .sec-title { margin: 0; min-width: 0; }
.refresh-btn {
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--muted);
  cursor: pointer; outline: none;
  transition: color .15s, border-color .15s, background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.refresh-btn svg { width: 16px; height: 16px; display: block; }
.refresh-btn:hover { color: var(--primary); border-color: var(--primary); background: #f8fafc; }
.refresh-btn:active { transform: scale(.92); }
.refresh-btn.spin { pointer-events: none; color: var(--primary); border-color: var(--primary); }
.refresh-btn.spin svg { animation: rf-spin .55s linear infinite; }
@keyframes rf-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 平板 */
@media (max-width: 1199px) {
  .refresh-btn { width: 34px; height: 34px; }
}
/* 手机 */
@media (max-width: 767px) {
  .sec-head { margin: 18px 0 10px; }
  .refresh-btn { width: 36px; height: 36px; border-radius: 10px; }
  .refresh-btn svg { width: 17px; height: 17px; }
}
/* ============ 会员管理（列表 + 详情 两栏，手机单栏） ============ */
body.um-lock { overflow: hidden; }
.um-mask { padding: 20px; }
.um-modal { display: flex; flex-direction: column; width: min(1060px, 96vw); height: min(88vh, 880px); background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.um-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.um-head-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.um-head-left h3 { margin: 0; font-size: 16px; font-weight: 600; }
.um-head-right { display: flex; gap: 8px; flex: 0 0 auto; }
.um-count { font-size: 12px; color: var(--muted); }
.um-back { padding: 4px 8px; font-size: 15px; line-height: 1; }
.um-body { flex: 1; display: flex; min-height: 0; }

.um-list-pane { width: 330px; flex: 0 0 330px; border-right: 1px solid var(--line); background: #fafbfc; display: flex; flex-direction: column; min-height: 0; }
.um-search { padding: 12px 12px 8px; }
.um-search input { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; color: var(--text); background: #fff; outline: none; }
.um-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.um-chips { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; }
.um-chips::-webkit-scrollbar { display: none; }
.um-chip { border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12px; padding: 5px 10px; border-radius: 999px; white-space: nowrap; cursor: pointer; }
.um-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.um-list { flex: 1; overflow-y: auto; padding: 0 8px 10px; -webkit-overflow-scrolling: touch; }
.um-item { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; text-align: left; padding: 10px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.um-item:hover { border-color: #c7d2fe; }
.um-item.sel { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.um-item.adm { background: #f8fafc; }
.um-ava { width: 34px; height: 34px; border-radius: 50%; background: #eef2ff; color: #4f46e5; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: 0 0 auto; }
.um-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.um-item-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.um-tag { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: #f3f4f6; color: var(--muted); font-weight: 500; }
.um-tag.adm { background: #eef2ff; color: #4338ca; }
.um-item-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.um-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: 0 0 auto; }
.um-item-bal { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.um-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.um-dot.on { background: #16a34a; }
.um-dot.part { background: #f59e0b; }
.um-dot.off { background: #d1d5db; }
.um-list-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 10px; }

.um-detail-pane { flex: 1; min-width: 0; overflow-y: auto; background: #fff; }
.um-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 4px; color: var(--muted); font-size: 14px; }
.um-empty-ico { font-size: 40px; opacity: .3; }
.um-detail { padding: 16px 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.um-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.um-name { font-size: 17px; font-weight: 650; }
.um-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.um-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.um-sec { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.um-sec h4 { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.um-sec-head { display: flex; justify-content: space-between; align-items: center; }
.um-sec-head h4 { margin: 0; }
.um-sec-hint { font-weight: 400; font-size: 11.5px; }
.um-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.um-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.um-grid input { box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; color: var(--text); background: #fff; outline: none; }
.um-grid input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.um-grid input:disabled { background: #f6f7f9; color: var(--muted); }

.um-acc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.um-acc-chip { display: flex; align-items: center; gap: 6px; background: #f1f5f9; border-radius: 999px; padding: 6px 10px; font-size: 12.5px; }
.um-acc-chip b { font-weight: 600; }
.um-acc-chip .x { border: 0; background: transparent; color: #94a3b8; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 2px; }
.um-add-acc { display: flex; gap: 8px; }
.um-add-acc input { flex: 1; min-width: 0; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; color: var(--text); outline: none; }

.um-switch-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 13.5px; }
.um-switch { position: relative; width: 44px; height: 24px; flex: 0 0 auto; }
.um-switch input { position: absolute; top: 0; left: 0; right: 0; bottom: 0; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.um-switch i { position: absolute; top: 0; left: 0; right: 0; bottom: 0; inset: 0; background: #cbd5e1; border-radius: 999px; transition: .18s; }
.um-switch i::after { content: ''; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; background: #fff; border-radius: 50%; transition: .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.um-switch input:checked + i { background: var(--primary); }
.um-switch input:checked + i::after { transform: translateX(20px); }

.um-push-summary { font-size: 12.5px; color: var(--muted); }
.um-push-body { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.um-push-body input[type="text"] { box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; color: var(--text); outline: none; }
.um-events { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2px; }
.um-events label { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.um-events input[type="checkbox"] { width: 16px; height: 16px; margin: 0; }
.um-push-actions { display: flex; gap: 8px; margin-top: 2px; }
.um-actions { display: flex; gap: 10px; margin-top: 2px; }
.um-danger { color: #dc2626 !important; border-color: #fecaca !important; }
.um-hint { font-size: 11.5px; margin: 6px 0 0; }

@media (max-width: 900px) {
  .um-list-pane { width: 280px; flex-basis: 280px; }
}
@media (max-width: 700px) {
  .um-mask { padding: 0; align-items: stretch; }
  .um-modal { width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
  .um-body { position: relative; }
  .um-list-pane { width: 100%; flex-basis: 100%; border-right: 0; }
  .um-detail-pane { position: absolute; top: 0; left: 0; right: 0; bottom: 0; inset: 0; background: #fff; display: none; padding-bottom: env(safe-area-inset-bottom); }
  .um-modal.show-detail .um-detail-pane { display: block; }
  .um-modal.show-detail .um-list-pane { display: none; }
  .um-head { padding: 11px 12px; }
  .um-head-left h3 { font-size: 15px; }
  .um-detail { padding: 12px 12px 20px; gap: 10px; }
  .um-grid { grid-template-columns: 1fr; }
  .um-modal input { font-size: 16px; }   /* 手机 16px 防 iOS 聚焦自动放大 */
  .um-item { padding: 11px 10px; }
  .um-switch { width: 48px; height: 27px; }
  .um-switch i::after { width: 21px; height: 21px; }
  .um-switch input:checked + i::after { transform: translateX(21px); }
}
/* 会员管理打开时隐藏"添加到主屏幕"提示，避免挡住底部操作 */
body.um-lock #install-tip { display: none !important; }
/* 手机端：保存按钮固定在详情底部，滚动时始终可见 */
@media (max-width: 700px) {
  .um-actions { position: sticky; bottom: 0; background: #fff; padding: 10px 0 calc(6px + env(safe-area-inset-bottom)); margin-top: 2px; border-top: 1px solid var(--line); }
  .um-actions .btn { flex: 1; }
}
/* 会员未填写虾推 token 的顶部提示条 */
.push-tip { max-width: 1436px; margin: 12px auto 0; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  font-size: 13px; color: #92400e; }
.push-tip-ico { font-size: 16px; flex: 0 0 auto; }
.push-tip-text { flex: 1; min-width: 0; }
.push-tip .btn { flex: 0 0 auto; }
@media (max-width: 700px) {
  .push-tip { max-width: none; margin: 10px 12px 0; flex-wrap: wrap; gap: 8px; }
  .push-tip-text { flex: 1 1 100%; }
  .push-tip .btn { flex: 1 1 auto; }
}
/* 层级修复：确认框必须盖在会员管理/其它弹窗之上 */
#confirm-modal { z-index: 1000; }
/* 提示条盖在所有弹窗之上，弹窗里保存后也能看到 */
#toast { z-index: 1100; }
/* 所有弹窗打开时锁背景滚动（JS 会给 body 加 modal-open） */
body.modal-open { overflow: hidden; }
/* 手机端提示条抬高，避免盖住弹窗底部的固定按钮 */
@media (max-width: 700px) { #toast { bottom: 96px; } }
/* 会员列表超长昵称省略显示 */
.um-item-name { min-width: 0; }
.um-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.um-detail-title { min-width: 0; }
.um-name { word-break: break-all; }
/* 休市时行情参考行的标注 */
.q-tag { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px;
  background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 600; vertical-align: 1px; }
.q-row-closed .q-cell { color: #92400e; }
/* ============ TV / 大屏适配（遥控器操作）============ */
/* TV 没有鼠标：焦点必须看得见 */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.btn:focus-visible, .acct-btn:focus-visible, .btn-mini:focus-visible,
.um-item:focus-visible, .um-chip:focus-visible {
  outline: 3px solid var(--primary); outline-offset: 3px;
  box-shadow: 0 0 0 7px rgba(37,99,235,.16);
}

/* 1080p 电视 / 大显示器：放大字号与点击目标 */
@media (min-width: 1800px) and (hover: none) {
  main { max-width: 2400px; padding: 24px 40px 90px; }
  .topbar { padding: 16px 40px; gap: 18px; }
  .topbar-title { font-size: 22px; }
  .btn { font-size: 17px; padding: 12px 20px; border-radius: 10px; }
  .btn-sm { font-size: 15px; padding: 10px 16px; }
  .badge, .updated, .gi-top { font-size: 15px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 20px; }
  .card { padding: 22px 24px; border-radius: 16px; }
  .acct-name { font-size: 20px; }
  .acct-tags { font-size: 14px; margin-top: 12px; }
  .acct-balance { font-size: 46px; }
  .acct-money-sym, .acct-balance-label { font-size: 14px; }
  .q-row { font-size: 15px; padding: 8px 10px; }
  .acct-row { font-size: 16px; padding: 12px 0; }
  .acct-indicators { font-size: 15px; }
  .acct-actions { gap: 12px; margin-top: 16px; }
  .acct-btn { padding: 15px; font-size: 17px; border-radius: 12px; }
  .sec-head { font-size: 18px; }
  .push-tip { max-width: 2320px; font-size: 17px; padding: 14px 18px; }
  .modal { max-width: 580px; }
  .um-modal { max-width: 1400px; }
  .um-item { padding: 14px; }
  .um-item-name { font-size: 17px; }
  .um-item-sub { font-size: 13px; }
  .um-section-title { font-size: 16px; }
  .um-input { font-size: 17px; padding: 12px; }
  .um-label { font-size: 15px; }
}

/* 4K 电视：再放大一档 */
@media (min-width: 3000px) and (hover: none) {
  main { max-width: 3500px; padding: 32px 60px 120px; }
  .topbar { padding: 22px 60px; }
  .topbar-title { font-size: 30px; }
  .btn { font-size: 24px; padding: 18px 30px; border-radius: 14px; }
  .btn-sm { font-size: 20px; padding: 14px 22px; }
  .badge, .updated, .gi-top { font-size: 19px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(620px, 1fr)); gap: 28px; }
  .card { padding: 30px 34px; border-radius: 20px; }
  .acct-name { font-size: 28px; }
  .acct-balance { font-size: 66px; }
  .acct-row { font-size: 21px; padding: 16px 0; }
  .q-row { font-size: 20px; padding: 12px 14px; }
  .acct-btn { padding: 20px; font-size: 22px; border-radius: 14px; }
  .sec-head { font-size: 24px; }
  .um-modal { max-width: 2400px; }
  .um-item-name { font-size: 24px; }
  .um-item-sub { font-size: 18px; }
  .um-section-title { font-size: 22px; }
  .um-input { font-size: 22px; padding: 16px; }
}
/* 遥控器焦点模式：按过方向键后才显示焦点框（鼠标用户无感） */
body.tv-nav :focus { outline: 3px solid var(--primary); outline-offset: 3px; }
body.tv-nav .acct-card:focus-within { box-shadow: 0 0 0 3px rgba(37,99,235,.22); }
/* TV 安全区：电视可能裁掉边缘约 5%，用 3vw 留白；同时隐藏"添加到桌面"提示 */
@media (min-width: 1800px) and (hover: none) {
  .topbar { padding-left: 3vw; padding-right: 3vw; }
  main { padding-left: 3vw; padding-right: 3vw; }
  .install-tip { display: none !important; }
}
/* TV：登录卡片、会员管理弹窗放大（遥控器操作，字大才好点） */
@media (min-width: 1800px) and (hover: none) {
  .login-card { max-width: 560px; padding: 44px 40px; }
  .login-card h1, .login-card .title { font-size: 28px; }
  .login-card input, .login-card .input { font-size: 20px; padding: 14px 16px; height: 56px; }
  .login-card .btn { font-size: 20px; padding: 16px; height: 56px; }
  .um-modal { width: min(1500px, 92vw); height: min(86vh, 980px); }
  .um-modal input { font-size: 17px; }
}
@media (min-width: 3000px) and (hover: none) {
  .login-card { max-width: 820px; padding: 64px 56px; }
  .login-card input, .login-card .input { font-size: 30px; height: 84px; }
  .login-card .btn { font-size: 30px; height: 84px; }
  .um-modal { width: min(2600px, 92vw); height: min(84vh, 1700px); }
  .um-modal input { font-size: 24px; }
}
/* ============ TV 布局：一行 5 个，一屏看全（按视口高度自适应） ============ */
@media (hover: none) and (min-width: 1800px) {
  main { max-width: none; padding: 6px 2vw 8px; }
  .topbar { padding: 6px 2vw; gap: 8px; }
  .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .card { padding: 8px 10px; border-radius: 10px; }
  .acct-name { font-size: clamp(12px, 1.6vh, 20px); }
  .acct-tags { margin-top: 3px; font-size: clamp(10px, 1.1vh, 14px); gap: 4px; }
  .q-row { padding: 2px 6px; font-size: clamp(10px, 1.15vh, 15px); gap: 2px; }
  .q-tag { font-size: 9px; padding: 0 4px; }

  /* 品种 + 余额：品种可截断，绝不和数字重叠 */
  .acct-money { margin-top: 6px; gap: 6px; align-items: baseline; }
  .acct-money-sym { font-size: clamp(11px, 1.5vh, 20px); min-width: 0; flex: 0 1 auto;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .acct-balance { font-size: clamp(18px, 3.5vh, 42px); letter-spacing: -0.5px; flex: 0 0 auto; }
  /* 余额 · USD 标签已在所有端移除（元素不再渲染） */

  .acct-details { margin-top: 4px; }
  .acct-row { font-size: clamp(11px, 1.55vh, 17px); padding: clamp(2px, 0.9vh, 9px) 0; }
  .acct-risk { margin-top: 4px; }
  .acct-risk-head { font-size: clamp(10px, 1.2vh, 14px); margin: 0; }
  .acct-risk-bar { height: 3px; display: block; }   /* 进度条保留，压扁一点 */
  .acct-indicators { font-size: clamp(10px, 1.2vh, 14px); margin-top: 4px; }
  .acct-actions { margin-top: 5px; gap: 6px; }
  .acct-btn { padding: clamp(5px, 1.2vh, 13px); font-size: clamp(11px, 1.5vh, 18px); border-radius: 7px; }
  .sec-head { margin: 3px 0 5px; font-size: clamp(12px, 1.4vh, 17px); }
  .badge, .updated, .gi-top { font-size: clamp(10px, 1.2vh, 15px); }
  .btn { font-size: clamp(11px, 1.35vh, 16px); padding: clamp(5px, 1vh, 11px) clamp(8px, 1vw, 16px); }
  .btn-sm { font-size: clamp(10px, 1.2vh, 14px); padding: clamp(4px, 0.9vh, 9px) clamp(7px, 0.8vw, 13px); }
  .push-tip { margin: 6px 2vw 0; font-size: 13px; padding: 6px 10px; }
  .install-tip { display: none !important; }
  .sym-prefix { display: none; }        /* 电视上去掉"品种:"前缀，节省宽度 */
}

/* 4K 电视：整体再放大一点 */
@media (hover: none) and (min-width: 2600px) {
  .cards { gap: 14px; }
  .card { padding: 14px 16px; }
  .acct-name { font-size: 26px; }
  .acct-money-sym { font-size: 24px; }
  .acct-balance { font-size: 46px; }
  .acct-balance-label { font-size: 18px; }
  .acct-row { font-size: 20px; padding: 8px 0; }
  .q-row { font-size: 17px; padding: 5px 8px; }
  .acct-btn { padding: 14px; font-size: 20px; }
  .acct-tags { font-size: 15px; }
  .btn { font-size: 18px; padding: 10px 16px; }
}
/* 品种前缀（电视上隐藏，电脑/手机正常显示，非斜体） */
.acct-money-sym .sym-prefix { font-style: normal; }
/* TV：让两行卡片平分视口高度，保证一屏放全（不依赖 zoom） */
@media (hover: none) and (min-width: 1800px) {
  #app-view { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
  #app-view main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; margin: 0; width: 100%; max-width: none; }
  #app-view .cards { flex: 1 1 auto; min-height: 0; grid-auto-rows: minmax(0, 1fr); align-content: stretch; }
  #app-view .acct-card { min-height: 0; overflow: hidden; }
  #app-view .acct-card .acct-actions { margin-top: auto; }
}
/* TV 屏幕较矮时：三项数值并排显示（不删信息），预付款比只留数值 */
@media (hover: none) and (min-width: 800px) and (max-height: 710px) {
  .acct-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px 8px;
    margin-top: 3px; padding-top: 3px; }
  .acct-row { flex-direction: column; align-items: flex-start; gap: 0; padding: 0;
    border-bottom: 0 !important; line-height: 1.25; }
  .acct-row > span:first-child { font-size: clamp(9px, 1.1vh, 12px); color: #9ca3af; }
  .acct-row > span:last-child { font-size: clamp(11px, 1.5vh, 15px); font-weight: 600; }
  .acct-risk { display: flex; align-items: baseline; justify-content: space-between;
    margin-top: 2px; padding-top: 2px; border-top: 1px solid #f7f8fa; }
  .acct-risk-head { font-size: clamp(9px, 1.1vh, 12px); margin: 0; width: 100%; }
  .acct-risk-bar { height: 3px; display: block; }
  .acct-actions { margin-top: 4px; }
  .acct-balance { font-size: clamp(16px, 3vh, 28px); }
  .acct-name { font-size: clamp(11px, 1.5vh, 15px); }
  .acct-btn { padding: 5px; font-size: clamp(10px, 1.3vh, 14px); }
  .acct-money { margin-top: 3px; }
}
/* ===== 超管可见：数据来源标注 ===== */
.acct-src {
  font-size: 10.5px;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  max-width: 58%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.q-src-line {
  font-size: 10.5px;
  color: #6b7280;
  margin: 2px 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 700px) {
  .acct-src { max-width: 60%; }
}
.acct-src-line {
  font-size: 10.5px;
  color: #6b7280;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.price-src {
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
  margin-left: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
/* ===== K 线图 ===== */
.kline-wrap {
  background: var(--card, #fff);
  border-radius: 12px;
  padding: 12px 14px 10px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.kline-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.kline-title { font-weight: 700; font-size: 14px; }
.kline-meta { font-size: 11px; color: #6b7280; }
.kline-tfs { margin-left: auto; display: flex; gap: 4px; }
.kline-tfs button {
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
  color: #374151;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 6px;
  cursor: pointer;
}
.kline-tfs button.on {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
}
#kline-canvas { width: 100%; height: 260px; display: block; }
@media (max-width: 700px) {
  #kline-canvas { height: 200px; }
  .kline-tfs { margin-left: 0; width: 100%; justify-content: space-between; }
  .kline-tfs button { flex: 1; padding: 5px 0; }
}
.kline-toggle {
  border: 1px solid #16a34a;
  background: #16a34a;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 6px;
  transition: background .15s, color .15s, border-color .15s;
}
.kline-toggle:hover { filter: brightness(1.06); }
.kline-toggle.is-open {
  background: var(--primary, #2563eb);
  color: #fff;
  border-color: var(--primary, #2563eb);
  font-weight: 600;
}
.kline-toggle.is-open:hover { filter: brightness(1.06); }
.kline-wrap.collapsed #kline-canvas { display: none; }
.kline-wrap.collapsed { padding-bottom: 12px; }
.sym-kline {
  color: var(--primary, #2563eb);
  font-style: normal;
  font-size: 11px;
  margin-left: 6px;
  cursor: pointer;
  border-bottom: 1px dashed currentColor;
}
.acct-money-sym[data-act="kline"] { cursor: pointer; }
/* K 线：当前周期高低（标题行内） */
.kline-stats {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #374151;
}
.kline-stats .ks-tf { font-weight: 700; color: #2563eb; }
.kline-stats .ks-item b { font-weight: 600; font-variant-numeric: tabular-nums; }
.kline-stats .ks-hi { color: #dc2626; }
.kline-stats .ks-lo { color: #16a34a; }
.kline-stats .lab-short { display: none; }
/* 电脑端顺序：标题 → 信息 → 高低 → 周期按钮 → 收起 */
.kline-title { order: 1; }
.kline-meta { order: 2; }
.kline-stats { order: 3; }
.kline-tfs { order: 4; }
.kline-toggle { order: 5; }

@media (max-width: 700px) {
  /* 手机端：标题 → 信息 → 周期按钮 → 收起 + 高低（同一行） */
  .kline-tfs { order: 3; }
  /* 高低统计在左，展开/收起按钮靠右，方便右手拇指点 */
  .kline-stats {
    order: 4;
    flex: 1 1 auto;
    width: auto;
    margin-top: 0;
    gap: 6px;
    font-size: 11px;
    white-space: nowrap;
  }
  .kline-toggle { order: 5; margin-left: auto; flex: none; }
  .kline-stats .lab-long { display: none; }
  .kline-stats .lab-short { display: inline; }
  .kline-stats .ks-tf { display: none; }
  .kline-head { row-gap: 6px; }
}
/* ============ K 线区：平板 / TV 自适应放大 ============ */
/* 平板（竖屏/横屏常见宽度） */
@media (min-width: 701px) and (max-width: 1199px) {
  .kline-title { font-size: 15px; }
  .kline-meta { font-size: 12px; }
  .kline-stats { font-size: 13px; gap: 14px; }
  .kline-tfs button { font-size: 13px; padding: 5px 12px; }
  .kline-toggle { font-size: 13px; padding: 5px 12px; }
  #kline-canvas { height: 300px; }
}
/* TV 1080p（大屏 + 无鼠标） */
@media (min-width: 1800px) and (hover: none) {
  .kline-wrap { padding: 18px 22px 14px; border-radius: 16px; }
  .kline-head { gap: 14px; margin-bottom: 12px; }
  .kline-title { font-size: 20px; }
  .kline-meta { font-size: 15px; }
  .kline-stats { font-size: 17px; gap: 18px; }
  .kline-tfs button { font-size: 16px; padding: 8px 16px; border-radius: 8px; }
  .kline-toggle { font-size: 16px; padding: 8px 16px; border-radius: 8px; margin-left: 10px; }
  #kline-canvas { height: 340px; }
}
/* TV 4K（min-width 3000） */
@media (min-width: 3000px) and (hover: none) {
  .kline-wrap { padding: 26px 32px 20px; border-radius: 20px; }
  .kline-head { gap: 20px; margin-bottom: 16px; }
  .kline-title { font-size: 30px; }
  .kline-meta { font-size: 21px; }
  .kline-stats { font-size: 25px; gap: 26px; }
  .kline-tfs button { font-size: 23px; padding: 12px 22px; border-radius: 12px; }
  .kline-toggle { font-size: 23px; padding: 12px 22px; border-radius: 12px; margin-left: 14px; }
  #kline-canvas { height: 520px; }
}
/* ============ 平板（触屏 701–1399px）：卡片 2～3 列，别挤 ============ */
@media (hover: none) and (min-width: 701px) and (max-width: 1799px) {
  main { max-width: 100%; overflow-x: hidden; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .topbar-right { flex-wrap: wrap; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
  .card { padding: 18px 20px; border-radius: 14px; }
  .acct-name { font-size: 17px; }
  .acct-balance { font-size: 34px; }
  .acct-row { font-size: 14px; padding: 9px 0; }
  .acct-btn { padding: 12px; font-size: 15px; }
  .q-row { font-size: 13px; }
}
/* ============ 固定一行 5 个会员（平板 / 电脑 / 电视统一） ============ */
@media (min-width: 701px) {
  .cards { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
}
/* 窄屏（701–1399）也排 5 列时：紧凑排版，保证字不被挤没 */
@media (min-width: 701px) and (max-width: 1399px) {
  .card { padding: 10px 12px; border-radius: 10px; }
  .acct-name { font-size: 13px; }
  .acct-tags { font-size: 10px; gap: 4px; margin-top: 4px; }
  .q-row { font-size: 11px; padding: 3px 6px; }
  .acct-money { margin-top: 6px; gap: 6px; }
  .acct-money-sym { font-size: 11px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .acct-balance { font-size: 20px; letter-spacing: -0.3px; }
  .acct-details { margin-top: 4px; }
  .acct-row { font-size: 12px; padding: 5px 0; }
  .acct-risk-head { font-size: 11px; }
  .acct-indicators { font-size: 10px; margin-top: 5px; gap: 8px; }
  .acct-actions { margin-top: 6px; gap: 6px; }
  .acct-btn { padding: 8px; font-size: 12px; border-radius: 7px; }
  .sec-head { font-size: 14px; }
  .sym-prefix { display: none; }
}
/* ============ 极窄屏（701–900）也排 5 列：进一步压缩，保证不截断 ============ */
@media (min-width: 701px) and (max-width: 900px) {
  .card { padding: 8px 9px; border-radius: 9px; }
  .acct-name { font-size: 11px; }
  .acct-tags { font-size: 9px; gap: 3px; margin-top: 3px; }
  .acct-online { font-size: 9.5px; }
  .q-row { font-size: 10px; padding: 2px 5px; }
  .q-tag { font-size: 8px; padding: 0 3px; }
  .acct-money { margin-top: 5px; gap: 4px; }
  .acct-money-sym { font-size: 10px; }
  .acct-balance { font-size: 15px; }
  .acct-row { font-size: 10.5px; padding: 4px 0; }
  .acct-risk-head { font-size: 9.5px; }
  .acct-indicators { font-size: 9px; gap: 6px; margin-top: 4px; }
  .acct-actions { margin-top: 5px; gap: 4px; }
  .acct-btn { padding: 6px 2px; font-size: 10.5px; border-radius: 6px; }
  .sec-head { font-size: 12px; }

}
/* ============ 窄屏 5 列：文字允许换行，保证信息不丢 ============ */
@media (min-width: 701px) and (max-width: 1399px) {
  .acct-name, .acct-src-line, .q-src-line, .acct-indicators { white-space: normal; }
  .acct-name { line-height: 1.25; word-break: normal; overflow-wrap: break-word; }
  .q-row { flex-wrap: wrap; row-gap: 2px; }
  .acct-row { flex-wrap: wrap; gap: 2px; }
  .acct-money { flex-wrap: wrap; row-gap: 2px; }
  .acct-src { max-width: 100%; }
}
/* ============ 极窄屏：卡片标题换行（名字占满一行，不被图标挤碎） ============ */
@media (min-width: 701px) and (max-width: 1000px) {
  .acct-top { flex-wrap: wrap; row-gap: 3px; }
  .acct-name { flex: 1 1 100%; }
  .acct-paused-badge { margin-left: 0; }
  .pause-btn, .note-btn { margin-left: auto; }
}
/* ============ 收尾：窄中屏（701–1500）5 列下的补丁 ============ */
@media (min-width: 701px) and (max-width: 1500px) {
  /* 名字允许换行，暂停徽标/图标自动换到下一行，避免被省略号截断 */
  .acct-top { flex-wrap: wrap; row-gap: 3px; }
  .acct-name { white-space: normal; overflow-wrap: break-word; word-break: normal; flex: 1 1 100%; text-overflow: clip; }
  .acct-paused-badge { margin-left: 0; }
  .pause-btn, .note-btn { margin-left: auto; }
}
/* ============ 成本 / 现价 / 止损：所有端恒为一行（三等分） ============ */
@media (min-width: 701px) {
  .q-row, .q-row.q-row-has-sl {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 3px !important;
    padding: 4px 5px !important;
    font-size: clamp(8.5px, 0.85vw, 11px);
  }
  .q-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .q-row-1 { grid-template-columns: 1fr !important; }
  .q-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; gap: 2px; }
  .q-cell em { font-size: 0.92em; }
}
/* 报价行再收紧：窄中屏给三个数值留更多空间（保持一行） */
@media (min-width: 701px) and (max-width: 1200px) {
  .q-row { padding: 3px 3px !important; gap: 2px !important; }
  .q-cell { gap: 1px; }
  .q-cell em { font-size: 0.9em; }
}

/* ============ 登录页背景图（2026-11-24；只挂登录表单，加载页不加载图） ============ */
#login-view {
  background-image:
    linear-gradient(180deg, rgba(5,12,28,.20) 0%, rgba(4,10,22,.32) 50%, rgba(3,8,18,.50) 100%),
    url("/login-bg.jpg?v=20261126");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
/* 未登录：加载屏也铺背景图（5 秒预加载，进登录页无跳变） */
#loading-view {
  background-image:
    linear-gradient(180deg, rgba(5,12,28,.20) 0%, rgba(4,10,22,.32) 50%, rgba(3,8,18,.50) 100%),
    url("/login-bg.jpg?v=20261126");
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #eaf2ff;
}
/* 已登录（服务端给 <html> 打了 has-session）：加载屏纯渐变，不请求背景图 */
html.has-session #loading-view {
  background-image: radial-gradient(1200px 700px at 50% 35%, #16294d 0%, #0b1730 45%, #060d1c 100%);
}
.login-wrap .login-card {
  background: rgba(255,255,255,.97);
  box-shadow: 0 18px 48px rgba(2,8,20,.45);
}

@media (max-width: 700px) {
  #login-view,
  #loading-view {
    background-image:
      linear-gradient(180deg, rgba(4,10,24,.22) 0%, rgba(3,8,18,.52) 100%),
      url("/login-bg-mobile.jpg?v=20261126");
    background-position: center top;
    background-attachment: scroll;
  }
  html.has-session #loading-view {
    background-image: radial-gradient(1200px 700px at 50% 35%, #16294d 0%, #0b1730 45%, #060d1c 100%);
  }
}
@media (min-width: 1600px) {
  #login-view { background-position: center center; }
}

/* ===== 登录卡片/输入框 透明玻璃效果（2026-11-24） ===== */
.login-wrap .login-card {
  background: rgba(8, 16, 34, .04);
  border: 1px solid rgba(255,255,255,.32);
  box-shadow: 0 24px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(5px) saturate(1.2);
  -webkit-backdrop-filter: blur(5px) saturate(1.2);
  color: #eaf2ff;
}
.login-wrap .login-card h1,
.login-wrap .login-card .title,
.login-wrap .login-brand h1 { color: #ffffff; }
.login-wrap .login-card .login-brand p { color: rgba(234,242,255,.72); }
.login-wrap .login-card .field span { color: rgba(234,242,255,.80); }
.login-wrap .login-card .field input {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.34);
  color: #ffffff;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}
.login-wrap .login-card .field input::placeholder { color: rgba(255,255,255,.45); }
.login-wrap .login-card .field input:focus {
  background: rgba(255,255,255,.09);
  border-color: rgba(125,175,255,.95);
  box-shadow: 0 0 0 3px rgba(96,165,250,.22);
  outline: none;
}
.login-wrap .login-card .login-switch { color: rgba(234,242,255,.72); }
.login-wrap .login-card .login-switch a { color: #9cc4ff; }
.login-wrap .login-card .error { color: #fca5a5; }
/* 登录按钮在玻璃卡片上更亮一点 */
.login-wrap .login-card .btn-primary,
.login-wrap .login-card button[type="submit"] {
  box-shadow: 0 8px 22px rgba(37,99,235,.45);
}

/* ===== 加载屏进度条（2026-11-24） ===== */
#loading-view { place-items: center; }
.loading-box {
  width: min(380px, 78vw);
  padding: 22px 26px 20px;
  border-radius: 16px;
  background: rgba(6, 14, 30, .38);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 44px rgba(0,0,0,.35);
  backdrop-filter: blur(6px) saturate(1.1);
  -webkit-backdrop-filter: blur(6px) saturate(1.1);
}
.loading-brand {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  color: #dbeafe; font-size: 15px; font-weight: 600; letter-spacing: .4px; margin-bottom: 20px;
}
.loading-brand .logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #3b82f6; box-shadow: 0 0 12px rgba(59,130,246,.9); flex: none;
}
.loading-bar {
  position: relative; height: 6px; border-radius: 999px; overflow: hidden;
  background: rgba(255,255,255,.13); box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
}
.loading-bar i {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 60%, #a5b4fc 100%);
  box-shadow: 0 0 14px rgba(56,189,248,.55);
  transition: width .28s ease;
}
.loading-bar i::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  animation: loadShine 1.1s linear infinite;
}
@keyframes loadShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.loading-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 11px; font-size: 12px; color: rgba(226,232,240,.72);
}
#loading-pct { color: #93c5fd; font-variant-numeric: tabular-nums; font-weight: 600; }
/* 手机端缩小一点 */
@media (max-width: 700px) {
  .loading-box { width: min(300px, 76vw); }
  .loading-brand { font-size: 14px; margin-bottom: 16px; }
}
/* ============ 会员：我的账号（申请绑定 MT4 账号） ============ */
.myacct { margin: 4px 0 18px; }
.myacct-body { background: var(--card, #fff); border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.myacct-list { display: flex; flex-wrap: wrap; gap: 8px; }
.myacct-empty { color: var(--muted); font-size: 13px; line-height: 1.6; }
.myacct-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; background: #fff; }
.myacct-chip.on { border-color: rgba(22,163,74,.35); background: #f0fdf4; }
.myacct-chip b { font-variant-numeric: tabular-nums; }
.myacct-chip span { color: var(--muted); }
.myacct-chip em { font-style: normal; font-weight: 600; }
.myacct-req { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.myacct-req-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.myacct-req-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 3px 0; }
.myacct-req-row b { font-variant-numeric: tabular-nums; }
.myacct-req-row span { color: var(--muted); }
.myacct-req-row em { margin-left: auto; color: var(--muted); font-style: normal; }
.mst { padding: 1px 6px; border-radius: 999px; font-size: 11px; }
.mst.pend { background: #fef3c7; color: #92400e; }
.mst.ok { background: #dcfce7; color: #166534; }
.mst.no { background: #fee2e2; color: #991b1b; }
.req-label { display: block; font-size: 12px; color: #374151; margin: 10px 0; }
.req-label input { width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; box-sizing: border-box; }
/* 会员管理：待审核申请 */
.um-pending { border: 1px solid #fcd34d; background: #fffbeb; border-radius: 10px; padding: 8px 10px; margin: 8px 8px 4px; }
.um-pending-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #92400e; font-weight: 600; margin-bottom: 6px; }
.um-pend-row { border-top: 1px dashed #fde68a; padding: 6px 0; }
.um-pend-row:first-child { border-top: none; }
.um-pend-main { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.um-pend-main span { color: #6b7280; font-size: 12px; }
.um-pend-sub { font-size: 11px; color: #6b7280; margin-top: 2px; }
.um-pend-sub i { font-style: normal; }
.um-pend-sub i.ok { color: #16a34a; }
.um-pend-sub i.warn { color: #d97706; }
.um-pend-actions { display: flex; gap: 6px; margin-top: 6px; }

/* 待审核申请里的密码行 */
.um-pend-pw { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #6b7280; margin-top: 4px; }
.um-pend-pw.muted { color: #9ca3af; }
#pw-modal { z-index: 1060; }
#pw-view { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; box-sizing: border-box; letter-spacing: 1px; }

.req-label select { width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; box-sizing: border-box; background: #fff; color: #111827; }

/* 会员「我的账号」弹窗 */
.my-acct-box { width: min(560px, 94vw); max-height: 86vh; display: flex; flex-direction: column; padding: 0; }
.my-acct-box .um-head { border-bottom: 1px solid var(--line); }
.my-acct-scroll { overflow: auto; padding-bottom: 6px; }
.my-acct-sec { padding: 12px 16px; border-top: 1px solid var(--line); }
.my-acct-sec:first-child { border-top: none; }
.my-acct-sec-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #111827; }
.my-acct-form .req-label { margin: 8px 0; }
.my-acct-form .btn-block { margin-top: 10px; }

/* 二维码：登录页 / 会员引导 */
.qr-panel { max-width: 1436px; margin: 0 auto 18px; padding: 14px 16px; background: rgba(8,16,34,.55); border: 1px solid rgba(255,255,255,.18); border-radius: 14px; color: #e5edff; }
#app-view .qr-panel { background: var(--card, #fff); border-color: var(--line); color: inherit; }
.qr-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.qr-list { display: flex; flex-wrap: wrap; gap: 14px; }
.qr-card { width: 128px; text-align: center; }
.qr-card img { width: 120px; height: 120px; object-fit: contain; background: #fff; border-radius: 10px; padding: 6px; box-sizing: border-box; }
.qr-card.qr-contact img { border: 1px solid rgba(37,99,235,.35); }
.qr-name { font-size: 12px; font-weight: 600; margin-top: 6px; }
.qr-sub { font-size: 11px; opacity: .75; }
.qr-guide { padding: 16px; }
.qr-guide-tip { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
/* 后台二维码设置 */
.qr-box { width: min(640px, 94vw); max-height: 88vh; display: flex; flex-direction: column; padding: 0; }
.qr-scroll { overflow: auto; }
.qr-tip { padding: 10px 16px; font-size: 12px; color: var(--muted); }
.qr-row { padding: 12px 16px; border-top: 1px solid var(--line); }
.qr-row-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.qr-row-body { display: flex; gap: 14px; align-items: flex-start; }
.qr-preview { width: 96px; height: 96px; flex: 0 0 96px; display: flex; align-items: center; justify-content: center; background: #f8fafc; border: 1px dashed var(--line); border-radius: 10px; font-size: 12px; color: var(--muted); overflow: hidden; }
.qr-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.qr-row-fields { flex: 1; min-width: 0; }
.qr-row-fields .req-label { margin: 0 0 8px; }
.qr-label-inline, .qr-file-inline { display: block; font-size: 12px; color: #374151; margin: 8px 0 0; }
.qr-file-inline input { margin-top: 4px; font-size: 12px; }

/* 登录页二维码：与登录卡片留间距，小屏更紧凑（避免挤在一起/被裁掉） */
.login-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.login-wrap #login-qr { flex: none; }
@media (max-width: 560px) {
  .login-wrap { gap: 14px; padding: 16px 14px 22px; justify-content: center; }
  #login-qr { padding: 10px 12px; margin: 0; }
  #login-qr .qr-title { font-size: 12px; margin-bottom: 8px; text-align: center; }
  #login-qr .qr-list { justify-content: center; gap: 8px; flex-wrap: nowrap; }
  #login-qr .qr-card { width: 30%; max-width: 104px; }
  #login-qr .qr-card img { width: 100%; height: auto; aspect-ratio: 1/1; padding: 4px; }
  #login-qr .qr-name { font-size: 11px; margin-top: 4px; }
  #login-qr .qr-sub { display: none; }
}

/* 会员引导二维码：手机端紧凑，并给底部"安装提示"留出空间，避免被遮 */
@media (max-width: 560px) {
  #app-view { padding-bottom: 92px; }
  #member-guide { margin: 10px 12px 0; padding: 12px; }
  #member-guide .qr-guide-tip { font-size: 12px; margin-bottom: 10px; }
  #member-guide .qr-title { text-align: center; font-size: 12px; margin-bottom: 8px; }
  #member-guide .qr-list { flex-wrap: nowrap; justify-content: center; gap: 8px; }
#member-guide .qr-card { width: 30%; max-width: 104px; }
#member-guide .qr-card img { width: 100%; height: auto; aspect-ratio: 1/1; padding: 4px; }
#member-guide .qr-name { font-size: 11px; margin-top: 4px; }
  #member-guide .qr-sub { display: none; }
}


/* 二维码设置弹窗要盖在「会员管理」之上 */
#qr-modal { z-index: 1060; }

/* 内容超高时从顶部开始排，避免居中导致顶部被裁 */
@supports (justify-content: safe center) {
  .login-wrap { justify-content: safe center; }
}

/* 登录页整组略微下移（视觉更平衡） */
.login-wrap { padding-top: 120px; padding-bottom: 20px; }
@media (max-width: 560px) {
  .login-wrap { padding-top: 70px; padding-bottom: 18px; }
}

/* 二维码设置：卡片式 */
.qr-box { width: min(720px, 94vw); }
.qr-scroll { overflow: auto; padding-bottom: 16px; }
.qr-sec-title { font-size: 13px; font-weight: 600; color: #111827; margin: 14px 16px 8px; }
.qr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px; }
.qr-grid-1 { grid-template-columns: minmax(0, 1fr); }
.qr-card2 { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 8px; }
.qr-card2-title { font-size: 12px; font-weight: 600; color: #374151; }
.qr-thumb { position: relative; width: 100%; max-width: 150px; aspect-ratio: 1 / 1; margin: 0 auto; border: 1px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
.qr-thumb:hover { border-color: var(--primary); background: #f1f5ff; }
.qr-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.qr-ph { font-size: 12px; color: #94a3b8; text-align: center; line-height: 1.6; }
.qr-hover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,.55); color: #fff; font-size: 12px; opacity: 0; transition: opacity .15s; }
.qr-thumb:hover .qr-hover { opacity: 1; }
.qr-card2 .qr-name-label { margin: 0; }
.qr-card2 .qr-name-label input { padding: 8px 10px; }
.qr-switch { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #374151; cursor: pointer; user-select: none; }
.qr-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.qr-slider { position: relative; width: 36px; height: 20px; border-radius: 999px; background: #cbd5e1; transition: background .15s; flex: none; }
.qr-slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.qr-switch input:checked + .qr-slider { background: var(--primary); }
.qr-switch input:checked + .qr-slider::after { transform: translateX(16px); }
@media (max-width: 560px) {
  .qr-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 联系码：横向排版（图左、名称/开关右） */
.qr-grid-1 .qr-card2 { display: grid; grid-template-columns: 150px minmax(0, 1fr); grid-template-areas: "title title" "thumb name" "thumb switch"; column-gap: 14px; row-gap: 8px; align-items: center; }
.qr-grid-1 .qr-card2-title { grid-area: title; }
.qr-grid-1 .qr-thumb { grid-area: thumb; max-width: 150px; }
.qr-grid-1 .qr-name-label { grid-area: name; margin: 0; align-self: end; }
.qr-grid-1 .qr-switch { grid-area: switch; align-self: start; margin-top: 2px; }

/* 二维码设置：三码一行 + 底部固定保存 */
.qr-box { width: min(820px, 96vw); }
.qr-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 16px 4px; }
.qr-grid-3 .qr-card2 { padding: 10px; }
.qr-grid-3 .qr-thumb { max-width: none; }
.qr-foot { flex: 0 0 auto; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
@media (max-width: 560px) {
  .qr-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 10px 4px; }
  .qr-grid-3 .qr-card2 { padding: 8px; gap: 6px; }
  .qr-grid-3 .qr-card2-title { font-size: 11px; }
  .qr-grid-3 .qr-ph { font-size: 10px; }
  .qr-grid-3 .qr-name-label input { padding: 6px 8px; font-size: 12px; }
  .qr-grid-3 .qr-switch-text { display: none; }
  .qr-grid-3 .qr-slider { width: 32px; height: 18px; }
  .qr-grid-3 .qr-slider::after { width: 14px; height: 14px; }
  .qr-grid-3 .qr-switch input:checked + .qr-slider::after { transform: translateX(14px); }
  .qr-foot { padding: 10px 12px; }
}

/* 覆盖 .modal 默认 360px 宽度，让二维码设置用宽弹窗 */
.modal.qr-box { max-width: 96vw; width: min(860px, 96vw); padding: 0; }

/* 新用户欢迎引导页 */
#member-guide.qr-guide { padding: 0; background: transparent; border: none; }
.welcome-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.welcome-hi { font-size: 20px; font-weight: 700; color: #111827; }
.welcome-sub { margin-top: 6px; font-size: 13px; color: var(--muted); }
.welcome-steps { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0 16px; }
.ws-item { flex: 1 1 240px; display: flex; gap: 10px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ws-item b { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.ws-item h4 { margin: 0 0 3px; font-size: 14px; color: #111827; }
.ws-item p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.welcome-actions { margin-bottom: 14px; }
.welcome-qrs { border-top: 1px dashed var(--line); padding-top: 14px; }
@media (max-width: 560px) {
  .welcome-card { padding: 16px; }
  .welcome-hi { font-size: 18px; }
  .welcome-steps { flex-direction: column; gap: 10px; margin: 14px 0 12px; }
  .ws-item { flex: 0 0 auto; }   /* 竖排时不再被 240px 基准撑高 */
}

/* 会员账号弹窗：防止横向溢出（行内内容自动换行，左侧标签不再被裁） */
.my-acct-scroll { overflow-y: auto; overflow-x: hidden; }
.myacct-req-row { flex-wrap: wrap; row-gap: 6px; min-width: 0; }
.myacct-req-row > * { min-width: 0; }
.myacct-req-row em { margin-left: auto; }
.myacct-req-row .myacct-refill { flex: 0 0 auto; }
.my-acct-sec { min-width: 0; }
.my-acct-form, .my-acct-form .req-label { min-width: 0; }
@media (max-width: 560px) {
  .myacct-req-row { gap: 8px; }
  .myacct-req-row .myacct-refill { width: 100%; margin-left: 0; }
}

/* 账号弹窗在桌面端用宽一点的尺寸（覆盖 .modal 默认 360） */
.modal.my-acct-box { max-width: 94vw; width: min(560px, 94vw); }

/* 电源风格关闭按钮（红色圆角 + 电源图标） */
.btn-power {
  width: 36px; height: 36px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #ff1a1a; color: #fff;
  border: none; border-radius: 10px; padding: 0; cursor: pointer;
  box-shadow: 0 4px 10px rgba(255, 26, 26, .3);
  transition: all .22s cubic-bezier(.4, 0, .2, 1);
  -webkit-tap-highlight-color: transparent;
}
.btn-power svg { width: 18px; height: 18px; color: #fff; filter: drop-shadow(0 1px 1px rgba(0,0,0,.12)); }
.btn-power:hover { background: #f00f0f; box-shadow: 0 6px 14px rgba(255, 26, 26, .45); transform: translateY(-2px); }
.btn-power:active { transform: scale(.94); box-shadow: 0 2px 6px rgba(255, 26, 26, .3); }
.btn-power:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(255, 26, 26, .5); }
@media (max-width: 560px) { .btn-power { width: 34px; height: 34px; border-radius: 9px; } .btn-power svg { width: 17px; height: 17px; } }

/* 新用户引导二维码：桌面端也居中、间距一致 */


/* 手机端：新用户引导"一屏展示"（K线未展开时） */
@media (max-width: 560px) {
  body.welcome-mode #push-tip { display: none !important; }
  body.welcome-mode .topbar { padding: 8px 12px; gap: 6px; }
  body.welcome-mode .topbar .btn-sm { padding: 6px 10px; font-size: 12px; }
  body.welcome-mode #kline-wrap { margin: 8px 12px 0; padding: 10px 12px; }
  body.welcome-mode #kline-stats { display: none !important; }
  body.welcome-mode .kline-head { gap: 8px; }
  body.welcome-mode .kline-tfs button { padding: 4px 8px; font-size: 12px; }
  body.welcome-mode #member-guide { margin: 8px 12px 0; padding: 12px; }
  body.welcome-mode .welcome-steps { flex-direction: row; gap: 6px; margin: 10px 0; }
  body.welcome-mode .ws-item { flex: 1 1 0; min-width: 0; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px; }
  body.welcome-mode .ws-item b { width: 22px; height: 22px; font-size: 12px; }
  body.welcome-mode .ws-item h4 { font-size: 12px; margin: 0; }
  body.welcome-mode .ws-item p { display: none; }
  body.welcome-mode .welcome-actions { margin: 2px 0 8px; }
  body.welcome-mode .welcome-qrs { padding-top: 8px; }
  body.welcome-mode #member-guide .qr-card { width: 30%; max-width: 88px; }
  body.welcome-mode #member-guide .qr-name { font-size: 10px; margin-top: 3px; }
}


/* 手机端一屏版：三步用短标题 + 二维码放大 */
.ws-short { display: none; }
@media (max-width: 560px) {
  body.welcome-mode .ws-long { display: none; }
  body.welcome-mode .ws-short { display: inline; }
  body.welcome-mode .ws-item h4 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body.welcome-mode #member-guide { padding: 10px; }
  body.welcome-mode .welcome-card { padding: 12px; }
  body.welcome-mode #member-guide .qr-list { gap: 6px; }
  body.welcome-mode #member-guide .qr-card { width: calc((100% - 12px) / 3); max-width: 96px; }
  body.welcome-mode #member-guide .qr-card img { padding: 3px; }
}


/* 二维码：复制链接按钮 + 后台链接输入 */
.qr-copy {
  margin-top: 6px; padding: 4px 10px; font-size: 11px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--primary); cursor: pointer;
}
.qr-copy:hover { background: #eff6ff; border-color: rgba(37,99,235,.4); }
.qr-card2 .qr-link-label { margin: 0; }
.qr-card2 .qr-link-label input { padding: 8px 10px; font-size: 12px; }


/* 新用户（无账号）任何尺寸都不显示「全部平仓」——没有仓位可平 */
body.welcome-mode #btn-close-all { display: none !important; }


/* ============ 财经日历 ============ */
.modal.cal-box { width: min(760px, 94vw); max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; padding: 0; }
.cal-tabs { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-tab { padding: 6px 14px; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; color: #374151; }
.cal-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.cal-star-only { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; }
.cal-updated { margin-left: auto; font-size: 12px; color: var(--muted); }
.cal-list { overflow-y: auto; padding: 6px 16px 12px; min-height: 160px; }
.cal-loading, .cal-empty { padding: 40px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.cal-day { position: sticky; top: 0; background: #f8fafc; padding: 8px 4px 6px; font-size: 12px; color: #374151; z-index: 1; }
.cal-day b { font-weight: 600; }
.cal-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 4px; border-bottom: 1px dashed var(--line); font-size: 13px; }
.cal-row.hot { background: #fffdf5; }
.cal-time { flex: none; width: 44px; font-variant-numeric: tabular-nums; font-weight: 600; color: #111827; }
.cal-star { flex: none; width: 58px; color: #f59e0b; font-size: 12px; letter-spacing: 0; white-space: nowrap; }
.cal-country { flex: none; width: 52px; color: #374151; }
.cal-main { flex: 1; min-width: 0; }
.cal-main > b { font-weight: 600; color: #111827; }
.cal-period { margin-left: 6px; font-size: 12px; color: var(--muted); }
.cal-vals { margin-top: 3px; font-size: 12px; color: var(--muted); }
.cal-actual { color: #dc2626; }
.cal-tag { flex: none; font-size: 11px; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.cal-tag.wait { background: #f1f5f9; color: #64748b; }
.cal-tag.pub { background: #dcfce7; color: #15803d; }
.cal-tag.ev { background: #eff6ff; color: #1d4ed8; }
.cal-foot { padding: 8px 16px 12px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); }
@media (max-width: 560px) {
  .cal-row { gap: 6px; font-size: 12px; }
  .cal-star { width: 46px; font-size: 10px; }
  .cal-country { width: 44px; }
  .cal-updated { width: 100%; margin-left: 0; }
}

/* 手机端顶部：按钮紧凑换行（不再一行一个/全宽大按钮） */
@media (max-width: 560px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar-right { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  .topbar-right .btn-sm { flex: none; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
  #btn-close-all { flex: none; order: 0; padding: 7px 10px; font-size: 12px; }
  .topbar-status { flex: 1 1 100%; display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .topbar-status .btn-sm { flex: none; padding: 6px 9px; font-size: 12px; }
  .topbar-status .gi-top { flex: none; font-size: 11px; }
  .topbar-title { font-size: 13px; }
}

/* 手机端顶部再压缩：5 个动作按钮尽量排一行 */
@media (max-width: 560px) {
  .topbar-right { gap: 5px; }
  .topbar-right .btn-sm { padding: 6px 7px; font-size: 11px; }
  #btn-close-all { padding: 6px 7px; font-size: 11px; }
}

/* 手机端顶部：按用户指定两行排列
   第一行：全部平仓（整行）
   第二行：会员管理 / 全部开多 / 全部开空 / 财经日历 */
@media (max-width: 560px) {
  .topbar-right { gap: 6px; }
  #btn-close-all { flex: 1 1 100%; order: -1; padding: 9px 12px; font-size: 13px; }
  .topbar-right .btn-sm { flex: 1 1 0; min-width: 0; padding: 8px 6px; font-size: 12px; }
}

/* 手机端财经日历筛选：今天/本周 + 两个筛选放一行 */
@media (max-width: 560px) {
  .cal-tabs { gap: 6px; padding: 10px 12px; }
  .cal-tab { padding: 6px 10px; font-size: 12px; }
  .cal-star-only { font-size: 11px; gap: 4px; flex: 0 0 auto; }
  .cal-star-only input { width: 14px; height: 14px; margin: 0; }
  .cal-updated { flex: 1 1 100%; width: auto; margin-left: 0; font-size: 11px; }
}

/* ============ 中屏（700~1200）：车机/平板/窄窗口，顶部按钮折行，避免裁切 ============ */
@media (min-width: 701px) and (max-width: 1200px) {
  .topbar { flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 10px 14px; }
  .topbar-right { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
  .topbar-right > .btn-sm { flex: none; padding: 7px 10px; font-size: 12px; white-space: nowrap; }
  .topbar-status { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .topbar-status .badge,
  .topbar-status .updated,
  .topbar-status .btn-sm,
  .topbar-status .gi-top { flex: none; white-space: nowrap; font-size: 11px; }
  .topbar-title { font-size: 14px; }
}

/* ============ 平板/电脑/TV（701~1400）：顶部必须一行，按宽度自动缩小 ============ */
@media (min-width: 701px) and (max-width: 1400px) {
  .topbar { flex-wrap: nowrap; padding: 8px 10px; gap: 8px; }
  .topbar-brand { flex: none; gap: 6px; }
  .topbar-title { font-size: 13px; white-space: nowrap; }
  .topbar-right { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; gap: 5px; justify-content: flex-end; }
  .topbar-right > .btn-sm { flex: none; padding: 5px 7px; font-size: 11px; white-space: nowrap; }
  .topbar-status { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; gap: 6px; justify-content: flex-end; }
  .topbar-status .btn-sm { flex: none; padding: 5px 7px; font-size: 11px; white-space: nowrap; }
  .topbar-status .badge,
  .topbar-status .updated,
  .topbar-status .gi-top { flex: none; white-space: nowrap; font-size: 10px; }
}

/* ============ 561~980：车机分屏/小平板，仍要一行：隐藏次要指标，按钮再缩 ============ */
@media (min-width: 561px) and (max-width: 980px) {
  .topbar { flex-wrap: nowrap; padding: 7px 9px; gap: 6px; }
  .topbar-brand { flex: none; gap: 5px; }
  .topbar-title { font-size: 12px; white-space: nowrap; }
  .topbar-right { flex: 1 1 auto; flex-wrap: nowrap; min-width: 0; gap: 4px; justify-content: flex-end; }
  .topbar-right > .btn-sm { flex: none; padding: 4px 6px; font-size: 10.5px; white-space: nowrap; }
  .topbar-status { flex: 0 1 auto; flex-wrap: nowrap; min-width: 0; gap: 4px; justify-content: flex-end; }
  .topbar-status .btn-sm { flex: none; padding: 4px 6px; font-size: 10.5px; white-space: nowrap; }
  .topbar-status .badge { flex: none; white-space: nowrap; font-size: 10px; }
  .topbar-status .gi-top,
  .topbar-status .updated { display: none !important; }
}

/* 车机分屏：覆盖旧手机规则对「全部平仓」的整行强制 */
@media (min-width: 561px) and (max-width: 980px) {
  #btn-close-all { flex: none !important; order: 0 !important; padding: 4px 6px !important; font-size: 10.5px !important; }
}

/* 车机分屏极窄（561~650）：隐藏品牌文字和实时徽标，保证一行不重叠 */
@media (min-width: 561px) and (max-width: 600px) {
  .topbar-title { display: none !important; }
  .topbar-status .badge { display: none !important; }
}

/* 车机分屏：指标不隐藏，改为缩小显示（只藏更新时间） */
@media (min-width: 561px) and (max-width: 980px) {
  .topbar-status .gi-top { display: flex !important; flex: 0 1 auto !important; font-size: 9px !important; gap: 3px !important; min-width: 0; white-space: nowrap; }
  .topbar-status .gi-top .gi-item { font-size: 9px; }
  .topbar-status .gi-sep { display: none !important; }
  .topbar-status .updated { display: none !important; }
}

/* 卡片头部：暂停/笔记图标都靠右并排（避免暂停被挤到中间） */
@media (min-width: 701px) and (max-width: 1500px) {
  .pause-btn { margin-left: auto !important; }
  .note-btn { margin-left: 6px !important; }
}


/* 601~650：尽量保留品牌和实时，只缩字号 */
@media (min-width: 601px) and (max-width: 650px) {
  .topbar-title { font-size: 10px; }
  .topbar-status .badge { font-size: 9px; padding: 2px 5px; }
  .topbar-status .gi-top { font-size: 8.5px !important; }
  .topbar-right > .btn-sm, .topbar-status .btn-sm { padding: 3px 5px; font-size: 10px; }
}

/* 分屏指标完整显示：不压缩、不省略 */
@media (min-width: 561px) and (max-width: 980px) {
  .topbar-status .gi-top { flex: 0 0 auto !important; overflow: visible !important; }
}
/* 601~700 再紧一点，给指标腾位置 */
@media (min-width: 601px) and (max-width: 700px) {
  .topbar { gap: 4px; padding: 6px 8px; }
  .topbar-title { font-size: 9px; }
  .topbar-right > .btn-sm, .topbar-status .btn-sm { padding: 3px 4px; font-size: 9.5px; }
  .topbar-status .badge { font-size: 8.5px; padding: 2px 4px; }
  .topbar-status .gi-top { font-size: 8px !important; gap: 2px !important; }
}

/* 更新时间全局隐藏：所有端统一模板，用"实时"徽标 + 卡片数据龄表示新鲜度 */
.updated { display: none !important; }

/* 卡片头部：账号+备注 与 暂停/笔记 同一行，暂停贴右 */
@media (min-width: 701px) and (max-width: 1500px) {
  .acct-top { flex-wrap: nowrap !important; align-items: flex-start !important; row-gap: 0 !important; }
  .acct-name { flex: 1 1 auto !important; min-width: 0; white-space: normal !important; overflow-wrap: anywhere; }
  .pause-btn, .note-btn { flex: none !important; }
  .pause-btn { margin-left: auto !important; }
  .note-btn { margin-left: 4px !important; }
}

/* K线头部：侧分屏/平板下保持"标题+信息+高低"同一行 */
@media (min-width: 701px) and (max-width: 1000px) {
  .kline-head { gap: 8px; }
  .kline-title { font-size: 13px; white-space: nowrap; }
  .kline-meta { font-size: 10px; white-space: nowrap; }
  .kline-stats { font-size: 11px; gap: 8px; flex-wrap: nowrap; white-space: nowrap; }
  .kline-tfs button { padding: 4px 8px; font-size: 12px; }
  .kline-toggle { padding: 4px 8px; font-size: 12px; }
}


/* 手机端顶部：第二行等宽填满，第三行左右分开（指标在左、密码/退出在右） */
@media (max-width: 560px) {
  .topbar-status { justify-content: space-between !important; }
  .topbar-status .gi-top { flex: 1 1 auto !important; }
  .topbar-right .btn-sm { text-align: center; }
}


/* 手机端顶部：统一按钮高度与文字居中，财经日历图标不显示 */
@media (max-width: 560px) {
  .topbar-right > .btn-sm { display: flex; align-items: center; justify-content: center; min-height: 40px; }
  #btn-close-all { display: flex; align-items: center; justify-content: center; min-height: 44px; }
  .topbar-status { align-items: center; }
  .topbar-status .btn-sm { display: flex; align-items: center; justify-content: center; min-height: 36px; }
  .topbar-status .gi-top { gap: 6px; }
  #btn-calendar .cal-ico { display: none; }
}


/* 手机端：推送/密码按钮只留文字，给会员多一个按钮留空间 */
@media (max-width: 560px) {
  .topbar-status .btn-sm .ico { display: none; }
}


/* 手机端：图标全部保留（财经日历/推送/密码） */
@media (max-width: 560px) {
  #btn-calendar .cal-ico { display: inline !important; }
  .topbar-status .btn-sm .ico { display: inline !important; }
  .topbar-status { gap: 6px; }
  .topbar-status .btn-sm { padding: 6px 6px; font-size: 11.5px; }
  .topbar-status .gi-top { font-size: 10.5px; gap: 4px; }
  #btn-calendar { font-size: 11.5px; }
}


/* 手机端：顶部栏往下滑自动收起，往上滑再出现（避免挡住K线/卡片） */
@media (max-width: 560px) {
  .topbar { transition: transform .18s ease; }
  .topbar.topbar-hidden { transform: translateY(-110%); }
}


/* 手机端：推送/密码按钮文字与边框留出间距（隐藏指标分隔点腾空间） */
@media (max-width: 560px) {
  .topbar-status .gi-sep { display: none !important; }
  .topbar-status .btn-sm { padding: 6px 9px; }
  .topbar-status .btn-sm .ico { margin-right: 3px; }
  .topbar-status .gi-top { gap: 6px; }
}


/* 手机端状态行：会员有3个按钮（推送/密码/退出），压缩字号保证文字有边距 */
@media (max-width: 560px) {
  .topbar-status { gap: 5px; }
  .topbar-status .badge { padding: 2px 8px; font-size: 11px; }
  .topbar-status .gi-top { font-size: 9.5px; gap: 4px; }
  .topbar-status .btn-sm { padding: 5px 7px; font-size: 11px; }
  .topbar-status .btn-sm .ico { margin-right: 2px; font-size: 10px; }
}


/* 账号管理/会员管理图标与文字间距 */
.topbar-right .btn-sm .ico { margin-right: 3px; }


/* 侧屏/窄中屏：账号+备注、来源行都强制一行 */
@media (min-width: 701px) and (max-width: 1200px) {
  .acct-name {
    font-size: 11px !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
  }
  .acct-src-line {
    font-size: 10.5px !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (min-width: 701px) and (max-width: 1100px) {
  .acct-name { font-size: 9.5px !important; }
  .acct-src-line { font-size: 9.5px !important; }
}
