/* 传话筒 · 两套皮肤：清透（glass）与终端（term）。同一套 DOM，靠 [data-skin] 切换。 */

/* ───────── 皮肤变量 ───────── */
:root, [data-skin="glass"] {
  --font: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --bg: #f4f2fb;
  --text: #1e293b;
  --muted: #64748b;
  --dim: #94a3b8;
  --panel: rgba(255, 255, 255, 0.52);
  --panel-border: rgba(255, 255, 255, 0.75);
  --panel-shadow: 0 20px 50px rgba(100, 116, 139, 0.10), inset 0 1px 1px rgba(255, 255, 255, 0.8);
  --radius: 24px;
  --accent: #5b63d8;
  --accent-2: #8b7cf6;
  --accent-text: #fff;
  --chip: rgba(255, 255, 255, 0.6);
  --theirs: rgba(255, 255, 255, 0.78);
  --mine: linear-gradient(135deg, #6470ea, #8b7cf6);
  --line: rgba(100, 116, 139, 0.16);
  --ok: #10b981;
  --warn: #f59e0b;
  --board: rgba(255, 255, 255, 0.55);
  --grid: rgba(71, 85, 105, 0.35);
}
[data-skin="term"] {
  --font: "JetBrains Mono", "SF Mono", Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  --bg: #0d1117;
  --text: #c9d1d9;
  --muted: #8b949e;
  --dim: #484f58;
  --panel: #0d1117;
  --panel-border: #21262d;
  --panel-shadow: none;
  --radius: 6px;
  --accent: #d29922;
  --accent-2: #e3b341;
  --accent-text: #0d1117;
  --chip: #161b22;
  --line: #21262d;
  --ok: #3fb950;
  --warn: #d29922;
  --blue: #58a6ff;
  --purple: #bc8cff;
  --red: #f85149;
  --board: #0a0d12;
  --grid: #30363d;
}

/* 两套文案：.g 给清透，.t 给终端 */
[data-skin="glass"] .t, [data-skin="term"] .g { display: none !important; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.55 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.dim { color: var(--dim); }

/* ───────── 背景 ───────── */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
[data-skin="glass"] .bg {
  background:
    radial-gradient(60% 50% at 10% 10%, #e3e0ff 0%, transparent 70%),
    radial-gradient(50% 50% at 90% 20%, #ffe4dc 0%, transparent 70%),
    radial-gradient(60% 60% at 70% 95%, #dbeeff 0%, transparent 70%),
    #f6f4fc;
}
[data-skin="glass"] .bg i {
  position: absolute; width: 42vmax; height: 42vmax; border-radius: 50%;
  filter: blur(70px); opacity: 0.55; animation: drift 26s ease-in-out infinite alternate;
}
.bg i:nth-child(1) { background: #c7c3ff; left: -10vmax; top: -8vmax; }
.bg i:nth-child(2) { background: #ffd1c2; right: -12vmax; top: 10vmax; animation-delay: -9s; }
.bg i:nth-child(3) { background: #bfe3ff; left: 30vmax; bottom: -16vmax; animation-delay: -17s; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.12); } }
[data-skin="term"] .bg {
  background-color: #0d1117;
  background-image:
    linear-gradient(to right, rgba(46, 160, 67, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(46, 160, 67, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
}
[data-skin="term"] .bg i { display: none; }

/* ───────── 通用部件 ───────── */
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--panel-shadow);
}
[data-skin="glass"] .panel { backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); }

.btn, .primary {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border-radius: 999px; padding: 7px 14px; border: 1px solid var(--panel-border);
  background: var(--chip); transition: transform .12s, background .2s, border-color .2s;
}
.btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.9); }
.btn:active:not(:disabled), .primary:active:not(:disabled) { transform: scale(0.97); }
.primary { background: var(--accent); color: var(--accent-text); border-color: transparent; font-weight: 600; }
[data-skin="glass"] .primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px rgba(91, 99, 216, 0.28); }
.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.on { background: var(--accent); color: var(--accent-text); }
kbd { font: 11px/1 var(--font); padding: 2px 5px; border-radius: 4px; border: 1px solid var(--line); opacity: .8; }

[data-skin="term"] .btn, [data-skin="term"] .primary { border-radius: 4px; padding: 4px 10px; font-size: 12px; }
[data-skin="term"] .btn { background: #161b22; border-color: #30363d; }
[data-skin="term"] .btn:hover:not(:disabled) { background: #21262d; }
[data-skin="term"] .primary { background: rgba(210, 153, 34, 0.15); color: var(--accent-2); border: 1px solid rgba(210, 153, 34, 0.45); box-shadow: none; }
[data-skin="term"] .primary:hover:not(:disabled) { background: rgba(210, 153, 34, 0.25); filter: none; }

.skin { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--chip); border: 1px solid var(--panel-border); }
.skin button { border: 0; background: transparent; border-radius: 999px; padding: 4px 12px; color: var(--muted); }
.skin button.on { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 2px 8px rgba(91, 99, 216, 0.15); }
[data-skin="term"] .skin { border-radius: 4px; background: #161b22; border-color: #30363d; font-size: 12px; padding: 2px 6px; }
[data-skin="term"] .skin button { border-radius: 3px; padding: 1px 6px; }
[data-skin="term"] .skin button::before { content: "["; } [data-skin="term"] .skin button::after { content: "]"; }
[data-skin="term"] .skin button.on { background: #21262d; color: var(--ok); box-shadow: none; }
[data-skin="term"] .skin button.on::after { content: "●]"; }

/* ───────── 顶栏 ───────── */
.top {
  height: 68px; display: flex; align-items: center; gap: 16px; padding: 0 24px;
}
.brand { font-weight: 700; font-size: 20px; letter-spacing: .02em; display: flex; align-items: center; gap: 10px; }
[data-skin="glass"] .brand .g { background: linear-gradient(135deg, #4953bc, #a43073); -webkit-background-clip: text; background-clip: text; color: transparent; }
.peer { flex: 1; min-width: 0; display: flex; }
.peer > .g { display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; background: var(--chip); border: 1px solid var(--panel-border); }
.peer .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #f9a8d4, #a5b4fc); }
.peer .pn { display: flex; flex-direction: column; line-height: 1.25; }
.peer small { color: var(--muted); font-size: 12px; }
.peer i.on { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 5px; vertical-align: 1px; box-shadow: 0 0 0 3px rgba(16, 185, 129, .18); }
.actions { display: flex; align-items: center; gap: 8px; position: relative; }
.actions .dot { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
#gamesBtn { position: relative; }

[data-skin="term"] .top { height: 44px; padding: 0 12px; background: #010409; border-bottom: 1px solid #21262d; gap: 12px; font-size: 12px; }
[data-skin="term"] .brand { font-size: 12px; font-weight: 400; align-self: stretch; }
.ide-tabs { display: flex; align-self: stretch; }
.ide-tabs > * { display: flex; align-items: center; padding: 0 14px; border-right: 1px solid #21262d; color: var(--dim); font-weight: 400; }
.ide-tabs b { color: var(--text); background: #0d1117; border-top: 2px solid #f78166; font-weight: 400; }
.ide-tabs em { color: var(--muted); font-style: normal; margin-left: 6px; }
[data-skin="term"] .peer { justify-content: flex-end; }
[data-skin="term"] .peer > .t { padding: 3px 10px; border: 1px solid #30363d; border-radius: 4px; background: #0d1117; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-skin="term"] .peer b { color: var(--text); font-weight: 400; }
[data-skin="term"] .peer i.on { box-shadow: none; background: var(--ok); }
[data-skin="term"] #poke { color: var(--warn); }
.boss .t { color: var(--red); }
[data-skin="term"] .boss { border-color: rgba(248, 81, 73, .4); }

/* ───────── 布局 ───────── */
.layout {
  height: calc(100dvh - 68px); padding: 0 24px 24px; display: grid; gap: 20px;
  grid-template-columns: minmax(0, 1.6fr) minmax(360px, 1fr);
}
[data-skin="term"] .layout { height: calc(100dvh - 44px); padding: 0; gap: 0; }
.chat { display: flex; flex-direction: column; min-height: 0; overflow: hidden; position: relative; }
.chat > :not(.thread) { flex-shrink: 0; }
.thread { min-height: 0; }
[data-skin="term"] .chat { border: 0; border-right: 1px solid #21262d; border-radius: 0; }
.games { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 18px; gap: 14px; }
[data-skin="term"] .games { border: 0; border-radius: 0; background: #0d1117; padding: 14px; }

/* ───────── 留言流 ───────── */
.thread { flex: 1; overflow-y: auto; padding: 22px 26px 12px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.empty { text-align: center; margin: auto; }
.m { display: flex; flex-direction: column; max-width: 74%; }
.m.mine { align-self: flex-end; align-items: flex-end; }
.m.theirs { align-self: flex-start; align-items: flex-start; }
.m .ts, .m .who, .sys .ts { display: none; }
.body { padding: 10px 16px; border-radius: 22px 22px 22px 6px; background: var(--theirs); border: 1px solid var(--panel-border); white-space: pre-wrap; word-break: break-word; box-shadow: 0 6px 22px rgba(129, 140, 248, .08); }
.mine .body { border-radius: 22px 22px 6px 22px; background: var(--mine); color: #fff; border-color: transparent; box-shadow: 0 8px 22px rgba(100, 112, 234, .25); }
.body.stk, .mine .body.stk { background: var(--chip); color: var(--text); border: 1px solid var(--panel-border); display: flex; flex-direction: column; align-items: center; padding: 14px 22px 10px; border-radius: 26px; }
.stk .se { font-size: 58px; line-height: 1.1; }
.stk .sl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.body.dr, .mine .body.dr { background: var(--chip); color: var(--text); border: 1px solid var(--panel-border); padding: 12px; border-radius: 22px; box-shadow: 0 6px 22px rgba(129, 140, 248, .08); }
.st { font-size: 11.5px; color: var(--muted); margin-top: 4px; padding: 0 6px; }
.sys { align-self: center; font-size: 12.5px; color: var(--muted); background: var(--chip); border: 1px solid var(--panel-border); padding: 4px 14px; border-radius: 999px; display: flex; flex-direction: column; align-items: center; }
.sys .st { margin: 0; padding: 0; font-size: 11px; }
.divider { align-self: stretch; display: flex; align-items: center; gap: 12px; color: var(--accent); font-size: 12px; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(91, 99, 216, .35), transparent); }

.card { width: 260px; }
.card .ch { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; color: var(--accent); }
.card img { width: 100%; aspect-ratio: 1; border-radius: 14px; background: #fff; display: block; border: 1px solid var(--line); }
.card .cf { margin-top: 8px; font-size: 13px; }
.guess { display: flex; gap: 6px; }
.guess input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: rgba(255, 255, 255, .8); outline: none; }
.guess .primary, .guess .btn { padding: 6px 12px; }

/* 终端皮肤：留言变成日志行 */
[data-skin="term"] .thread { padding: 12px 18px; gap: 6px; font-size: 13px; scroll-behavior: auto; }
[data-skin="term"] .m { max-width: none; align-self: stretch; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding: 2px 6px; margin: 0 -6px; border-radius: 4px; }
[data-skin="term"] .m:hover { background: rgba(22, 27, 34, .6); }
[data-skin="term"] .m .ts, [data-skin="term"] .m .who, [data-skin="term"] .sys .ts { display: inline; }
[data-skin="term"] .ts { color: var(--dim); }
[data-skin="term"] .who { color: var(--blue); font-weight: 600; }
[data-skin="term"] .mine .who { color: var(--ok); }
[data-skin="term"] .body, [data-skin="term"] .mine .body { padding: 0; background: none; border: 0; box-shadow: none; color: var(--text); border-radius: 0; }
[data-skin="term"] .st { margin: 0; padding: 0; color: var(--dim); font-size: 11.5px; }
[data-skin="term"] .body.stk, [data-skin="term"] .body.dr { flex-basis: 100%; margin: 4px 0 2px; padding: 8px 10px; border: 1px solid #30363d; background: #161b22; border-radius: 6px; flex-direction: row; gap: 10px; align-items: center; width: fit-content; box-shadow: none; }
[data-skin="term"] .stk .se { font-size: 28px; }
[data-skin="term"] .stk .sl { margin: 0; color: var(--warn); }
[data-skin="term"] .stk .sl::before { content: "STICKER::"; color: var(--dim); }
[data-skin="term"] .sys { align-self: stretch; background: none; border: 0; border-radius: 0; padding: 2px 6px; flex-direction: row; gap: 8px; align-items: baseline; color: var(--warn); font-size: 13px; }
[data-skin="term"] .sys.ping { border-left: 2px solid var(--warn); background: rgba(210, 153, 34, .06); }
[data-skin="term"] .sys .tag { color: var(--warn); font-weight: 600; }
[data-skin="term"] .divider { color: var(--muted); }
[data-skin="term"] .divider::before, [data-skin="term"] .divider::after { display: none; }
[data-skin="term"] .divider { justify-content: center; }
.sysline { color: var(--dim); font-size: 12.5px; }
[data-skin="term"] .card { width: 240px; }
[data-skin="term"] .card .ch { color: var(--purple); font-weight: 400; }
[data-skin="term"] .card img, [data-skin="term"] #cv { filter: invert(.88) hue-rotate(180deg); border-radius: 4px; border-color: #30363d; }
[data-skin="term"] .guess input { border-radius: 4px; background: #0d1117; border-color: #30363d; }

/* ───────── 提醒条、输入框 ───────── */
.banner { margin: 14px 18px 0; padding: 10px 40px 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, .7); border: 1px solid var(--panel-border); font-size: 13px; position: relative; color: var(--muted); }
.banner .x, .gtabs .x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 20px; color: var(--muted); }
[data-skin="term"] .banner { border-radius: 4px; background: #161b22; border-color: #30363d; color: var(--muted); }

.notify { margin: 0 18px 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 18px; border-radius: 18px; background: rgba(255, 255, 255, .72); border: 1px solid var(--panel-border); box-shadow: 0 8px 26px rgba(91, 99, 216, .10); }
.notify > .g, .notify > .t { flex: 1; min-width: 150px; }
.notify b { color: var(--accent); }
.notify .quota { font-size: 12px; }
[data-skin="term"] .notify { border-radius: 4px; background: rgba(210, 153, 34, .08); border-color: rgba(210, 153, 34, .35); box-shadow: none; color: var(--accent-2); margin: 0 12px 8px; }

.composer { position: relative; margin: 0 18px 8px; display: flex; align-items: flex-end; gap: 6px; padding: 6px 6px 6px 8px; border-radius: 28px; background: rgba(255, 255, 255, .7); border: 1.5px solid var(--panel-border); }
.composer:focus-within { box-shadow: 0 0 0 3px rgba(199, 210, 254, .5); }
.composer textarea { flex: 1; border: 0; outline: none; background: transparent; resize: none; padding: 9px 4px; max-height: 160px; line-height: 1.5; }
.composer .icon { border: 0; background: transparent; font-size: 20px; width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.composer .icon:hover { background: rgba(91, 99, 216, .08); }
.send { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; border: 0; color: #fff; font-size: 17px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 16px rgba(91, 99, 216, .35); }
.hintchip { text-align: center; font-size: 11.5px; padding: 0 0 12px; }
[data-skin="term"] .composer { margin: 0; border-radius: 0; border: 0; border-top: 1px solid #21262d; background: #010409; align-items: center; padding: 6px 12px; gap: 8px; }
[data-skin="term"] .composer:focus-within { box-shadow: none; }
[data-skin="term"] .composer .prompt { color: var(--ok); font-weight: 700; }
[data-skin="term"] .composer textarea { padding: 6px 0; font-size: 13px; }
[data-skin="term"] .composer .icon { width: auto; height: auto; font-size: 12px; padding: 3px 8px; border: 1px solid #30363d; border-radius: 4px; color: var(--muted); }
[data-skin="term"] .send { width: auto; height: auto; border-radius: 4px; padding: 4px 10px; font-size: 12px; background: #161b22; border: 1px solid #30363d; color: var(--text); box-shadow: none; }
[data-skin="term"] .hintchip { display: none; }

.picker { position: absolute; bottom: calc(100% + 10px); left: 0; width: min(380px, calc(100vw - 32px)); padding: 10px; z-index: 30; background: rgba(255, 255, 255, .92); }
.ptabs { display: flex; gap: 4px; margin-bottom: 8px; }
.ptabs button { border: 0; background: none; padding: 4px 12px; border-radius: 999px; color: var(--muted); }
.ptabs button.on { background: rgba(91, 99, 216, .12); color: var(--accent); font-weight: 600; }
.pgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; max-height: 260px; overflow-y: auto; }
.pgrid.emo { grid-template-columns: repeat(8, 1fr); }
.stkb { border: 0; border-radius: 16px; background: rgba(241, 245, 249, .8); padding: 8px 2px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stkb span { font-size: 28px; line-height: 1.1; }
.stkb small { font-size: 11px; color: var(--muted); }
.stkb:hover, .emob:hover { background: rgba(91, 99, 216, .12); }
.emob { border: 0; background: none; font-size: 22px; padding: 4px 0; border-radius: 8px; }
[data-skin="term"] .picker { background: #161b22; border-color: #30363d; left: 12px; }
[data-skin="term"] .stkb { background: #0d1117; border-radius: 4px; }
[data-skin="term"] .ptabs button.on { background: #21262d; color: var(--ok); }

/* ───────── 游戏面板 ───────── */
.gtabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .5); border: 1px solid var(--panel-border); position: relative; flex-shrink: 0; }
.gtabs [data-tab] { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 999px; color: var(--muted); }
.gtabs [data-tab].on { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 2px 10px rgba(91, 99, 216, .12); }
[data-skin="term"] .gtabs { border-radius: 0; background: none; border: 0; border-bottom: 1px solid #21262d; padding: 0; gap: 0; }
[data-skin="term"] .gtabs [data-tab] { flex: none; border-radius: 0; padding: 8px 14px; font-size: 12.5px; }
[data-skin="term"] .gtabs [data-tab].on { background: none; color: var(--text); box-shadow: inset 0 -2px 0 #f78166; font-weight: 400; }

.gpanel { display: flex; flex-direction: column; gap: 12px; }
.gohead, .drawhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.turn { padding: 6px 14px; border-radius: 999px; background: var(--chip); border: 1px solid var(--panel-border); font-weight: 600; font-size: 13px; }
.turn.mine { background: rgba(91, 99, 216, .12); color: var(--accent); }
.score { font-weight: 600; font-size: 13px; color: var(--muted); }
[data-skin="term"] .turn { border-radius: 4px; background: #161b22; border-color: #30363d; font-weight: 400; }
[data-skin="term"] .turn.mine { color: var(--ok); background: rgba(63, 185, 80, .08); }
[data-skin="term"] .score { font-weight: 400; }

.board-wrap { width: 100%; max-width: 520px; align-self: center; }
#board { width: 100%; display: block; cursor: pointer; touch-action: manipulation; }
#board .bd { fill: var(--board); stroke: var(--panel-border); stroke-width: .05; }
#board .grid line { stroke: var(--grid); stroke-width: .035; }
#board .star { fill: var(--grid); }
#board .stone.black { fill: #1e1b2e; filter: drop-shadow(0 .08px .12px rgba(0, 0, 0, .35)); }
#board .stone.white { fill: #fff; stroke: #cbd5e1; stroke-width: .04; filter: drop-shadow(0 .08px .12px rgba(0, 0, 0, .2)); }
#board .last { fill: #ef4444; }
[data-skin="glass"] #board .stone.black { fill: #2b2d52; }
[data-skin="term"] #board .stone.black { fill: #c9d1d9; filter: none; }
[data-skin="term"] #board .stone.white { fill: #0d1117; stroke: #8b949e; stroke-width: .06; filter: none; }
[data-skin="term"] #board .last { fill: var(--red); }
.gobtns { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; }
.gobtns > * { justify-content: center; }

.word { font-size: 14px; }
.word b { color: var(--accent); font-size: 16px; }
#cv { width: 100%; max-width: 520px; align-self: center; aspect-ratio: 1; border-radius: 18px; background: #fff; border: 1px solid var(--line); touch-action: none; cursor: crosshair; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.colors, .sizes { display: flex; gap: 5px; }
.sw { width: 24px; height: 24px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); padding: 0; }
.sw.on { box-shadow: 0 0 0 2px var(--accent); }
.sz { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--chip); display: grid; place-items: center; padding: 0; }
.sz i { width: var(--s); height: var(--s); border-radius: 50%; background: var(--text); }
.sz.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tools .btn { padding: 5px 12px; font-size: 13px; }
.wide { width: 100%; justify-content: center; padding: 11px; }

/* ───────── 点背景特效 ───────── */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
#fx .rip { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid rgba(139, 124, 246, .7); animation: rip 1.3s ease-out forwards; }
#fx .rip.peer { border-color: rgba(244, 114, 182, .75); }
@keyframes rip { to { transform: scale(9); opacity: 0; } }
#fx .heart { position: absolute; font-style: normal; font-size: 20px; animation: float 1.7s ease-out forwards; opacity: 0; }
@keyframes float { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), -120px) scale(1.15); } }
[data-skin="term"] #fx .rip { border-radius: 2px; border: 1px solid rgba(63, 185, 80, .7); }
[data-skin="term"] #fx .rip.peer { border-color: rgba(88, 166, 255, .8); }
[data-skin="term"] #fx .heart { color: var(--ok); font-size: 16px; }

body.shake .layout { animation: shake .6s; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px) rotate(-.4deg); } 40% { transform: translateX(6px) rotate(.4deg); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

#toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60; padding: 9px 18px; border-radius: 999px; background: rgba(30, 41, 59, .88); color: #fff; font-size: 13px; transition: .25s; max-width: calc(100vw - 32px); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
[data-skin="term"] #toast { border-radius: 4px; background: #161b22; border: 1px solid #30363d; color: var(--text); }

/* ───────── 身份相关显示 ───────── */
.app:not(.role-me) .me-only, .app:not(.role-friend) .friend-only { display: none !important; }
.mobile-only { display: none !important; }

/* ───────── 老板键 ───────── */
#bossScreen { position: fixed; inset: 0; z-index: 100; background: #fff; color: #1f2937; font: 13px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif; overflow: auto; }
.nb-top { display: flex; align-items: center; gap: 14px; padding: 10px 18px; border-bottom: 1px solid #e5e7eb; }
.nb-top b { color: #f37726; font-size: 18px; }
.nb-top span { font-size: 16px; }
.nb-top em { color: #6b7280; font-style: normal; font-size: 12px; }
.nb-k { margin-left: auto; font-size: 12px !important; color: #6b7280; }
.nb-menu { display: flex; gap: 18px; padding: 6px 18px; border-bottom: 1px solid #e5e7eb; color: #374151; font-size: 13px; }
.nb-body { max-width: 1000px; margin: 18px auto; padding: 0 24px; }
.nb-cell { display: flex; gap: 10px; margin: 10px 0; }
.nb-cell.active pre { border-color: #42a5f5; }
.nb-in { color: #307fc1; font-family: Menlo, monospace; font-size: 12px; width: 44px; flex-shrink: 0; padding-top: 9px; text-align: right; }
.nb-cell pre { flex: 1; margin: 0; padding: 8px 10px; background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 2px; font: 12.5px/1.5 Menlo, Consolas, monospace; white-space: pre-wrap; }
.nb-out { margin: 4px 0 14px 54px; }
.nb-chart { width: 100%; max-width: 640px; }
.nb-table { border-collapse: collapse; font: 12px Menlo, monospace; }
.nb-table th, .nb-table td { padding: 4px 12px; text-align: right; border-bottom: 1px solid #eee; }
.nb-table tr:nth-child(even) td { background: #f9fafb; }

/* ───────── 解锁页 ───────── */
.unlock-page { overflow: auto; }
.ul-top { display: flex; justify-content: space-between; align-items: center; padding: 20px 28px; }
.ul-main { min-height: calc(100dvh - 90px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px 20px 60px; }
.ul-card { width: min(400px, 100%); padding: 34px 32px 26px; display: flex; flex-direction: column; gap: 14px; }
.ul-card h1 { margin: 0; font-size: 26px; }
.ul-card p { margin: 0; }
.field { display: flex; align-items: center; gap: 8px; }
.field input { flex: 1; border: 1px solid var(--panel-border); background: rgba(255, 255, 255, .75); border-radius: 14px; padding: 12px 16px; outline: none; font-size: 15px; }
.field input:focus { box-shadow: 0 0 0 3px rgba(199, 210, 254, .6); }
.check { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.ul-card .primary { justify-content: center; padding: 12px; font-size: 15px; }
.err { color: #e11d48; min-height: 1.2em; font-size: 13px; }
.hint, .ul-note { font-size: 12.5px; }
[data-skin="term"] .ul-card h1 { font-size: 18px; color: var(--ok); font-weight: 400; }
[data-skin="term"] .ul-card { border-radius: 6px; background: #161b22; }
[data-skin="term"] .field .prompt { color: var(--ok); }
[data-skin="term"] .field input { border-radius: 4px; background: #0d1117; border-color: #30363d; font-size: 14px; }
[data-skin="term"] .err { color: var(--red); }

/* ───────── 手机 ───────── */
@media (max-width: 860px) {
  .mobile-only { display: inline-flex !important; }
  .desk-only { display: none !important; }
  .top, [data-skin="term"] .top { height: auto; min-height: 56px; padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .brand { font-size: 17px; }
  [data-skin="term"] .ide-tabs span { display: none; }
  .peer { order: 3; flex-basis: 100%; }
  [data-skin="term"] .peer { justify-content: flex-start; }
  .peer > .g { padding: 3px 12px 3px 3px; }
  .peer .av { width: 28px; height: 28px; font-size: 13px; }
  .actions { margin-left: auto; gap: 6px; }
  .actions .btn { padding: 6px 10px; font-size: 12.5px; }
  .skin button { padding: 3px 9px; font-size: 12.5px; }
  .layout, [data-skin="term"] .layout { display: block; height: auto; padding: 0 8px 8px; }
  [data-skin="term"] .layout { padding: 0; }
  .chat { height: calc(100dvh - 112px); }
  [data-skin="term"] .chat { height: calc(100dvh - 92px); border-right: 0; }
  .thread { padding: 14px 12px 8px; }
  .m { max-width: 86%; }
  .composer { margin: 0 8px 8px; }
  .notify { margin: 0 8px 8px; }
  .banner { margin: 10px 8px 0; }
  .hintchip { display: none; }
  .games {
    position: fixed; inset: auto 0 0 0; height: min(92dvh, 760px); z-index: 40;
    border-radius: 24px 24px 0 0; transform: translateY(105%); transition: transform .3s ease;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  }
  [data-skin="glass"] .games { background: rgba(248, 249, 255, .94); }
  [data-skin="term"] .games { border-top: 1px solid #30363d; border-radius: 0; }
  body.show-games .games { transform: none; box-shadow: 0 -20px 60px rgba(15, 23, 42, .18); }
  .gtabs { padding-right: 40px; }
  .card { width: 220px; }
  #toast { bottom: 110px; }
}
