/* 德州牌室 — 样式。颜色都在 :root 里，改主题只改这里。 */
:root {
  --bg: #0c1312;
  --panel: #141d1b;
  --panel-2: #1b2824;
  --line: #30423a;
  --text: #f0f4f0;
  --muted: #a8b8b0;
  --accent: #e3c588;
  --accent-ink: #251c0e;
  --win: #5fd29a;
  --loss: #ef7a72;
  --felt-1: #26654f;
  --felt-2: #174936;
  --felt-rim: #121f1b;
  --card: #f7f5ef;
  --card-red: #c8373a;
  --card-black: #1b1f1e;
  --radius: 14px;
  --font: Inter, "PingFang SC", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  --cw: 46px;               /* 公共牌宽 */
  --cw-hero: 56px;          /* 你的手牌宽 */
  --cw-seat: 30px;          /* 对手手牌宽 */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at 50% -10%, #1a2a24 0, var(--bg) 55%) fixed; color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
b, .num { font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; }
button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h2 { font-size: 16px; margin: 0; font-weight: 650; letter-spacing: .2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.win { color: var(--win); } .loss { color: var(--loss); }

#app { max-width: 1080px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
main { flex: 1; padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: rgba(12,19,18,.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 750; font-size: 18px; flex: 1; letter-spacing: .3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark { color: var(--accent); }
.top-bal { display: flex; align-items: baseline; gap: 6px; background: var(--panel); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }
.top-bal span { color: var(--muted); font-size: 12px; }
.top-bal b { color: var(--accent); }
.icon-btn { background: none; border: 0; padding: 6px; margin-left: -6px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { background: var(--panel); }
.sound-btn { margin: 0; color: var(--muted); }
.sound-btn:hover { color: var(--text); }
.sound-btn.off { color: #5d6b65; }

/* 通用面板与按钮 */
.view { padding-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-2); padding: 11px 14px;
  border-radius: 11px; cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s, transform .05s;
  min-height: 44px;
}
.btn:hover { border-color: #35463f; background: #1d2924; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #f0d59d; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--loss); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 7px 12px; font-size: 13.5px; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.spacer { flex: 1; }

/* 大厅 */
#view-home { width: min(100%, 906px); margin-inline: auto; padding-top: clamp(22px, 6vw, 68px); }
#storageBox:empty, #reliefBox:empty, #exportNag:empty { display: none; }
.wallet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wallet-grid div { background: var(--panel-2); border-radius: 10px; padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; }
.wallet-grid span { color: var(--muted); font-size: 12px; }
.wallet-grid b { font-size: 15px; }
.modes { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 14px; }
.mode { padding: clamp(16px, 3vw, 26px); gap: 18px; }
.cash-mode { background: radial-gradient(ellipse at 100% 0, #2b4738, transparent 72%), var(--panel); }
.mode-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.mode-head h2 { font-size: 22px; letter-spacing: .02em; }
.cash-mode h2 { font-size: clamp(27px, 4vw, 34px); }
.mode-cards { width: 68px; height: 48px; position: relative; pointer-events: none; }
.mode-cards .card { --w: 34px; position: absolute; top: 0; }
.mode-cards .card:first-child { right: 27px; transform: rotate(-12deg); }
.mode-cards .card:last-child { right: 3px; transform: rotate(9deg) translateY(3px); }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg button { border: 1px solid var(--line); background: #13231d; border-radius: 10px; padding: 10px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.seg button b { font-size: 12px; color: var(--muted); }
.seg button span { font-size: 11px; color: var(--muted); }
.seg button .blind-value { font-size: clamp(13px, 2.1vw, 19px); color: var(--text); font-weight: 710; font-variant-numeric: tabular-nums; white-space: nowrap; }
.seg button[aria-pressed="true"] { border-color: var(--accent); background: #2c2a1e; }
.seg button[aria-pressed="true"] b, .seg button[aria-pressed="true"] .blind-value { color: var(--accent); }
.cash-mode #sitBtn { min-height: 49px; font-size: 17px; }
.tourney-mode { justify-content: flex-start; }
.lobby-details { padding: 0 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; }
.lobby-details summary { padding: 12px 0; cursor: pointer; color: var(--muted); }
.detail-content { display: grid; gap: 10px; padding-bottom: 14px; }
@media (max-width: 650px) {
  #view-home { gap: 10px; }
  .modes { grid-template-columns: 1fr; gap: 10px; }
  .mode { gap: 13px; }
  .tourney-mode .mode-head { min-height: 28px; }
  .tourney-mode .mode-head h2 { font-size: 17px; }
}
.stepper { display: flex; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.stepper button { width: 38px; height: 36px; border: 0; background: none; font-size: 18px; cursor: pointer; }
.stepper b { min-width: 18px; text-align: center; }
.tourney-list { display: flex; flex-direction: column; gap: 8px; }
.tourney { display: flex; align-items: center; gap: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.tourney .t-main { flex: 1; min-width: 0; }
.tourney .t-main b { display: block; }
.tourney .t-main span { font-size: 12.5px; color: var(--muted); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--panel-2); border-radius: 10px; padding: 9px 10px; }
.stat span { display: block; font-size: 11.5px; color: var(--muted); }
.stat b { font-size: 16px; }
@media (max-width: 560px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.links { display: flex; flex-wrap: wrap; gap: 2px 14px; justify-content: space-between; padding: 0 5px; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 8px 2px; min-height: 42px; font-size: 13px; }
.link:hover { color: var(--text); }
.notice { background: #1e1a10; border: 1px solid #4a3d22; color: #e9d3a0; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; display: flex; align-items: center; gap: 10px; }
.notice .btn { min-height: 34px; padding: 6px 12px; }

/* ---------------- 牌桌 ---------------- */
#view-table { gap: 10px; padding-top: 10px; }
.table-info { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; gap: 10px; padding: 2px 4px; }
.felt-wrap { position: relative; margin: 34px 0 54px; }
.felt {
  position: relative; width: 100%; aspect-ratio: 2 / 1; border-radius: 999px;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255,255,255,.07) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 40%, var(--felt-1) 0%, var(--felt-2) 74%);
  box-shadow:
    inset 0 0 0 8px var(--felt-rim), inset 0 0 0 9px #628777, inset 0 0 48px rgba(0,0,0,.3),
    0 0 0 1px #2e4239, 0 17px 42px rgba(0,0,0,.38);
}
/* 下注线和桌面水印 */
.felt::before { content: ''; position: absolute; inset: 15% 12%; border-radius: inherit; border: 1px solid rgba(255,255,255,.07); pointer-events: none; }
.fxlayer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
@media (max-width: 640px) {
  /* 一屏牌桌：视图占满一屏高度，牌桌区域弹性收缩，操作栏和底部按钮始终可见 */
  #view-table { min-height: calc(100vh - 76px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: calc(100dvh - 76px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .felt-wrap { flex: 1 1 auto; min-height: 260px; margin: 20px 0 52px; display: flex; }
  .felt { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; border-radius: 46% / 34%; }
  .felt::before { inset: 14% 13%; }
  .table-info, .actionbar, #museTurn, #reactionBar, .table-foot { flex-shrink: 0; }
  .table-foot { flex-wrap: wrap; }
  .hint { flex-wrap: wrap; }
  /* 牌桌不局促：公共牌改小、座位牌改窄，左右座位不再压住公共牌 */
  .seat { width: 92px; }
  .plate { min-width: 70px; padding: 5px 7px; }
  :root { --cw: clamp(30px, 8vw, 34px); --cw-hero: 53px; --cw-seat: 26px; }
}
.center { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; width: 92%; }
.board { display: flex; gap: 6px; justify-content: center; min-height: calc(var(--cw) * 1.4); }
.slot { width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: 7px; border: 1px solid rgba(222,252,234,.19); background: rgba(12,37,26,.16); }
.pot { background: #102a20; color: #c4d3ca; padding: 5px 12px; border-radius: 999px; font-size: 12px; display: flex; align-items: center; gap: 8px; border: 1px solid #4b6a5a; }
.pot b { color: var(--accent); font-variant-numeric: tabular-nums; }
.pot.bump { animation: bump .45s ease-out both; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); box-shadow: 0 0 0 4px rgba(216,180,106,.18); } 100% { transform: scale(1); } }
.banner { background: rgba(8,12,10,.82); border: 1px solid #3f3420; color: #f1dfb2; padding: 7px 14px; border-radius: 12px; font-size: 13.5px; text-align: center; max-width: 100%; animation: pop .25s ease-out; }
.banner .win { font-weight: 700; }

/* 牌：左上角点数+花色，右下大花色；对手的小牌只显示居中的点数和花色 */
.card {
  --w: var(--cw);
  width: var(--w); height: calc(var(--w) * 1.4); border-radius: calc(var(--w) * .12);
  background: linear-gradient(160deg, #fffdf8 0%, var(--card) 60%, #ebe6da 100%);
  color: var(--card-black); position: relative; flex: none; user-select: none; line-height: 1; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 3px 8px rgba(0,0,0,.38), 0 0 0 .5px rgba(0,0,0,.25);
}
.card .r { position: absolute; left: 9%; top: 6%; font-weight: 800; font-size: calc(var(--w) * .44); letter-spacing: -.06em; }
.card .s { position: absolute; left: 10%; top: calc(6% + var(--w) * .46); font-size: calc(var(--w) * .3); }
.card .big { position: absolute; right: 8%; bottom: 4%; font-size: calc(var(--w) * .6); opacity: .9; }
.seat:not(.hero) .card .r { position: static; font-size: calc(var(--w) * .5); }
.seat:not(.hero) .card .s { position: static; font-size: calc(var(--w) * .42); margin-top: 1px; }
.seat:not(.hero) .card { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.seat:not(.hero) .card .big { display: none; }
.card.red { color: var(--card-red); }
.card.back {
  background:
    radial-gradient(circle at 50% 50%, rgba(216,180,106,.55) 0 9%, transparent 10%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.06) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.06) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, #2a5a49, #173a2e);
  box-shadow: inset 0 0 0 2px #f1ecdf, inset 0 0 0 4px #173a2e, inset 0 0 0 5px rgba(216,180,106,.5), 0 3px 8px rgba(0,0,0,.38);
}
.card.back.mini { --w: var(--cw-seat); }
.card.hl { box-shadow: 0 0 0 2px var(--accent), 0 2px 8px rgba(0,0,0,.4); }
.card.dim { filter: brightness(.55); }
/* 发牌：从牌桌中心（--dx,--dy）旋转着飞到座位 */
.card.deal { animation: deal .42s cubic-bezier(.2,.75,.25,1) both; }
@keyframes deal {
  0% { transform: translate(var(--dx, 0), var(--dy, -8px)) rotate(-25deg) scale(.55); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
/* 翻牌：沿竖轴翻开 */
.board, .seat .cards { perspective: 600px; }
.card.flip { animation: flip .46s cubic-bezier(.3,.7,.3,1) both; transform-origin: 50% 50%; }
@keyframes flip {
  0% { transform: translateY(-10px) rotateY(90deg) scale(.9); filter: brightness(.5); opacity: 0; }
  1% { opacity: 1; }
  60% { transform: translateY(-3px) rotateY(-8deg) scale(1.03); filter: brightness(1.1); }
  100% { transform: none; filter: none; opacity: 1; }
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* 座位 */
.seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; width: 110px; z-index: 2; transition: opacity .2s; }
.seat .cards { display: flex; gap: 3px; height: calc(var(--cw-seat) * 1.4); }
.seat .cards .card { --w: var(--cw-seat); }
.seat.hero .cards { height: calc(var(--cw-hero) * 1.4); gap: 5px; }
.seat.hero .cards .card { --w: var(--cw-hero); }
.plate { background: linear-gradient(180deg, rgba(24,32,28,.95), rgba(9,13,11,.95)); border: 1px solid var(--line); border-radius: 12px; padding: 5px 10px; min-width: 92px; text-align: center; position: relative; box-shadow: 0 6px 16px rgba(0,0,0,.35); transition: border-color .2s; }
.plate .stk.allin { color: var(--loss); letter-spacing: 1px; }
.plate .nm { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.plate .nm .tag { color: var(--muted); font-size: 11px; margin-left: 4px; }
.plate .stk { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.seat.acting .plate { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(227,197,136,.22), 0 5px 15px rgba(0,0,0,.38); }
.seat.folded { opacity: .42; }
.seat.out { opacity: .25; }
.seat.winner .plate { border-color: var(--win); animation: winglow 1.4s ease-in-out 2 both; box-shadow: 0 0 0 3px rgba(95,210,154,.2); }
@keyframes winglow { 0%,100% { box-shadow: 0 0 0 3px rgba(95,210,154,.2); } 50% { box-shadow: 0 0 0 7px rgba(95,210,154,.28), 0 0 30px rgba(95,210,154,.35); } }
.seat.winner .cards .card:not(.back) { box-shadow: 0 0 0 2px rgba(95,210,154,.85), 0 4px 12px rgba(0,0,0,.4); }
.seat .lastact.pop { animation: pop .25s ease-out; }
.seat .lastact { position: absolute; top: -18px; font-size: 11.5px; background: rgba(0,0,0,.6); padding: 1px 8px; border-radius: 999px; white-space: nowrap; color: #dfe7e2; }
.seat .lastact.raise { color: var(--accent); }
.seat .lastact.fold { color: var(--muted); }
.seat .handname { font-size: 11.5px; color: var(--accent); white-space: nowrap; }
.dealer { position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #f3efe4; color: #222; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.5); z-index: 3; transform: translate(-50%, -50%); }
.chipbet { position: absolute; transform: translate(-50%, -50%); font-size: 12.5px; font-weight: 700; background: rgba(0,0,0,.45); border-radius: 999px; padding: 2px 9px 2px 4px; display: flex; align-items: center; gap: 5px; z-index: 1; font-variant-numeric: tabular-nums; }
/* 筹码：外圈条纹 + 内圈 */
.chip {
  --c: var(--accent); --e: #f4ecd8;
  display: block; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0 38%, rgba(0,0,0,.35) 39% 44%, transparent 45%), repeating-conic-gradient(var(--c) 0 30deg, var(--e) 30deg 45deg);
  box-shadow: 0 1px 0 rgba(0,0,0,.5), inset 0 0 0 1px rgba(0,0,0,.25);
}
.chip.c1 { --c: #c8463f; } .chip.c2 { --c: #3b6fb6; }
.chipbet .stack { position: relative; width: 14px; height: 20px; display: block; }
.chipbet .stack .chip { position: absolute; left: 0; }
.fly { position: absolute; z-index: 7; will-change: transform, opacity; }
.fly .chip { width: 15px; height: 15px; }
.floattext { position: absolute; z-index: 8; font-weight: 800; font-size: 17px; color: var(--win); text-shadow: 0 2px 6px rgba(0,0,0,.7); white-space: nowrap; font-variant-numeric: tabular-nums; }
.floattext.hero { font-size: 21px; color: #ffe39a; }

/* 操作栏 */
.actionbar { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 70px; justify-content: center; }
.actionbar .btnrow { animation: rise .22s ease-out; }
@keyframes rise { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.actionbar .waiting { color: var(--muted); text-align: center; font-size: 14px; }
.btnrow { display: grid; grid-template-columns: 1fr 1.2fr 1.2fr; gap: 8px; }
.btnrow .btn { min-height: 50px; font-size: 15.5px; }
.btn.fold { color: #f0b1ab; }
.btn.raise { border-color: #6a6048; color: var(--accent); background: #24291f; }
.btn.raise:hover, .btn.raise[aria-expanded="true"] { border-color: var(--accent); background: #323025; }
.hint { display: flex; gap: 8px; justify-content: center; font-size: 12.5px; color: var(--muted); }
.hint b { color: var(--text); }
.raisebox { display: flex; flex-direction: column; gap: 8px; }
.presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.presets button { border: 1px solid var(--line); background: var(--panel-2); border-radius: 9px; padding: 7px 2px; cursor: pointer; font-size: 13px; }
.presets button:hover { border-color: var(--accent); }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--accent); height: 30px; }
.slider-row .amt { min-width: 80px; text-align: right; font-weight: 750; color: var(--accent); font-size: 17px; }
.table-foot { display: flex; gap: 8px; align-items: center; }
.handlog { font-size: 13px; gap: 4px; max-height: 280px; overflow: auto; }
.handlog .st { color: var(--accent); margin-top: 6px; font-weight: 600; }
.handlog div { line-height: 1.5; }

/* 列表页 */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.item-top { display: flex; align-items: center; gap: 10px; }
.item-top .grow { flex: 1; min-width: 0; }
.minicards { display: inline-flex; gap: 3px; vertical-align: middle; }
.mc { display: inline-block; background: var(--card); color: var(--card-black); border-radius: 4px; padding: 1px 4px; font-size: 12.5px; font-weight: 700; line-height: 1.35; }
.mc.red { color: var(--card-red); }
.item details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.item pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; margin: 8px 0 0; color: #cfd8d3; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.setting label { flex: 1; }
.setting small { display: block; color: var(--muted); font-size: 12px; }
select, input[type=number], input[type=text] { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font: inherit; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #2a3632; border-radius: 999px; transition: .2s; pointer-events: none; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.switch span::after { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #dfe6e2; transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); background: #fff; }

/* 弹窗与提示 */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; }
.modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; animation: pop .2s ease-out; }
.modal .box h3 { margin: 0; font-size: 17px; }
.modal .box p { margin: 0; color: #c9d3ce; font-size: 14px; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #22302a; border: 1px solid #34453e; padding: 10px 16px; border-radius: 12px; z-index: 60; font-size: 14px; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.notice.warn { background: #2a1414; border-color: #6b2c2a; color: #f3c4bf; }

/* 系统开了"减少动态效果"时，关掉所有动画 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
