/* DeonGame 公共样式（以原型第 3 轮为底稿） */
* { box-sizing: border-box; }
:root {
  --bg: #0f1420; --panel: #182033; --panel2: #1f2940; --line: #2c3854;
  --text: #e8ecf5; --muted: #93a0bb; --brand: #f5b942; --brand2: #e59a17;
  --ok: #3ccf7e; --bad: #ff5d5d; --info: #4ea3ff; --tbd: #ff9f1c;
}
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif; font-size: 14px; }
a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--panel2);
  color: var(--text); padding: 8px 16px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover, button:hover { filter: brightness(1.15); text-decoration: none; }
.btn-primary { background: linear-gradient(180deg, var(--brand), var(--brand2)); color: #1b1300; border: none; font-weight: 600; }
.btn-danger { background: #5a1f27; border-color: #82303b; }
.btn-ok { background: #1d5a3a; border-color: #2b8255; }
.btn[disabled], button[disabled] { opacity: .45; cursor: not-allowed; filter: none; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
input, select { font: inherit; background: #0c111c; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--brand); border-color: transparent; }
input.err { border-color: var(--bad); }
.field { margin-bottom: 14px; }
.field label { display: block; color: var(--muted); margin-bottom: 6px; font-size: 13px; }
.field .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.field .msg { color: var(--bad); font-size: 12px; margin-top: 4px; }
.muted { color: var(--muted); }
.neg { color: var(--bad); }
.pos { color: var(--ok); }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.alert-err { background: #3a1518; border: 1px solid #7c2b33; color: #ffb3b3; }
.alert-ok { background: #12321f; border: 1px solid #2b8255; color: #a8f0c6; }
.alert-info { background: #13263f; border: 1px solid #285a94; color: #b9dbff; }
.alert-warn { background: #3a2a10; border: 1px solid #8a6420; color: #ffd99a; }
.badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); }
.badge-ok { color: var(--ok); border-color: #2b8255; }
.badge-busy { color: var(--tbd); border-color: #8a6420; }
.badge-full { color: var(--muted); }

/* 顶栏 */
.topbar { height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: #121a2a; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: 1px; color: var(--brand); }
.logo span { color: var(--text); }
.wallet { display: flex; gap: 14px; align-items: center; }
.wallet .w { background: var(--panel2); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; font-size: 13px; }
.wallet .w b { margin-left: 4px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#4ea3ff,#7a5cff);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex: none; }
.user-menu { position: relative; }
.user-menu .dropdown { display: none; position: absolute; right: 0; top: 46px; width: 260px; z-index: 30; }
.user-menu.open .dropdown { display: block; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(4,7,14,.7); display: none; align-items: center; justify-content: center; z-index: 50; }
.mask.show { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 440px; max-width: 92vw; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.modal h3 { margin: 0 0 14px; font-size: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 提示条 */
.toast { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); background: #26314b; border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 8px; z-index: 80; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.toast.err { background: #4a1a20; border-color: #82303b; }

/* 窄屏（手机）适配 */
html, body { overflow-x: hidden; }
.wallet .w, .wallet .w b { white-space: nowrap; }
@media (max-width: 720px) {
  .topbar { padding: 0 10px; gap: 8px; height: 52px; }
  .logo { font-size: 16px; }
  .topbar .crumb, .topbar .uname, .wallet .lbl { display: none; }
  .wallet { gap: 6px; flex: none; }
  .wallet .w { padding: 3px 8px; font-size: 12px; }
  .user-menu > button { padding: 2px !important; }
  .avatar { width: 30px; height: 30px; }
  .user-menu .dropdown { width: min(260px, 90vw); }
  .toast { top: 62px; max-width: 90vw; }
}
.layout > * { min-width: 0; }

/* 实现补充：无障碍与通用状态 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.user-menu .dropdown .btn { width: 100%; justify-content: center; }
.loading { color: var(--muted); padding: 30px; text-align: center; }
dialog.modal { color: var(--text); }
.mask .modal { margin: 0; }
