/* =====================================================================
   主控台样式（腾讯云版）· 科幻 HUD 主题（深空霓虹 · 玻璃拟态面板）
   含 v2 特有：素材库 media-* / 流程编排 flow-* 面板
   ===================================================================== */
:root {
  --neon: #00e5ff;
  --neon2: #8b5cf6;
  --amber: #ffb020;
  --ok: #2ef2a0;
  --warn: #ffb020;
  --danger: #ff4d6d;
  --bg0: #04060f;
  --bg1: #0a1024;
  --card: rgba(13, 22, 46, .58);
  --line: rgba(0, 229, 255, .2);
  --text: #e8f4ff;
  --muted: #7d93b8;
  font-variant-numeric: tabular-nums;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Rajdhani', 'Orbitron', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background:
    radial-gradient(1400px 800px at 90% -10%, rgba(139, 92, 246, .15), transparent 60%),
    radial-gradient(1100px 700px at -10% 110%, rgba(0, 229, 255, .1), transparent 60%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 55%, #070b18);
  color: var(--text); min-height: 100vh;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    linear-gradient(rgba(0, 229, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, .03) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 85%);
  mask-image: radial-gradient(ellipse at center, #000 25%, transparent 85%);
}
#starfield { z-index: 0 !important; opacity: .8; }
.host-header, .host-main { position: relative; z-index: 1; }

.host-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 16px 30px;
  background: rgba(6, 11, 26, .72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 229, 255, .25);
  box-shadow: 0 1px 0 rgba(0,229,255,.08), 0 14px 40px rgba(0,0,0,.5);
}
.header-brand {
  font-size: 21px; font-weight: 900; letter-spacing: 3px;
  background: linear-gradient(92deg, var(--neon), #7fd8ff 50%, var(--neon2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(0,229,255,.4));
}
.header-info { font-size: 13px; color: var(--muted); letter-spacing: 1px; }

.host-main { max-width: 920px; margin: 0 auto; padding: 26px 18px 70px; display: flex; flex-direction: column; gap: 18px; }

.card {
  position: relative;
  background: var(--card);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 18px; padding: 22px 26px;
  box-shadow: 0 0 0 1px rgba(0,229,255,.04), 0 18px 50px rgba(0,0,0,.45), 0 0 50px rgba(0,229,255,.05);
}
.card::before, .card::after {
  content: ''; position: absolute; width: 22px; height: 22px; pointer-events: none;
  border: 2px solid var(--neon); opacity: .65;
}
.card::before { top: 7px; left: 7px; border-right: none; border-bottom: none; border-radius: 5px 0 0 0; }
.card::after { bottom: 7px; right: 7px; border-left: none; border-top: none; border-radius: 0 0 5px 0; }

.card-title {
  font-size: 18px; font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
  letter-spacing: 2px; color: var(--neon); text-shadow: 0 0 14px rgba(0,229,255,.4);
}
.card-sub { font-size: 13px; font-weight: 700; color: var(--muted); margin: 20px 0 10px; letter-spacing: 2px; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: 1px; }
.input {
  width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 15px; outline: none;
  color: var(--text); font-family: inherit;
  background: rgba(4, 10, 24, .7);
  border: 1px solid rgba(125, 147, 184, .32);
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(0,229,255,.1), 0 0 22px rgba(0,229,255,.15); }
select.input option { background: #0a1024; color: var(--text); }

.btn {
  border: none; border-radius: 12px; padding: 11px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .15s; text-decoration: none; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px; letter-spacing: 1px;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: saturate(.3); }
.btn-primary {
  color: #031018;
  background: linear-gradient(135deg, var(--neon), #35b6ff 55%, var(--neon2));
  box-shadow: 0 0 20px rgba(0,229,255,.3), 0 5px 18px rgba(0,0,0,.4);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 0 32px rgba(0,229,255,.5); }
.btn-warn { color: #241200; background: linear-gradient(135deg, var(--amber), #ff8a3d); box-shadow: 0 0 18px rgba(255,176,32,.3); }
.btn-accent { color: #031018; background: linear-gradient(135deg, #35b6ff, var(--neon2)); box-shadow: 0 0 18px rgba(139,92,246,.35); }
.btn-ghost {
  color: var(--text); background: rgba(13, 22, 46, .6);
  border: 1px solid rgba(125, 147, 184, .35);
}
.btn-ghost:hover { border-color: var(--neon); box-shadow: 0 0 14px rgba(0,229,255,.2); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.room-code-show {
  font-size: 26px; font-weight: 900; letter-spacing: 5px;
  color: var(--neon); text-shadow: 0 0 18px rgba(0,229,255,.6);
}
.status-pill {
  font-size: 12px; font-weight: 800; padding: 4px 13px; border-radius: 20px; letter-spacing: 2px;
  color: var(--muted); background: rgba(125, 147, 184, .15); border: 1px solid rgba(125,147,184,.3);
}
.status-pill.playing {
  color: var(--ok); background: rgba(46,242,160,.1); border-color: rgba(46,242,160,.4);
  text-shadow: 0 0 10px rgba(46,242,160,.6);
}
.status-pill.settled { color: var(--amber); background: rgba(255,176,32,.1); border-color: rgba(255,176,32,.4); }

.room-links { display: flex; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
.link-btn {
  padding: 9px 16px; border-radius: 11px; font-size: 13px; text-decoration: none; font-weight: 700;
  color: var(--neon); background: rgba(0,229,255,.07);
  border: 1px solid rgba(0,229,255,.35); letter-spacing: 1px;
  transition: all .15s;
}
.link-btn:hover { background: rgba(0,229,255,.16); box-shadow: 0 0 16px rgba(0,229,255,.25); }

.game-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.game-item {
  flex: 1; min-width: 148px; border: 1px solid rgba(125, 147, 184, .3); border-radius: 13px;
  padding: 14px 14px; cursor: pointer; text-align: center; transition: all .15s;
  background: rgba(8, 14, 32, .5);
}
.game-item:hover { border-color: var(--neon); box-shadow: 0 0 16px rgba(0,229,255,.15); }
.game-item.selected {
  border-color: var(--neon); background: rgba(0,229,255,.08);
  box-shadow: 0 0 22px rgba(0,229,255,.22), inset 0 0 20px rgba(0,229,255,.05);
}
.game-item .g-title { font-weight: 800; font-size: 14px; letter-spacing: 1px; }
.game-item .g-desc { font-size: 11px; color: var(--muted); margin-top: 4px; }

.player-list { display: flex; flex-wrap: wrap; gap: 8px; }
.player-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px;
  font-size: 13px; background: rgba(8, 14, 32, .55); border: 1px solid rgba(125,147,184,.25);
}
.player-chip.online { border-color: rgba(46,242,160,.4); }
.player-chip.online::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(46,242,160,.8); }
.player-chip.offline::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #3a4a66; }
.player-chip.host {
  border-color: rgba(255,176,32,.45); color: var(--amber); font-weight: 800;
  background: rgba(255,176,32,.08);
}
.player-chip.spectator { opacity: .55; }
.player-chip .p-role { font-size: 11px; color: var(--muted); }

/* 游戏面板控件 */
.gp-block { margin-bottom: 14px; }
.gp-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: block; letter-spacing: 1px; }
textarea.input { resize: vertical; min-height: 60px; }
.input-sm { width: 90px; }
.qbank-list { max-height: 220px; overflow-y: auto; border: 1px solid rgba(125,147,184,.25); border-radius: 12px; }
.qbank-item {
  padding: 10px 14px; border-bottom: 1px solid rgba(125,147,184,.15); font-size: 13px;
  cursor: pointer; display: flex; gap: 8px; align-items: center;
}
.qbank-item:last-child { border-bottom: none; }
.qbank-item:hover { background: rgba(0,229,255,.07); }
.qbank-item .q-ans { color: var(--muted); font-size: 12px; margin-left: auto; }
.guess-hits { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.guess-hit-chip {
  padding: 5px 12px; border-radius: 14px; font-size: 12px; cursor: pointer;
  background: rgba(8, 14, 32, .55); border: 1px solid rgba(125,147,184,.25);
}
.guess-hit-chip.hit {
  background: rgba(46,242,160,.12); color: var(--ok); font-weight: 700;
  border-color: rgba(46,242,160,.45);
}

/* ---- v2：素材库 / 流程编排 ---- */
.media-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.media-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: rgba(8, 14, 32, .5); border: 1px solid rgba(125,147,184,.25);
  border-radius: 11px; font-size: 13px;
}
.media-item .m-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-item .m-tag {
  font-size: 11px; color: var(--neon); letter-spacing: 1px;
  background: rgba(0,229,255,.08); border: 1px solid rgba(0,229,255,.25);
  padding: 2px 9px; border-radius: 10px;
}
.media-item .m-actions { display: flex; gap: 6px; }
.media-item button { font-size: 12px; padding: 4px 10px; }
.media-item .m-play {
  color: var(--neon); border: 1px solid rgba(0,229,255,.4); border-radius: 8px; cursor: pointer;
  background: rgba(0,229,255,.08); font-family: inherit; font-weight: 700;
}
.media-item .m-play:hover { box-shadow: 0 0 12px rgba(0,229,255,.3); }
.media-item .m-del {
  color: var(--danger); border: 1px solid rgba(255,77,109,.4); border-radius: 8px; cursor: pointer;
  background: rgba(255,77,109,.08); font-family: inherit;
}

.flow-steps { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.flow-step {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: rgba(8, 14, 32, .5); border: 1px solid rgba(125,147,184,.25);
  border-radius: 11px; font-size: 13px;
}
.flow-step .fs-no { font-weight: 900; color: var(--neon); width: 22px; text-shadow: 0 0 8px rgba(0,229,255,.5); }
.flow-step .fs-name { flex: 1; font-weight: 600; }
.flow-step .fs-params { color: var(--muted); font-size: 12px; }
.flow-step .fs-del { cursor: pointer; color: var(--danger); border: none; background: none; font-size: 15px; font-family: inherit; }

.flow-templates { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.flow-template {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: rgba(46,242,160,.06); border: 1px solid rgba(46,242,160,.3);
  border-radius: 11px; font-size: 13px;
}
.flow-template .ft-name { flex: 1; font-weight: 700; }
.flow-template .ft-steps { color: var(--muted); font-size: 12px; }
.flow-template button { font-size: 12px; padding: 4px 10px; }
.flow-running-banner {
  background: rgba(255,176,32,.1); border: 1px solid rgba(255,176,32,.45); color: var(--amber);
  padding: 11px 14px; border-radius: 11px; font-size: 13px; margin-bottom: 10px;
  letter-spacing: 1px; text-shadow: 0 0 10px rgba(255,176,32,.3);
}

.muted { color: var(--muted); font-size: 13px; letter-spacing: .5px; }

.history-list { max-height: 260px; overflow-y: auto; }
.history-item {
  display: flex; gap: 14px; align-items: center; padding: 10px 4px;
  border-bottom: 1px solid rgba(125,147,184,.14); font-size: 13px;
}
.history-item .h-room { font-weight: 800; color: var(--neon); letter-spacing: 2px; }
.history-item .h-game { color: var(--muted); }
.history-item .h-time { margin-left: auto; color: var(--muted); font-size: 12px; }

#toast-box { position: fixed; top: 16px; right: 20px; z-index: 99; }
.toast {
  background: rgba(8, 14, 32, .94); border: 1px solid rgba(0,229,255,.3); color: var(--text);
  padding: 11px 16px; border-radius: 11px; margin-bottom: 8px; font-size: 13px;
  animation: slideIn .25s ease; box-shadow: 0 0 20px rgba(0,229,255,.15);
}
.toast.warn { border-color: var(--warn); color: var(--warn); }
.toast.ok { border-color: var(--ok); color: var(--ok); }
.toast.out { opacity: 0; transition: opacity .4s; }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 页脚（ICP 备案号） */
.host-footer {
  position: relative; z-index: 1; text-align: center; padding: 10px 0 22px;
  color: var(--muted); font-size: 12px; letter-spacing: 1px;
}

@media (max-width: 640px) {
  .host-main { padding: 16px 10px 56px; }
  .game-item { min-width: 120px; }
}
