/* ===========================================================
   熟度交易所 · XP 版  ——  Windows 2000 / XP Luna 风格皮肤
   =========================================================== */
:root{
  --face:#ece9d8;
  --face-2:#dcd8c8;
  --face-3:#d4d0c8;
  --line:#919b9c;
  --line-2:#c8c5b8;
  --ink:#1b1b1b;
  --ink-2:#4a4a44;
  --title-a:#0058ee;
  --title-b:#3a93ff;
  --title-c:#0d4fbe;
  --blue:#0a246a;
  --sel:#316ac5;
  --up:#c40000;
  --dn:#067a06;
  --gold:#b8860b;
  --mono:"Tahoma","MS Sans Serif","Microsoft YaHei","PingFang SC","Hiragino Sans GB","Helvetica Neue",Arial,system-ui,sans-serif;
  --num:"Consolas","SF Mono",Menlo,"Lucida Console",monospace;
  --bar-h:34px;
  --safe-b:env(safe-area-inset-bottom, 0px);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font:12px/1.5 var(--mono);
  color:var(--ink);
  background:#0a3d8f;
  overflow:hidden;
  -webkit-tap-highlight-color:transparent;
}
button,input{font:inherit;color:inherit}
button{cursor:pointer}
::selection{background:var(--sel);color:#fff}

/* ---------- 桌面 ---------- */
.desktop{
  position:fixed;inset:0;
  background:
    radial-gradient(120% 70% at 50% 108%, #8dc63f 0%, #6aae2f 26%, #3f8b22 52%, rgba(63,139,34,0) 53%),
    radial-gradient(90% 55% at 12% 106%, #7cba35 0%, #4b8f27 45%, rgba(75,143,39,0) 46%),
    linear-gradient(180deg,#062a6b 0%,#0c4aa8 22%,#2b7ad0 48%,#66b3e8 72%,#a9d8f2 100%);
  overflow:hidden;
  padding:14px 14px calc(var(--bar-h) + var(--safe-b) + 14px);
  display:flex;align-items:stretch;justify-content:center;
}
.desktop::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:46%;
  background:radial-gradient(80% 100% at 50% 100%,rgba(255,255,255,.22),rgba(255,255,255,0) 60%);
  pointer-events:none;
}

/* 桌面图标（纯装饰） */
.icons{position:absolute;left:14px;top:14px;display:none;flex-direction:column;gap:14px;z-index:1}
@media (min-width:1440px){.icons{display:flex}}
.dicon{
  width:76px;text-align:center;color:#fff;font-size:11px;line-height:1.25;
  text-shadow:1px 1px 2px rgba(0,0,0,.7);
  padding:4px 2px;border:1px dotted transparent;border-radius:2px;
  user-select:none;cursor:default;
}
.dicon span{display:block;font-size:30px;line-height:1.1;filter:drop-shadow(1px 1px 2px rgba(0,0,0,.5))}
.dicon:hover{border-color:rgba(255,255,255,.6);background:rgba(49,106,197,.35)}
@media (max-width:900px){.icons{display:none}}

/* ---------- 窗口 ---------- */
.win{
  position:relative;z-index:2;
  width:min(1180px,100%);
  display:flex;flex-direction:column;
  background:var(--face);
  border:3px solid #0a5bd6;
  border-top-color:#5aa2f0;
  border-radius:9px 9px 4px 4px;
  box-shadow:0 18px 46px rgba(0,0,0,.5), inset 0 0 0 1px #9fc0f0;
  overflow:hidden;
}

/* 标题栏 */
.titlebar{
  height:30px;flex:0 0 30px;
  display:flex;align-items:center;gap:6px;
  padding:0 3px 0 7px;
  background:linear-gradient(180deg,#0a63e8 0%,#4a9bf5 6%,#1e6fd8 12%,#2a7ee2 55%,#155fce 88%,#0f52bc 100%);
  color:#fff;font-weight:700;font-size:12px;
  text-shadow:1px 1px 1px rgba(0,0,0,.45);
  border-radius:6px 6px 0 0;
  user-select:none;
}
.ttitle{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ticon{font-size:14px;line-height:1;filter:drop-shadow(0 1px 0 rgba(0,0,0,.4))}
.tbtns{display:flex;gap:2px}
.tb{
  width:21px;height:20px;padding:0;
  display:grid;place-items:center;
  font:700 11px/1 var(--mono);color:#fff;
  background:linear-gradient(180deg,#5fa8f7,#2c7ce0 45%,#1b63c8);
  border:1px solid #f4f9ff;
  border-radius:3px;
  box-shadow:inset 1px 1px 0 rgba(255,255,255,.55);
  text-shadow:0 1px 0 rgba(0,0,0,.4);
}
.tb:active{background:linear-gradient(180deg,#1b63c8,#2c7ce0)}
.tb.x{background:linear-gradient(180deg,#f08a7a,#d44a34 45%,#b32d18)}
.tb.x:active{background:linear-gradient(180deg,#b32d18,#d44a34)}

/* 菜单栏 */
.menubar{
  flex:0 0 auto;display:flex;gap:1px;padding:2px 3px;
  background:var(--face);border-bottom:1px solid #b9b5a6;
}
.menubar button{
  border:0;background:none;padding:2px 7px;font-size:12px;line-height:1.4;
}
.menubar button:hover{background:var(--sel);color:#fff}

/* 工具栏 */
.toolbar{
  flex:0 0 auto;display:flex;align-items:center;gap:3px;flex-wrap:wrap;
  padding:3px 5px;
  background:linear-gradient(180deg,#fbf9f2,#efece0 60%,#e3dfd1);
  border-bottom:1px solid #b9b5a6;
}
.tbtn{
  display:inline-flex;align-items:center;gap:5px;
  height:26px;padding:0 9px;
  background:linear-gradient(180deg,#ffffff,#f0ede1 55%,#dfdaca);
  border:1px solid #8f8f88;
  border-radius:3px;
  box-shadow:inset 1px 1px 0 #fff, inset -1px -1px 0 #c9c5b6;
  font-size:12px;white-space:nowrap;
}
.tbtn b{font-size:13px;line-height:1}
.tbtn:hover{background:linear-gradient(180deg,#fffdf4,#f6f2e2 55%,#e8e3d0);border-color:#3c6fb5}
.tbtn:active{box-shadow:inset 1px 1px 2px rgba(0,0,0,.25);background:linear-gradient(180deg,#e8e4d6,#f3f0e4)}
.tsep{width:1px;height:20px;margin:0 4px;background:#c3bfb0;box-shadow:1px 0 0 #fff}
.rhythm{display:inline-flex;align-items:center;gap:4px;font-size:11px;color:#3a3a34;white-space:nowrap}
.rhythm select{
  height:22px;padding:0 4px;font:inherit;
  background:linear-gradient(180deg,#fff,#f0ede1);
  border:1px solid #7a7a72;border-radius:2px;
  box-shadow:inset 1px 1px 0 #fff;
}
.addr{display:flex;align-items:center;gap:6px;margin-left:auto;padding-left:8px;flex:1;min-width:180px}
.addr label{color:#3a3a34;white-space:nowrap}
.addrbox{
  flex:1;min-width:0;height:22px;line-height:20px;padding:0 7px;
  background:#fff;border:1px solid #7a7a72;
  box-shadow:inset 1px 1px 2px rgba(0,0,0,.14);
  color:#333;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  font-family:var(--num);
}

/* 主区域 */
.frame{
  flex:1 1 auto;min-height:0;overflow:auto;
  display:grid;grid-template-columns:minmax(0,1fr) 322px;
  gap:9px;padding:9px;
  background:var(--face);
  scrollbar-color:#c8c5b8 var(--face);
}
.col-main,.col-side{display:flex;flex-direction:column;gap:9px;min-width:0}

/* 面板 */
.panel{
  margin:0;padding:7px 8px 8px;
  border:1px solid #b6b2a3;border-top-color:#fff;border-left-color:#fff;
  border-radius:3px;
  background:var(--face);
  position:relative;
  min-width:0;
}
.panel legend{
  padding:0 5px;margin-left:2px;
  font-weight:700;font-size:12px;color:#0a246a;
}
.legend-sub{font-weight:400;color:#6b6b62;margin-left:6px}
.panel-foot{
  display:flex;align-items:center;gap:7px;margin-top:6px;
  padding-top:5px;border-top:1px solid #d6d2c3;
  color:#4d4d46;font-size:11px;
}
.grow{flex:1}
.muted{color:#7a7a70}

/* ---------- 分时图 ---------- */
.chart-panel{flex:0 0 auto}
.chart-wrap{position:relative;background:#0a1d12;border:1px solid #6f7a6f;border-radius:2px;overflow:hidden}
#chart{display:block;width:100%;height:180px}
.chart-axis{display:none}
.chart-foot{
  display:flex;flex-wrap:wrap;gap:12px;align-items:center;
  margin-top:5px;font-size:11px;color:#4d4d46;
}
.chart-foot b{font-family:var(--num);font-size:12px}
.up{color:var(--up)}
.dn{color:var(--dn)}
.flat{color:#444}

/* ---------- 行情表 ---------- */
.table-wrap{
  background:#fff;border:1px solid #8f8f88;
  box-shadow:inset 1px 1px 2px rgba(0,0,0,.12);
  overflow:visible;
}
table.grid{width:100%;border-collapse:collapse;font-size:12px}
table.grid thead th{
  position:sticky;top:0;z-index:1;
  background:linear-gradient(180deg,#fff,#f2efe4 70%,#e6e2d4);
  border-right:1px solid #d5d1c2;border-bottom:1px solid #a9a595;
  padding:5px 7px;text-align:left;font-weight:700;color:#333;
  white-space:nowrap;
}
table.grid thead th:last-child{border-right:0}
table.grid tbody td{
  padding:6px 7px;border-right:1px solid #eeece2;border-bottom:1px solid #eeece2;
  white-space:nowrap;
}
table.grid tbody tr{background:#fff;cursor:pointer}
table.grid tbody tr:nth-child(even){background:#fafaf4}
table.grid tbody tr:hover{background:#eaf1fb}
table.grid tbody tr.sel{background:var(--sel);color:#fff}
table.grid tbody tr.sel td{border-color:#245cae}
table.grid tbody tr.flash-up{animation:fu .42s}
table.grid tbody tr.flash-dn{animation:fd .42s}
table.grid tbody tr.sel.flash-up,table.grid tbody tr.sel.flash-dn{animation:none}
@keyframes fu{0%{background:#ffeaea}55%{background:#fff6f6}100%{background:transparent}}
@keyframes fd{0%{background:#e8f6e8}55%{background:#f4faf4}100%{background:transparent}}
.c-name{width:34%}
.c-code{width:74px}
.c-px{width:96px;text-align:right!important}
.c-pct{width:86px;text-align:right!important}
.c-hold{width:60px;text-align:right!important}
.c-mini{width:86px}
td.px,td.pct{font-family:var(--num);text-align:right;font-weight:700}
th.c-px,th.c-pct,th.c-hold{text-align:right}
.name-cell{display:flex;align-items:center;gap:7px}
.name-cell .em{font-size:15px;line-height:1}
.name-cell .nm{font-weight:700}
.name-cell .tg{color:#8a8a80;font-size:10px}
tr.sel .name-cell .tg{color:#d8e6ff}
.pill{display:inline-block;min-width:34px;text-align:center;padding:0 5px;border-radius:2px;font-family:var(--num);font-size:11px;line-height:16px}
.pill.up{background:#ffe6e6;color:var(--up);border:1px solid #f3bcbc}
.pill.dn{background:#e6f6e6;color:var(--dn);border:1px solid #b9e0b9}
.pill.flat{background:#f0f0ea;color:#555;border:1px solid #d8d8ce}
.mini{display:block;width:80px;height:22px}
.hold-n{font-family:var(--num);color:#0a246a;font-weight:700}
tr.sel .hold-n{color:#fff}

/* ---------- 账户 ---------- */
.acct-top{display:flex;align-items:flex-end;justify-content:space-between;gap:8px}
.asset-big{display:flex;flex-direction:column;gap:0}
.asset-big .lbl{font-size:11px;color:#6b6b62}
.asset-big strong{font-family:var(--num);font-size:26px;line-height:1.05;color:#0a246a}
.asset-big .pnl{font-family:var(--num);font-size:12px;font-weight:700}
.acct-sub{display:flex;flex-direction:column;gap:1px;font-size:11px;color:#4d4d46;text-align:right}
.acct-sub b{font-family:var(--num);color:#222}

.trade{margin-top:8px;padding-top:7px;border-top:1px solid #d6d2c3}
.trade-head{display:flex;align-items:center;gap:6px;margin-bottom:5px}
.trade-head .lbl{font-size:11px;color:#6b6b62}
.trade-head b{color:#0a246a}
.trade-row{display:flex;align-items:center;gap:5px}
.trade-row input{
  width:78px;height:24px;padding:0 6px;
  background:#fff;border:1px solid #7a7a72;
  box-shadow:inset 1px 1px 2px rgba(0,0,0,.16);
  font-family:var(--num);font-size:13px;
}
.trade-row input:focus{outline:1px dotted #222;outline-offset:-4px}
.unit{color:#6b6b62;font-size:11px}
.qbtns{display:flex;gap:3px;margin-left:auto}
.qbtns button{
  min-width:32px;height:22px;padding:0 6px;
  background:linear-gradient(180deg,#fff,#eeeade);
  border:1px solid #9a968a;border-radius:2px;font-size:11px;
}
.qbtns button:hover{border-color:#3c6fb5;background:#f4f7fd}
.qbtns button:active{box-shadow:inset 1px 1px 2px rgba(0,0,0,.2)}
.trade-btns{display:flex;gap:4px;margin-top:6px}

/* XP 按钮 */
.btn{
  flex:1;height:26px;padding:0 11px;
  background:linear-gradient(180deg,#ffffff 0%,#f4f1e6 50%,#e2ddd0 100%);
  border:1px solid #7f8b8f;border-radius:3px;
  box-shadow:inset 1px 1px 0 #fff, inset -1px -1px 0 #cac6b7;
  font-size:12px;
}
.btn:hover{border-color:#2f6bc0;background:linear-gradient(180deg,#fffef8,#f8f4e6 50%,#e9e3d2)}
.btn:active{box-shadow:inset 1px 1px 3px rgba(0,0,0,.24);background:linear-gradient(180deg,#e6e2d3,#f2efe3)}
.btn:disabled{color:#9a9a90;text-shadow:1px 1px 0 #fff;cursor:default;border-color:#c3bfb1}
.btn-buy{background:linear-gradient(180deg,#fff2f2,#ffdcdc 55%,#f6bcbc);border-color:#b45858;color:#8a1010;font-weight:700}
.btn-buy:hover{background:linear-gradient(180deg,#ffe9e9,#ffd0d0 55%,#f2aeae)}
.btn-sell{background:linear-gradient(180deg,#f1fff1,#d8f2d8 55%,#b6e0b6);border-color:#4f8a4f;color:#0c5c0c;font-weight:700}
.btn-sell:hover{background:linear-gradient(180deg,#e8ffe8,#c9eec9 55%,#a6d8a6)}
.trade-est{margin-top:5px;font-size:11px;color:#5a5a52;font-family:var(--num)}
.trade-est.over{color:#c23b2e}

.holdings{margin-top:7px}
.hold-empty{color:#8a8a80;font-size:11px;padding:5px 0}
.hold-row{
  display:flex;align-items:center;gap:6px;padding:3px 0;
  border-bottom:1px dotted #ddd9ca;font-size:11px;
}
.hold-row:last-child{border-bottom:0}
.hold-row .hname{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hold-row .hqty{font-family:var(--num);color:#0a246a;font-weight:700}
.hold-row .hval{font-family:var(--num);color:#3a3a34;min-width:58px;text-align:right}
.hold-row .hqty.dn{color:#c23b2e}
.hold-row .hval.dn{color:#c23b2e}
.hold-row .short-tag{display:inline-block;margin-left:4px;padding:0 4px;font:700 10px/14px var(--sys);color:#fff;background:#c23b2e;border-radius:2px;vertical-align:1px}


/* ---------- 排行榜 ---------- */
.board{list-style:none;margin:0;padding:0;max-height:230px;overflow:auto}
.board li{
  display:flex;align-items:center;gap:6px;
  padding:3px 2px;border-bottom:1px dotted #dedacb;font-size:12px;
}
.board li:last-child{border-bottom:0}
.board .rk{
  width:18px;height:16px;line-height:16px;text-align:center;
  background:#e8e4d6;border:1px solid #cdc9ba;border-radius:2px;
  font-family:var(--num);font-size:10px;color:#4a4a44;
}
.board li:nth-child(1) .rk{background:#ffe9a8;border-color:#d9b44a;color:#7a5a00}
.board li:nth-child(2) .rk{background:#eef0f4;border-color:#b9bfc7}
.board li:nth-child(3) .rk{background:#f7e2cd;border-color:#d3a87a}
.board .nm{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.board .nm .me-tag{color:#0a246a;font-size:10px;margin-left:3px}
.board .val{font-family:var(--num);font-weight:700}
.board li.me{background:#eaf1fb}
.board li.off .nm{color:#8a8a80}

/* ---------- 公告 ---------- */
.news{flex:1 1 auto;display:flex;flex-direction:column;min-height:80px}
.news ul{list-style:none;margin:0;padding:0;overflow:auto;flex:1;max-height:180px}
.news li{
  display:flex;gap:6px;padding:3px 1px;font-size:11px;line-height:1.4;
  border-bottom:1px dotted #dedacb;
}
.news li:last-child{border-bottom:0}
.news .t{color:#8a8a80;font-family:var(--num);flex:0 0 34px}
.news .txt{flex:1;color:#333}
.news .pct{font-family:var(--num);font-weight:700}
.news li.sys .txt{color:#0a246a}

/* ---------- 状态栏 ---------- */
.statusbar{
  flex:0 0 auto;display:flex;align-items:stretch;gap:2px;
  padding:3px 4px;background:var(--face);border-top:1px solid #b9b5a6;
}
.sb-cell{
  padding:1px 7px;font-size:11px;line-height:17px;color:#333;
  border:1px solid;border-color:#a9a595 #fff #fff #a9a595;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.sb-cell.grow{flex:1;min-width:0}
.sb-cell.grip{width:18px;border:0;color:#8a8a80;text-align:center;padding:0}

/* ---------- 任务栏 ---------- */
.taskbar{
  position:fixed;left:0;right:0;bottom:0;height:calc(var(--bar-h) + var(--safe-b));z-index:50;padding-bottom:var(--safe-b);
  display:flex;align-items:center;gap:5px;
  padding:0 5px 0 0;
  background:linear-gradient(180deg,#4a94f0 0%,#2b6fdc 8%,#1b58c8 45%,#1749a8 92%,#123f97 100%);
  border-top:1px solid #7fb6ff;
  box-shadow:0 -2px 6px rgba(0,0,0,.35);
}
.start{
  height:calc(var(--bar-h) - 4px);padding:0 16px 0 10px;
  display:flex;align-items:center;gap:6px;
  font:italic 700 14px/1 var(--mono);color:#fff;
  text-shadow:1px 1px 1px rgba(0,0,0,.45);
  background:linear-gradient(180deg,#5cc95c 0%,#3aa53a 12%,#2b8b2b 50%,#1f7520 88%,#1a671b 100%);
  border:0;border-radius:0 9px 9px 0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.5), 0 1px 2px rgba(0,0,0,.35);
}
.start b{font-style:normal;font-size:15px}
.start:active{background:linear-gradient(180deg,#1f7520,#2b8b2b)}
.tasks{display:flex;gap:4px;flex:1;min-width:0;overflow:hidden}
.task{
  height:calc(var(--bar-h) - 10px);max-width:240px;
  display:flex;align-items:center;gap:6px;
  padding:0 10px;
  background:linear-gradient(180deg,#4b8fe8,#2a63c4 60%,#1d4ea6);
  border:1px solid #0e3a86;border-radius:2px;
  color:#fff;font-size:11px;white-space:nowrap;overflow:hidden;
  box-shadow:inset 1px 1px 0 rgba(255,255,255,.28);
}
.task.on{background:linear-gradient(180deg,#1d4ea6,#2a63c4 40%,#3a78d8);box-shadow:inset 1px 1px 3px rgba(0,0,0,.45)}
.tray{
  display:flex;align-items:center;gap:8px;height:calc(var(--bar-h) - 6px);
  padding:0 10px;
  background:linear-gradient(180deg,#33a5f0,#1476d4 45%,#0d5fb4);
  border:1px solid #0a4d94;border-radius:2px;
  color:#fff;font-family:var(--num);font-size:11px;
}
.tray-ico{font-size:12px;opacity:.95;cursor:default}
.tray-ico.off{opacity:.35}

/* ---------- 对话框 ---------- */
.modal{
  position:fixed;inset:0;z-index:100;
  display:flex;align-items:center;justify-content:center;
  padding:16px;
  background:rgba(8,22,48,.45);
  backdrop-filter:blur(1px);
}
.modal[hidden]{display:none}
.dlg{
  width:min(430px,100%);
  background:var(--face);
  border:3px solid #0a5bd6;border-top-color:#5aa2f0;
  border-radius:8px 8px 3px 3px;
  box-shadow:0 18px 50px rgba(0,0,0,.55);
  overflow:hidden;
  animation:dlgIn .16s ease-out;
}
.dlg-wide{width:min(560px,100%)}
@keyframes dlgIn{from{transform:scale(.96);opacity:.4}to{transform:none;opacity:1}}
.dlg-body{padding:12px 14px}
.dlg-row{display:flex;gap:12px;align-items:flex-start}
.dlg-ico{font-size:34px;line-height:1}
.dlg-row p{margin:0;font-size:12px;line-height:1.65;color:#333}
.dlg-field{display:flex;align-items:center;gap:6px;margin-top:12px}
.dlg-field span{font-size:12px;color:#333}
.dlg-field input{
  flex:1;height:26px;padding:0 8px;
  background:#fff;border:1px solid #6f7a7f;
  box-shadow:inset 1px 1px 2px rgba(0,0,0,.16);
  font-size:13px;
}
.dlg-field input:focus{outline:1px dotted #222;outline-offset:-4px}
.dlg-err{margin:6px 0 0;color:var(--up);font-size:11px;min-height:14px}
.dlg-foot{
  display:flex;align-items:center;gap:6px;justify-content:flex-end;
  padding:8px 12px;border-top:1px solid #c8c4b5;background:var(--face);
}
.dlg-foot .btn{flex:0 0 auto;min-width:88px}
.dlg-foot .muted{margin-right:auto;font-size:11px}
.help-body h3{margin:10px 0 4px;font-size:12px;color:#0a246a}
.help-body h3:first-child{margin-top:0}
.help-body p,.help-body li{font-size:12px;line-height:1.7;color:#333;margin:0}
.help-body ul{margin:2px 0 0;padding-left:18px}

/* 控制台 */
#ctlModal .dlg-body h3{margin:12px 0 4px;font-size:12px;color:#0a246a}
#ctlModal .dlg-body h3:first-child{margin-top:0}
#ctlModal .dlg-body p{font-size:11px;line-height:1.6;margin:0 0 6px}
.ctl-vol{display:flex;align-items:center;gap:8px;margin:6px 0 8px}
#volRange{flex:1;accent-color:#2f6bc0}
#volOut{min-width:44px;text-align:right;font:bold 14px Consolas,monospace;color:#0a246a}
.ctl-presets{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:4px}
.btn-sm{min-width:0;padding:0 10px;height:24px;font-size:11px}
.btn-danger{
  background:linear-gradient(180deg,#fff4f2,#ffded8 55%,#f5bcb0);
  border-color:#a8564a;color:#7a1710;font-weight:700;
  height:26px;padding:0 14px;
}
.btn-danger:hover{background:linear-gradient(180deg,#ffece8,#ffd2c9 55%,#f0ab9d)}
.tun-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:2px 0 6px}
.tun-row .btn{white-space:nowrap;flex:0 0 auto}
.tun-link{
  font:12px Consolas,monospace;color:#0a4fa8;text-decoration:none;
  flex:1 1 100%;order:3;
  background:#fff;border:1px solid #7a7a72;padding:2px 6px;border-radius:2px;
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.tun-link:hover{text-decoration:underline}
.tun-qr{margin:4px 0 2px}
.tun-qr svg{width:132px;height:132px;background:#fff;padding:5px;border:1px solid #7a7a72;border-radius:2px}
#deadLayer{
  position:fixed;inset:0;z-index:9000;display:flex;align-items:center;justify-content:center;
  background:rgba(10,20,40,.72);backdrop-filter:blur(2px);
}
.dead-box{
  max-width:320px;padding:18px 22px;text-align:center;
  background:var(--face,#ece9d8);border:1px solid #7a7a72;border-radius:3px;
  box-shadow:0 12px 30px rgba(0,0,0,.45),inset 1px 1px 0 #fff;
}
.dead-box h2{margin:0 0 8px;font-size:16px;color:#0a246a}
.dead-box p{margin:0;font-size:12px;line-height:1.7;color:#333}

/* 开奖表格 */
.settle-hero{
  display:flex;align-items:center;gap:10px;
  padding:8px 10px;margin-bottom:8px;
  background:linear-gradient(180deg,#fffbe8,#fff3c9);
  border:1px solid #e2cd8a;border-radius:3px;
}
.settle-hero .big{font-family:var(--num);font-size:22px;font-weight:700;color:#a37200}
.settle-hero .sub{font-size:11px;color:#6b6b62}
.settle-scroll{max-height:240px;overflow:auto;border:1px solid #c9c4b2;background:#fff;margin-bottom:8px}
.settle-table{width:100%;border-collapse:collapse;font-size:12px}
.settle-table th{
  text-align:left;padding:4px 6px;background:linear-gradient(180deg,#fff,#eeeade);
  border-bottom:1px solid #b9b5a6;font-weight:700;
}
.settle-table td{padding:4px 6px;border-bottom:1px dotted #dedacb}
.settle-table td.num{font-family:var(--num);text-align:right;font-weight:700}
.settle-table tr.me td{background:#eaf1fb}
.settle-moves{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0 2px}
.mv{display:inline-flex;align-items:center;gap:4px;padding:1px 6px;font-size:11px;border:1px solid #d8d4c5;background:#fff;border-radius:2px}
.mv b{font-family:var(--num)}

/* ---------- 提示 ---------- */
.toast{
  position:fixed;left:50%;bottom:calc(var(--bar-h) + 16px);transform:translateX(-50%);
  z-index:120;max-width:90vw;
  padding:7px 14px;
  background:#ffffe1;border:1px solid #8f8f88;border-radius:3px;
  box-shadow:2px 2px 6px rgba(0,0,0,.35);
  font-size:12px;color:#1b1b1b;
  animation:toastIn .18s ease-out;
}
.toast[hidden]{display:none}
.toast.bad{background:#ffe9e9;border-color:#c88}
.toast.ok{background:#eaffea;border-color:#8c8}
@keyframes toastIn{from{opacity:0;transform:translate(-50%,6px)}to{opacity:1;transform:translate(-50%,0)}}

/* ============ 窄屏 ============ */
@media (max-width:900px){
  :root{--bar-h:32px}
  .desktop{padding:0}
  .win{
    width:100%;height:calc(100vh - var(--bar-h) - var(--safe-b));height:calc(100dvh - var(--bar-h) - var(--safe-b));
    border-radius:0;border-width:0;
    border-top:2px solid #0a5bd6;
  }
  .titlebar{flex:0 0 26px;height:26px;border-radius:0;font-size:11px}
  .menubar{display:none}
  .toolbar{padding:3px;gap:2px}
  .tbtn{padding:0 7px;height:24px;font-size:11px}
  .tbtn b{display:none}
  .rhythm{display:none}
  .addr{display:none}
  .frame{grid-template-columns:1fr;padding:6px;gap:6px}
  .col-side{gap:6px}
  #chart{height:132px}
  table.grid thead th{padding:4px 5px;font-size:11px}
  table.grid tbody td{padding:6px 5px;font-size:11px}
  .c-code,.c-mini{display:none}
  .c-name{width:40%}
  .c-px{width:82px}
  .c-pct{width:74px}
  .c-hold{width:48px}
  .asset-big strong{font-size:22px}
  .board{max-height:170px}
  .news ul{max-height:130px}
  .taskbar{padding-right:3px}
  .start{padding:0 11px 0 8px;font-size:12px}
  .task{max-width:130px;font-size:10px}
  .tray{padding:0 7px;gap:5px}
  .statusbar .sb-cell{padding:1px 5px;font-size:10px}
  .modal{padding:10px}
  .dlg{max-width:100%;min-width:0}
  .dlg-foot{flex-wrap:wrap;gap:6px}
  .dlg-foot .muted{flex:1 1 100%;margin:0 0 2px}
  .dlg-foot .btn{flex:1 1 46%}
  .settle-scroll{max-height:200px}
}
@media (max-width:420px){
  .c-hold{display:none}
  .chart-foot{gap:8px;font-size:10px}
  .trade-row input{width:64px}
  .qbtns button{min-width:28px;padding:0 4px}
  .dlg-foot .btn{min-width:0;flex:1}
  .settle-hero .big{font-size:19px}
}
@media (max-height:640px){
  #chart{height:110px}
}

/* 减少动态 */
@media (prefers-reduced-motion:reduce){
  *{animation-duration:.01ms!important;transition-duration:.01ms!important}
}

/* ============ 设备适配 · iPhone / Android / Mac / Windows ============ */

/* iOS：输入框字号 < 16px 会自动放大整页 */
@media (max-width:900px){
  input,select,textarea{font-size:16px}
  .trade-row input{height:30px;width:84px}
  .name-row input{height:30px}
  .rhythm select{height:28px;font-size:14px;max-width:150px}
}
@media (max-width:420px){
  .trade-row input{width:74px}
}

/* 触屏：放大可点区域，去掉长按选中 */
@media (pointer:coarse){
  .tbtn{min-height:32px}
  .tb{width:28px;height:22px;font-size:13px}
  table.grid tbody tr{height:36px}
  .qbtns button{min-width:44px;height:28px;font-size:12px}
  .btn{min-height:30px}
  .start{min-width:96px}
  button,.btn,select,.dicon,.task{-webkit-user-select:none;user-select:none}
  .menu-pop button{min-height:34px}
}

/* 滚动更顺、不过度滚动 */
.frame,.board,.news ul,.settle-scroll,.dlg-body{-webkit-overflow-scrolling:touch}
body{overscroll-behavior:none}

/* 弹窗永远能看到底：高屏居中，矮屏可滚 */
.modal{overflow:auto}
.dlg{max-height:calc(100dvh - 32px);display:flex;flex-direction:column;margin:auto}
.dlg-head{flex:0 0 auto}
.dlg-body{flex:1 1 auto;overflow:auto;min-height:0}
.dlg-foot{flex:0 0 auto}

/* Safari 的毛玻璃前缀 */
#deadLayer{-webkit-backdrop-filter:blur(2px)}

/* 横屏手机：压缩头部，让内容露出来 */
@media (max-height:520px){
  .toolbar{padding:2px 3px}
  #chart{height:96px}
  .titlebar{flex:0 0 24px;height:24px}
  .dlg{max-height:calc(100dvh - 12px)}
  .modal{padding:6px}
}

/* 没有鼠标的设备不要 hover 效果（iPad 上会「粘住」） */
@media (hover:none){
  .dicon:hover{border-color:transparent;background:none}
  .btn:hover,.qbtns button:hover{background:linear-gradient(180deg,#fff,#eeeade)}
}

/* 触屏上滚动手势不要触发桌面图标的拖动选择 */
.icons,.titlebar{-webkit-user-select:none;user-select:none}

/* Mac 上滚动条默认浮层，别把表格挤变形 */
@supports (scrollbar-gutter:stable){
  .frame{scrollbar-gutter:stable}
}
/* 控制台里的节奏按钮 */
.rhythm-row{display:flex;gap:6px;margin:2px 0 8px;flex-wrap:wrap}
.rhythm-row .btn{flex:1 1 46%}
.rhythm-row .btn.on{
  background:linear-gradient(180deg,#fff6d8,#ffe9a8);
  border-color:#c9a227;font-weight:700;color:#5a4300;
  box-shadow:inset 0 0 0 1px #ffe9a8;
}
/* iPhone 横屏的刘海：别让内容钻到缺口下面 */
@media (max-width:900px){
  .win{padding-left:env(safe-area-inset-left, 0px);padding-right:env(safe-area-inset-right, 0px)}
}
/* 去掉 iOS 上按钮的 300ms 延迟 */
button,.btn,a,select,label{touch-action:manipulation}
/* 长按不要弹系统菜单 */
.btn,.tbtn,.tb,.qbtns button,.start,.task{-webkit-touch-callout:none}
.pager{
  display:flex;align-items:center;justify-content:flex-end;gap:6px;
  margin-top:6px;font:11px var(--sys);color:#4d4d46;
}
.pager[hidden]{display:none}
.pager .pbtn{
  width:26px;height:20px;line-height:1;
  font:11px/1 var(--sys);cursor:pointer;
  border:1px solid #7a7a72;border-radius:2px;
  background:linear-gradient(180deg,#fdfdfb,#e8e6da);
  box-shadow:inset 0 1px 0 #fff;
}
.pager .pbtn:hover:not(:disabled){background:linear-gradient(180deg,#fffdf0,#f0ecd0)}
.pager .pbtn:active:not(:disabled){background:#e2dfd0;box-shadow:inset 0 1px 2px rgba(0,0,0,.18)}
.pager .pbtn:disabled{opacity:.45;cursor:default}
#pgInfo{min-width:44px;text-align:center;font-weight:700;color:#0a246a}
@media (max-width:900px){.pager .pbtn{width:32px;height:26px}}