/* public/css/style.css — 黑金沉浸主题 + 三栏响应式布局 */
:root {
  --bg: #0d0d0f;
  --surface: #1a1a1d;
  --surface-2: #141416;
  --border: #2a2a2e;
  --gold: #d4af37;
  --green: #2ecc71;
  --red: #e94560;
  --text: #e8e6e3;
  --dim: #9a9a9a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: radial-gradient(circle at 50% 20%, #1c1a15 0, #121114 45%, #0a0a0c 100%) fixed;
  color: var(--text);
  min-height: 100vh;
}

.hidden, [hidden] { display: none !important; }
.dim { color: var(--dim); font-size: 13px; }

/* 纤细滚动条（参考稿统一手感） */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #34342f; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* —— 通用组件 —— */
.card {
  background: linear-gradient(180deg, rgba(26, 26, 30, .97), rgba(18, 18, 21, .97));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}

h1, h2, h3, h4 { margin-bottom: 8px; font-weight: 600; }
h3 { color: var(--gold); font-size: 15px; letter-spacing: 1px; }

.btn {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  margin: 4px 4px 4px 0;
}
.btn.primary { background: var(--gold); color: #141416; border-color: var(--gold); font-weight: bold; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px;
  font-size: 14px;
  width: 100%;
  font-family: inherit;
}
select.select { width: auto; min-width: 140px; }

.tag {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  margin: 2px;
  color: var(--dim);
}
.tag.ready { color: var(--green); border-color: var(--green); }
.tag.me { color: var(--gold); border-color: var(--gold); }

.labeled { margin: 10px 0; line-height: 1.7; }
.label {
  display: inline-block;
  color: var(--gold);
  font-size: 12px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 0 6px;
  margin: 0 0 6px;
}
.labeled-body { min-height: 1em; }

/* —— 剧本/线索多段正文（richText 渲染） —— */
.rich-title { font-size: 15px; font-weight: bold; letter-spacing: 1px; margin: 4px 0 8px; }
.rich-h { color: var(--gold); font-weight: bold; letter-spacing: 1px; margin: 14px 0 6px; }
.rich-p { margin: 7px 0; }
.rich-list { margin: 7px 0; padding-left: 1.5em; }
.rich-list li { margin: 5px 0; }
.rich-list li::marker { color: var(--gold); }
.rich-table { border-collapse: collapse; margin: 8px 0; font-size: 13px; width: 100%; }
.rich-table th, .rich-table td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; line-height: 1.6; }
.rich-table th { color: var(--gold); background: var(--surface-2); white-space: nowrap; }
.rich-table td:first-child { white-space: nowrap; }
.rich-title:first-child, .rich-h:first-child, .rich-p:first-child, .rich-list:first-child, .rich-table:first-child { margin-top: 0; }
.rich-h + .rich-p { margin-top: 0; }
.rich-p:last-child, .rich-list:last-child, .rich-table:last-child { margin-bottom: 0; }

.clue {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 8px;
  margin: 6px 0;
  line-height: 1.6;
  font-size: 14px;
}
.clue.private { border-left: 3px solid var(--gold); }

/* 搜证线索卡 */
.search-info { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.clue-title { color: var(--gold); font-weight: bold; margin-bottom: 6px; }
.clue-text { line-height: 1.7; }
.private-search-block {
  margin: 12px 0 14px; padding: 12px; border: 1px solid rgba(240, 199, 70, .55);
  border-radius: 9px; background: linear-gradient(135deg, rgba(67, 52, 13, .45), rgba(27, 24, 16, .8));
}
.private-search-head { display: flex; align-items: center; gap: 9px; color: var(--gold); }
.private-search-icon { font-size: 19px; }
.private-search-head strong { display: block; font-size: 14px; }
.private-search-head small { display: block; margin-top: 2px; color: #b1a36f; font-size: 11px; }
.private-search-list { display: grid; gap: 7px; margin-top: 10px; }
.private-search-card {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border: 1px solid #6b5720; border-radius: 6px; background: rgba(22, 20, 14, .75);
  color: #e9d88c; text-align: left; cursor: pointer; font: inherit;
}
.private-search-card:hover { border-color: #f0c746; background: rgba(54, 44, 15, .9); }
.private-search-card b { color: #f0c746; font-size: 11px; white-space: nowrap; }
.event-card {
  position: relative;
  margin: 4px 0 12px;
  padding: 14px 13px 12px;
  border: 1px solid rgba(212, 175, 55, .45);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(212, 175, 55, .10), rgba(255, 255, 255, .025));
}
.event-card-label {
  display: inline-block; margin-bottom: 5px; padding: 1px 7px;
  color: #18140c; background: var(--gold); border-radius: 999px;
  font-size: 10px; font-weight: bold; letter-spacing: 1px;
}
.event-card h4 { margin: 0 0 5px; font-size: 15px; }
.event-card-copy + .event-card-copy { margin-top: 9px; padding-top: 9px; border-top: 1px dashed rgba(212, 175, 55, .22); }

/* —— 登录/选座共用基础 —— */
.login-wrap { max-width: 640px; margin: 0 auto; padding: 32px 16px; }
.game-title { color: var(--gold); text-align: center; letter-spacing: 4px; margin-bottom: 12px; }
.game-bg { color: var(--dim); line-height: 1.8; margin-bottom: 16px; text-align: center; }
.role-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.seat-role-wrap { flex: 1 1 120px; display: flex; flex-direction: column; gap: 6px; min-width: 120px; }
.role-card {
  flex: 1;
  width: 100%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px 10px;
  cursor: pointer;
  color: var(--text);
  text-align: center;
}
.role-card-avatar {
  display: block; width: 76px; height: 76px; margin: 0 auto 10px;
  border-radius: 50%; object-fit: cover; border: 2px solid rgba(255, 255, 255, .18);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .38);
}
.role-card.selected { border-color: var(--gold); background: #26231a; }
.role-name { display: block; font-size: 17px; font-weight: bold; }
.role-identity { display: block; margin-top: 5px; color: #c4cbd0; font-size: 12px; }
.role-public-intro { display: block; margin-top: 9px; color: #8f999f; font-size: 11px; line-height: 1.6; text-align: left; }
.role-state { display: block; font-size: 12px; color: var(--dim); margin-top: 6px; }
.seat-ai-toggle { width: 100%; margin: 0; }
.owner-start-panel { margin: 14px 0 10px; padding: 12px; border: 1px solid rgba(212, 175, 55, .35); border-radius: 8px; background: rgba(212, 175, 55, .05); }
.owner-start-panel .btn { width: 100%; margin: 0 0 6px; }
.owner-start-panel p { margin: 0; }
.pc-ai-btn { flex: 1 0 100%; width: 100%; margin-top: 3px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); color: var(--dim); cursor: pointer; font-family: inherit; font-size: 10px; }
.pc-ai-btn.on { border-color: rgba(212, 175, 55, .6); color: var(--gold); background: #26231a; }
.pc-ai-btn:disabled { opacity: .55; cursor: not-allowed; }
.players-start-panel { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 5px; }
.players-start-panel .btn { margin: 0; width: 100%; }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 6px 0; }
.form-success { color: #8fd1aa; font-size: 13px; min-height: 18px; margin: 6px 0; line-height: 1.5; }
.solo-label { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--dim); margin: 10px 0 4px; cursor: pointer; }
.solo-label input { width: auto; flex: none; }

/* —— 登录页（参考 fig/script_kill_login_register）：全屏背景 + hero + 玻璃拟态登录卡 —— */
.login-page { position: relative; min-height: 100vh; overflow: hidden; }
.login-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(.8) contrast(1.08);
}
.login-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(0deg, rgba(2, 6, 10, .62), rgba(2, 6, 10, .18) 34%, transparent 55%),
    linear-gradient(90deg, rgba(2, 6, 10, .12), rgba(2, 6, 10, .1) 45%, rgba(3, 8, 14, .8));
}
.login-header {
  position: relative; z-index: 2;
  min-height: 82px; padding: 14px 58px;
  display: flex; align-items: center;
}
.login-brand { display: flex; gap: 12px; align-items: center; }
.login-mask {
  width: 42px; height: 38px; flex: none;
  background: linear-gradient(135deg, #f6d17d, #c88b2d);
  clip-path: polygon(10% 0, 90% 0, 100% 42%, 86% 88%, 50% 100%, 14% 88%, 0 42%);
}
.login-brand h2 { font-size: 24px; letter-spacing: 2px; }
.login-brand small { display: block; color: #9ca5ad; letter-spacing: 2px; font-size: 11px; margin-top: 2px; }
.login-main {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  padding: 30px 6vw 35px;
  min-height: calc(100vh - 130px);
}
/* 标题块：左侧较暗区域、垂直居中；「颠覆想象」更大 */
.login-hero {
  position: absolute;
  left: 6vw;
  right: calc(500px + 14vw);   /* 右缘始终停在登录卡左侧 */
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}
.login-hero h1 {
  font-family: 'STKaiti', 'KaiTi', serif;
  font-size: clamp(38px, 4.2vw, 62px);
  line-height: 1.3; letter-spacing: 4px;
  text-shadow: 0 4px 14px rgba(0, 0, 0, .85), 0 0 40px rgba(0, 0, 0, .5);
}
.login-hero h1 em {
  font-style: normal; color: #e9b95e;
  font-size: 1.26em; line-height: 1;
  text-shadow: 0 4px 14px rgba(0, 0, 0, .9);
}
.login-hero p {
  color: #d3d9de; letter-spacing: 4px; font-size: clamp(11px, .95vw, 13px); margin-top: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .8);
}
/* 数据块：页面左下角 */
.login-stats {
  position: absolute;
  left: 6vw; bottom: clamp(34px, 6vh, 62px);
  max-width: calc(100vw - 500px - 14vw);  /* 不越过登录卡左缘 */
  display: flex; gap: clamp(18px, 2.4vw, 36px); flex-wrap: wrap;
  z-index: 1;
}
.login-stat .num { display: block; color: #ffd978; font-size: clamp(15px, 1.25vw, 19px); font-weight: 700; text-shadow: 0 2px 8px rgba(0, 0, 0, .85); }
.login-stat .lab { display: block; font-size: 11px; color: #c3cbd1; margin-top: 4px; text-shadow: 0 2px 6px rgba(0, 0, 0, .8); }
.auth-card {
  width: 500px; max-width: 100%;
  max-height: calc(100vh - 108px); overflow-y: auto;
  margin-left: auto;
  padding: 34px 48px 30px;
  border: 1px solid #34404b;
  border-radius: 18px;
  background: rgba(7, 13, 20, .92);
  box-shadow: 0 25px 80px rgba(0, 0, 0, .5);
  backdrop-filter: blur(10px);
}
.auth-tabs { display: flex; border-bottom: 1px solid #2d3944; margin-bottom: 24px; }
.auth-tab {
  width: 50%; text-align: center; padding: 12px;
  font-size: 20px; color: #7e8993; cursor: pointer;
  background: none; border: none; position: relative;
  font-family: inherit;
}
.auth-tab.active { color: #ffd978; }
.auth-tab.active::after {
  content: ''; position: absolute; left: 10%; right: 10%; bottom: -1px;
  height: 2px; background: #ffd978;
}
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-field {
  height: 56px; border: 1px solid #33404c;
  background: rgba(15, 23, 32, .8);
  border-radius: 10px;
  display: flex; align-items: center;
  padding: 0 16px; margin-bottom: 14px;
}
.auth-field:focus-within { border-color: #9c783d; }
.auth-field > span { width: 24px; color: #aab3ba; font-size: 17px; flex: none; }
.auth-field input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: 0;
  color: #fff; font-size: 15px; padding: 0 10px;
  font-family: inherit;
}
.auth-field input::placeholder { color: #7f8992; }
.pwd-eye {
  background: none; border: 0; color: #aab3ba; cursor: pointer;
  font-size: 15px; padding: 4px 6px; flex: none;
  font-family: inherit;
}
.auth-note { color: var(--dim); font-size: 13px; margin-bottom: 14px; }
.auth-primary {
  width: 100%; height: 54px;
  border: 0; border-radius: 27px;
  background: linear-gradient(#ffd97a, #e2ac51);
  font-size: 19px; font-weight: 800;
  color: #211708; cursor: pointer;
  font-family: inherit;
}
.auth-primary:disabled { opacity: .6; cursor: not-allowed; }
.auth-switch { text-align: center; color: #8e989f; font-size: 13px; margin-top: 18px; }
.auth-switch a { color: #ffd978; cursor: pointer; }
.login-footer {
  position: relative; z-index: 2;
  text-align: center; color: #69747d; font-size: 12px;
  padding-bottom: 14px;
}

@media (max-width: 720px) {
  .login-page { overflow: visible; }
  .login-header { padding: 14px 20px; }
  .login-main { flex-direction: column; align-items: stretch; padding: 20px 16px 30px; min-height: 0; }
  .login-hero { position: static; transform: none; right: auto; text-align: center; }
  .login-hero h1 em { display: inline; }
  .login-stats { position: static; max-width: none; justify-content: center; margin-top: 24px; }
  .auth-card { width: 100%; margin: 32px 0 0; padding: 26px 22px 22px; }
}

/* —— 三栏布局 —— */
.banner {
  display: none;
  background: var(--red);
  color: #fff;
  text-align: center;
  padding: 8px;
  font-size: 14px;
}
.banner.show { display: block; }

.shell {
  display: grid;
  grid-template-columns: clamp(250px, 19.5vw, 306px) minmax(520px, 1fr) clamp(290px, 24.5vw, 384px);
  grid-template-rows: auto;
  gap: 10px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 10px;
  min-height: calc(100vh - 58px);
  align-items: start;
}
.col { min-width: 0; }
.col-left, .col-right {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 78px);
}
.col-center { position: relative; }
.center-collapsed { display: none; }
.panel {
  background: linear-gradient(180deg, rgba(19, 29, 37, .96), rgba(13, 23, 30, .96));
  border: 1px solid #22313b;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}

/* 左栏剧本封面卡：渐变封面 + 底部信息 */
.room-card { padding: 0; overflow: hidden; }
.script-cover {
  position: relative;
  min-height: 168px;
  padding: 14px 12px;
  background:
    radial-gradient(circle at 72% 16%, rgba(113, 85, 48, .55), transparent 34%),
    radial-gradient(circle at 20% 90%, rgba(212, 175, 55, .10), transparent 45%),
    repeating-linear-gradient(125deg, #1b1e22 0 2px, #111417 2px 7px);
  border-bottom: 1px solid var(--border);
}
.script-cover.has-image { background-size: cover; background-position: center 38%; }
.script-cover-info { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1; }
.script-title {
  font-size: 20px; font-weight: 800; letter-spacing: 1px;
  margin: 8px 0 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .6);
}
.room-card .tag-row { margin: 0; }
.room-card-body { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.room-card-body .my-role { margin: 0; }

/* 左栏：玩家列表（聊天已移至底部横栏） */
.players-panel { display: flex; flex-direction: column; min-height: 0; }
.players-panel #playersBox { flex: 1; overflow-y: auto; min-height: 0; }
.player-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex: none; }
.dot.on { background: var(--green); }
.player-name { flex: 1; }
.dm-name { color: var(--gold); }

.chat-list {
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.7;
  padding: 4px;
}
.chat-msg.system { color: var(--dim); text-align: center; font-size: 12px; }
.chat-name { font-weight: bold; }
/* 聊天输入：一体化圆角容器 + 金色发送 */
.chat-input-row {
  display: flex; gap: 6px; margin-top: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px;
}
.chat-input-row input { flex: 1; border: none; background: transparent; padding: 7px 9px; }
.chat-input-row input:focus { outline: none; }
.chat-input-row .btn { margin: 0; border: none; background: var(--gold); color: #141416; font-weight: bold; border-radius: 6px; }
.room-chat-panel { flex: 1; min-height: 190px; display: flex; flex-direction: column; margin-bottom: 0; }
.room-chat-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #2b3942; margin: -2px -2px 8px; padding: 0 2px 8px; }
.room-chat-head h3 { margin: 0; }
.room-chat-head span { color: var(--dim); font-size: 11px; }
.room-chat-list { flex: 1; min-height: 90px; max-height: 190px; }

/* 中栏：阶段头 + 倒计时 */
.stage-title-row { display: flex; justify-content: space-between; align-items: baseline; }
.game-title-sm { color: var(--gold); font-size: 17px; letter-spacing: 2px; }
.stage-pos { color: var(--dim); font-size: 13px; }
.progress { display: flex; align-items: flex-start; margin: 12px 0 4px; overflow-x: auto; padding-bottom: 3px; }
.progress-step { width: 42px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; color: #737a80; }
.node {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  color: transparent; font-size: 0; /* 进度圆点：序号藏进 title 提示 */
  flex: none;
}
.progress-step.done .node { border-color: var(--gold); color: var(--gold); }
.progress-step.now .node {
  background: var(--gold); color: #141416; border-color: var(--gold); font-weight: bold;
  box-shadow: 0 0 12px rgba(212, 175, 55, .5);
}
.progress-step.done .node-label, .progress-step.now .node-label { color: var(--gold); }
.node-label { width: 52px; text-align: center; font-size: 10px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-line { height: 2px; background: #34342f; flex: 1; min-width: 5px; margin-top: 6px; }

.countdown {
  font-size: 40px;
  font-weight: bold;
  color: var(--gold);
  text-align: center;
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
}
.countdown.paused { color: var(--dim); }
.countdown.urgent { color: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.4; } }

.narration { line-height: 1.9; margin: 8px 0; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* 投票 */
.vote-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.vote-card {
  flex: 1 1 100px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 15px;
  font-weight: bold;
}
.vote-card:hover { border-color: var(--gold); }
.vote-result-row { padding: 6px 0; border-bottom: 1px dashed var(--border); }
.tally { margin-top: 10px; }

/* 右栏 Tabs：图标在上、文字在下（参考 fig/9c415e） */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 8px; overflow-x: auto; }
.tabs button {
  flex: 1 0 58px; background: none; border: none;
  color: var(--dim);
  font-size: 12px;
  padding: 8px 2px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.tabs button .rtab-ico { font-size: 17px; line-height: 1; opacity: .75; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--gold); border-bottom: 2px solid var(--gold); }
.tabs button.active .rtab-ico { opacity: 1; }

/* —— 右栏条目卡 + 阅读弹窗（参考 fig/9c415e script-block / modal） —— */
.chapter-title { font-size: 15px; font-weight: bold; margin: 2px 0 8px; }
.story-text {
  font-size: 12.5px; color: #b0b5c0; line-height: 1.6; margin-bottom: 12px;
  background: rgba(255, 255, 255, .03);
  padding: 10px; border-radius: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.script-block {
  display: flex; align-items: center;
  background: var(--surface-2);
  border: 1px solid transparent;
  padding: 10px; border-radius: 8px;
  margin-bottom: 10px; cursor: pointer;
  transition: .2s;
}
.script-block:hover { background: #242b38; border-color: #364051; }
.script-block .icon-box {
  width: 38px; height: 38px; flex: none;
  background: #30384a; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  margin-right: 11px;
}
.script-block:hover .icon-box { color: var(--gold); }
.script-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.script-info .title { font-size: 13.5px; font-weight: 500; }
.script-info .subtitle { font-size: 11px; color: #6a7282; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.script-action {
  background: #2d3545; color: #d1d5db;
  border: none; padding: 5px 13px; border-radius: 4px;
  font-size: 12px; cursor: pointer; flex: none; font-family: inherit;
}
.script-block:hover .script-action { background: var(--gold); color: #141416; font-weight: bold; }
.script-block.hint-open { border-color: rgba(212, 175, 55, .45); }
.script-block.hint-open.truth { border-color: rgba(233, 69, 96, .48); }

.hint-decision { font-size: 13px; line-height: 1.65; }
.hint-decision > h4 { color: var(--gold); font-size: 15px; margin-bottom: 6px; }
.hint-decision > p { color: #b2bac0; margin-bottom: 12px; }
.hint-decision.resolved { padding: 12px; background: rgba(255, 255, 255, .035); border: 1px solid #2d3b45; border-radius: 8px; }
.hint-choice-grid { display: grid; gap: 8px; }
.hint-choice {
  width: 100%; text-align: left; padding: 10px 11px;
  border: 1px solid #34424c; border-radius: 8px;
  background: #172129; color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; font-family: inherit;
}
.hint-choice:hover { border-color: var(--gold); background: #202a2f; }
.hint-choice.selected { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); background: #27271f; }
.hint-choice b { font-size: 13px; }
.hint-choice span { color: var(--dim); font-size: 11px; }
.hint-progress { color: var(--gold); margin: 12px 0 7px; }
.hint-voters { display: flex; flex-wrap: wrap; gap: 5px; }
.hint-voter { color: #788188; font-size: 10px; border: 1px solid #303c44; border-radius: 999px; padding: 2px 7px; }
.hint-voter.voted { color: #bec5c9; border-color: #53616a; }
.reader-section-title { color: var(--gold); font-size: 15px; font-weight: 700; margin: 22px 0 8px; padding-top: 14px; border-top: 1px solid #38414a; }

/* 阅读弹窗 */
.reader-dialog {
  width: min(640px, 92vw);
  max-height: 84vh;
  background: #1c212b;
  border: 1px solid #394258;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .8);
  display: flex; flex-direction: column;
  animation: reader-in .25s ease-out;
}
@keyframes reader-in { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.reader-dialog .notebook-head h3 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.reader-dialog .notebook-head h3 small { font-size: 12px; font-weight: 400; letter-spacing: 0; }
.reader-body {
  padding: 4px 18px 18px;
  overflow-y: auto;
  color: #c8cdd6;
  font-size: 14px;
  line-height: 1.9;
}
.reader-private-stage { margin-top: 10px; padding-left: 10px; border-left: 2px solid rgba(212, 175, 55, .32); }
.tab-body { font-size: 14px; line-height: 1.8; }
.tab-body h4 { color: var(--gold); font-size: 13px; margin: 10px 0 4px; }
.archive-stage { margin-bottom: 10px; }
.replay-intro { margin-bottom: 10px; color: var(--gold); }
.replay-section {
  margin: 0 0 12px; padding: 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2);
}

/* 中栏下部：随游戏进度更新的玩家行动提示 */
.stage-guide {
  width: min(680px, calc(100% - 24px));
  margin: 0 auto 12px;
  padding: 13px 15px;
  display: flex; align-items: center; gap: 13px;
  background: linear-gradient(135deg, rgba(28, 38, 45, .98), rgba(15, 24, 30, .98));
  border: 1px solid #344550; border-left: 3px solid var(--gold);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}
.stage-guide-icon {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px; background: rgba(212, 175, 55, .10);
  font-size: 20px;
}
.stage-guide-copy { flex: 1; min-width: 0; }
.stage-guide-kicker { color: var(--gold); font-size: 11px; letter-spacing: .5px; }
.stage-guide h3 { margin: 2px 0 3px; font-size: 16px; }
.stage-guide-task { color: #c0c7cc; font-size: 13px; line-height: 1.55; }
.stage-guide-task .rich-p { margin: 0; }
.stage-guide-hint { display: block; margin-top: 4px; color: var(--dim); font-size: 11px; }
.stage-guide-action { flex: none; margin: 0; white-space: nowrap; }
.stage-guide-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.mobile-ready-action { display: none; }
.mechanic-wait-note {
  display: flex; flex-direction: column; gap: 3px; margin: 12px 0; padding: 10px 12px;
  border: 1px solid rgba(212, 175, 55, .36); border-radius: 8px;
  background: rgba(212, 175, 55, .07); color: #c6c0aa; font-size: 12px;
}
.mechanic-wait-note b { color: var(--gold); }
.private-stage-card { border-color: rgba(212, 175, 55, .42); background: linear-gradient(135deg, rgba(60, 48, 18, .5), rgba(19, 22, 24, .96)); }
.dm-mechanic-guide {
  margin: 12px 0; padding: 12px 14px; border: 1px solid rgba(212, 175, 55, .38);
  border-radius: 9px; background: linear-gradient(135deg, rgba(55, 43, 16, .48), rgba(15, 21, 25, .96));
}
.dm-mechanic-guide b { color: var(--gold); }
.dm-mechanic-guide ol, .mechanic-manual ol { margin: 8px 0 0; padding-left: 1.4em; color: #c5c9cc; }
.dm-mechanic-guide li, .mechanic-manual li { margin: 5px 0; line-height: 1.6; }
.mechanic-manual > p { color: #b8c0c5; line-height: 1.7; }
.mechanic-feature-list { display: grid; gap: 7px; margin-top: 9px; }
.mechanic-feature {
  display: grid; grid-template-columns: 28px minmax(90px, auto) 1fr; gap: 8px; align-items: center;
  padding: 8px 9px; border: 1px solid #303b42; border-radius: 7px; background: rgba(10, 16, 20, .72);
}
.mechanic-feature i { font-style: normal; text-align: center; }
.mechanic-feature b { color: #ece8dc; font-size: 12px; }
.mechanic-feature small { color: #8f9aa1; font-size: 11px; line-height: 1.45; }
.mechanic-flow-list { margin: 10px 0 0; padding-left: 1.45em; color: #aab2b7; font-size: 11px; line-height: 1.65; }
.mechanic-player-panel {
  display: grid; gap: 12px; color: #e9e4f5;
  --mechanic-accent: #a78bfa; --mechanic-line: rgba(167, 139, 250, .34);
}
.mechanic-player-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px; border: 1px solid var(--mechanic-line); border-radius: 12px;
  background: radial-gradient(circle at top right, rgba(167,139,250,.22), transparent 42%), linear-gradient(135deg, #211936, #101820 72%);
  box-shadow: 0 16px 34px rgba(4, 3, 12, .35);
}
.mechanic-player-hero span { color: #bcaef4; font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; }
.mechanic-player-hero h3 { margin: 3px 0 0; border: 0; color: #fff; }
.mechanic-player-hero strong { flex: none; color: #f4d96f; font-size: 17px; }
.mechanic-score-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.mechanic-score-strip span { padding: 8px 10px; border: 1px solid #333349; border-radius: 8px; background: rgba(22,20,34,.78); color: #9da1ae; font-size: 11px; text-align: center; }
.mechanic-score-strip b { color: #f1edf8; }
.mechanic-wallet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; }
.mechanic-wallet { display: flex; flex-direction: column; gap: 3px; padding: 10px; border: 1px solid #30323d; border-radius: 9px; background: linear-gradient(145deg, rgba(20,23,31,.94), rgba(11,14,20,.98)); }
.mechanic-wallet.mine { border-color: var(--mechanic-line); box-shadow: inset 0 0 0 1px rgba(167,139,250,.12); }
.mechanic-wallet b { color: #f0edf6; font-size: 12px; }
.mechanic-wallet span { color: #efd56b; font-size: 12px; }
.mechanic-wallet small { color: #8c929c; font-size: 10px; }
.mechanic-action-card, .mechanic-ledger-section, .dm-mechanic-section {
  padding: 13px; border: 1px solid #343443; border-radius: 10px;
  background: linear-gradient(145deg, rgba(24,24,35,.96), rgba(12,17,22,.98));
}
.mechanic-action-card.auction-live { border-color: rgba(231,184,75,.45); }
.mechanic-action-card.quiz-live { border-color: rgba(81,190,167,.43); }
.mechanic-action-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.mechanic-action-head > span { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 9px; background: rgba(167,139,250,.12); }
.mechanic-action-head > div { display: flex; flex-direction: column; min-width: 0; }
.mechanic-action-head b { color: #f2eef9; font-size: 13px; }
.mechanic-action-head small { color: #8f94a1; font-size: 10px; line-height: 1.45; }
.mechanic-inline-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 8px; }
.mechanic-inline-field .input, .mechanic-inline-field .select { min-width: 0; width: 100%; }
.mechanic-check { display: flex; align-items: center; gap: 7px; margin: 9px 0; color: #c9c2d9; font-size: 11px; }
.mechanic-note { width: 100%; min-height: 70px; resize: vertical; }
.mechanic-result { margin: 8px 0 0; padding: 9px 10px; border-left: 3px solid #65c8ae; background: rgba(66,166,140,.09); color: #c8e9df; font-size: 12px; line-height: 1.6; }
.mechanic-option-list { display: grid; gap: 7px; margin-bottom: 9px; }
.mechanic-option-list label, .mechanic-quiz-list label { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid #303541; border-radius: 8px; background: rgba(7,11,16,.42); cursor: pointer; }
.mechanic-option-list label:has(input:checked), .mechanic-quiz-list label:has(input:checked) { border-color: var(--mechanic-line); background: rgba(115,87,184,.14); }
.mechanic-option-list span { display: flex; flex-direction: column; gap: 2px; }
.mechanic-option-list b { color: #ece8f4; font-size: 12px; }
.mechanic-option-list small { color: #9499a4; font-size: 10px; line-height: 1.45; }
.mechanic-quiz-list { display: grid; gap: 10px; margin-bottom: 10px; }
.mechanic-quiz-list fieldset { margin: 0; padding: 10px; border: 1px solid #303541; border-radius: 9px; }
.mechanic-quiz-list legend { padding: 0 5px; color: #eeeaf5; font-size: 12px; line-height: 1.5; }
.mechanic-quiz-list label { margin-top: 6px; color: #b9bec8; font-size: 11px; }
.mechanic-ledger-section h4, .dm-mechanic-section h4 { margin: 0 0 9px; color: #e9e4f4; }
.mechanic-lot { display: grid; gap: 3px; margin-top: 7px; padding: 9px; border: 1px solid #303541; border-radius: 8px; }
.mechanic-lot.sold { border-color: rgba(81,190,167,.38); }
.mechanic-lot.unsold { opacity: .68; }
.mechanic-lot b { color: #e9e5ef; font-size: 12px; }
.mechanic-lot span, .mechanic-lot small { color: #9399a3; font-size: 10px; line-height: 1.5; }
.dm-mechanic-console { border-color: rgba(167,139,250,.4); background: linear-gradient(155deg, rgba(32,24,51,.96), rgba(10,17,22,.98) 52%); }
.mechanic-console-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.mechanic-console-title h3 { margin: 0; border: 0; color: #f2eefb; }
.dm-mechanic-console { display: grid; gap: 11px; }
.dm-auction-current { padding: 9px 10px; border-radius: 8px; background: rgba(231,184,75,.08); }
.dm-auction-current h4, .dm-auction-current p { margin: 0; }
.dm-auction-current p { color: #9ba1aa; font-size: 11px; }
.dm-bid-table, .dm-choice-table, .dm-quiz-table { display: grid; gap: 6px; margin: 9px 0; }
.dm-bid-table > div, .dm-choice-table > div, .dm-quiz-table > div { display: grid; grid-template-columns: minmax(90px, 1fr) auto auto; gap: 8px; align-items: center; padding: 7px 8px; border-bottom: 1px solid #303541; font-size: 11px; }
.dm-bid-table small, .dm-choice-table small, .dm-quiz-table small { color: #8e949e; }
.dm-skill-request { padding: 10px; border: 1px solid #343443; border-radius: 8px; background: rgba(7,11,16,.38); }
.dm-skill-request + .dm-skill-request { margin-top: 8px; }
.script-chapter-progress { display: flex; flex-direction: column; gap: 3px; margin-bottom: 14px; padding: 10px 12px; border: 1px solid rgba(212,175,55,.36); border-radius: 9px; background: rgba(212,175,55,.07); }
.script-chapter-progress b { color: var(--gold); }
.script-chapter-progress span { color: #aab1b7; font-size: 11px; }
.role-script-chapter { margin-bottom: 12px; border: 1px solid #303942; border-radius: 10px; background: rgba(8,13,17,.45); overflow: hidden; }
details.role-script-chapter.current { border-color: rgba(212,175,55,.5); box-shadow: inset 3px 0 rgba(212,175,55,.65); }
details.role-script-chapter summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; cursor: pointer; color: #e7e4dd; font-weight: 700; list-style: none; }
details.role-script-chapter summary::-webkit-details-marker { display: none; }
details.role-script-chapter summary::after { content: '⌄'; color: var(--gold); font-size: 16px; transition: transform .16s ease; }
details.role-script-chapter[open] summary::after { transform: rotate(180deg); }
details.role-script-chapter summary span { flex: 1; }
details.role-script-chapter summary small { color: #929aa2; font-size: 10px; font-weight: 500; white-space: nowrap; }
.role-script-chapter-body { padding: 1px 14px 12px; }
.chapter-private-section, .chapter-task-section { margin: 0 13px 13px; padding: 10px 11px; border-radius: 8px; }
.chapter-private-section { border: 1px solid rgba(205,99,110,.25); background: rgba(205,99,110,.06); }
.chapter-task-section { border: 1px solid rgba(111,155,213,.27); background: rgba(111,155,213,.07); }
.chapter-private-section > b, .chapter-task-section > b { display: block; margin-bottom: 6px; font-size: 11px; }
.chapter-private-section > b { color: #db818c; }
.chapter-task-section > b { color: #8fb6e7; }
.role-script-chapter.locked { display: flex; align-items: center; gap: 11px; padding: 13px 14px; border-style: dashed; background: rgba(8,13,17,.25); opacity: .72; }
.locked-chapter-icon { filter: grayscale(1); opacity: .7; }
.role-script-chapter.locked div { display: grid; gap: 3px; }
.role-script-chapter.locked b { color: #b7bcc1; font-size: 12px; }
.role-script-chapter.locked small { color: #777f86; font-size: 10px; }
@media (max-width: 620px) {
  details.role-script-chapter summary { align-items: flex-start; flex-wrap: wrap; }
}

/* DM */
.event-log { max-height: 220px; overflow-y: auto; font-size: 12px; line-height: 1.8; }
.log-row { border-bottom: 1px dashed var(--border); padding: 3px 0; }
.log-time { color: var(--dim); margin-right: 6px; font-variant-numeric: tabular-nums; }
details.role-file { border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin: 8px 0; }
details.role-file summary { cursor: pointer; font-weight: bold; }
details.role-file p { margin: 6px 0; font-size: 13px; line-height: 1.7; }

/* 记录本抽屉 */
.notebook-drawer {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
}
.notebook-drawer > div {
  width: min(640px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.notebook-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 0; }
.notebook-head h3 { border: none; }
#notebookArea {
  margin: 12px;
  width: calc(100% - 24px);
  height: 60vh;
  resize: none;
  line-height: 1.8;
}

/* toast */
.toast {
  position: fixed;
  left: 50%; bottom: 40px;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--gold);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 手机端：纵向堆叠 + 底部 Tab */
.tabbar { display: none; }
.tabbar .phone-script-tab { display: none; }
.tabbar .phone-tab-icon { display: none; }

/* —— 大厅 —— */
.lobby-wrap { max-width: 1200px; margin: 0 auto; padding: 24px 20px 48px; }
.lobby-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.create-bar { display: flex; flex-direction: column; gap: 4px; }
.create-user-row { display: flex; gap: 8px; flex-wrap: wrap; }
.create-user-row input { flex: 1; min-width: 140px; width: auto; }
.create-user-row .btn { margin: 0; white-space: nowrap; }
.filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.filter-row .btn { margin: 0; }
.script-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.script-card .script-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.script-card h3 { margin: 0; }

/* —— 全局顶部导航（参考 fig 稿 topbar） —— */
.topnav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 26px;
  min-height: 58px;
  padding: 0 clamp(12px, 3vw, 28px);
  background: rgba(13, 13, 15, .94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; white-space: nowrap; }
.logo-mark {
  width: 30px; height: 30px; flex: none;
  border: 2px solid var(--gold); border-radius: 9px 9px 14px 14px;
  transform: rotate(45deg); position: relative;
}
.logo-mark::after {
  content: ''; position: absolute; inset: 8px;
  border-left: 2px solid var(--gold); border-right: 2px solid var(--gold);
  transform: rotate(-45deg);
}
.logo-text { font-size: 19px; font-weight: 800; letter-spacing: 2px; line-height: 1.1; }
.logo-text small { display: block; font-size: 10px; color: var(--dim); font-weight: 400; letter-spacing: 3px; }
.topnav-items { display: flex; gap: 4px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.topnav-items::-webkit-scrollbar { display: none; }
.topnav-items button {
  background: none; border: none; cursor: pointer;
  color: var(--dim); font-size: 14px; padding: 0 13px;
  height: 57px; position: relative; white-space: nowrap;
}
.topnav-items button:hover { color: var(--text); }
.topnav-items button.active { color: var(--gold); }
.topnav-items button.active::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: 0;
  height: 2px; background: var(--gold); border-radius: 2px;
}
.topnav-user { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.topnav-username { font-size: 13px; color: var(--dim); max-width: 10em; overflow: hidden; text-overflow: ellipsis; }
.point-balance { border: 1px solid rgba(212, 175, 55, .45); border-radius: 999px; padding: 5px 10px; background: rgba(212, 175, 55, .08); color: var(--gold); font: inherit; font-size: 12px; cursor: pointer; }
.point-balance:hover { border-color: var(--gold); background: rgba(212, 175, 55, .14); }
.room-point-card { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; padding: 12px 16px; border-color: rgba(212, 175, 55, .3); }
.room-point-card > div { display: flex; flex-direction: column; min-width: 150px; }
.room-point-card strong { color: var(--gold); }
.room-point-card p { flex: 1; margin: 0; }
.point-kicker { color: var(--dim); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }

/* —— 剧本库（参考 fig/script_library.html）：标题+搜索 / 行式筛选盒 / 排序 / 竖版封面卡 —— */
.lib-page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 22px 0 20px; }
.lib-page-title h1 { font-size: 27px; letter-spacing: 2px; margin: 0; }
.lib-page-title p { margin: 8px 0 0; color: #7e838b; font-size: 13px; }
.lib-search {
  width: min(360px, 100%); height: 42px;
  border: 1px solid #343941; border-radius: 7px;
  background: var(--surface-2);
  display: flex; align-items: center; padding: 0 13px; gap: 9px;
}
.lib-search span { opacity: .55; }
.lib-search input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 13px; padding: 8px 0; }
.lib-search input::placeholder { color: #696e76; }

.lib-filter-box {
  border: 1px solid var(--border); border-radius: 10px;
  background: rgba(16, 19, 23, .8);
  padding: 16px 18px; margin-bottom: 20px;
}
.lib-filter-row { display: flex; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid #242930; }
.lib-filter-row:last-child { border-bottom: 0; }
.lib-filter-label { width: 64px; flex: none; color: #777d85; font-size: 12px; padding-top: 7px; }
.lib-options { display: flex; gap: 7px; flex-wrap: wrap; }
.lib-option {
  border: 1px solid transparent; background: transparent;
  color: #92979e; height: 29px; padding: 0 13px; border-radius: 5px;
  font-size: 12px; cursor: pointer; font-family: inherit;
}
.lib-option:hover { color: #ddd; }
.lib-option.active { background: #322b15; border-color: #725d21; color: #f0c746; }

.lib-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 13px; }
.lib-result-head strong { font-size: 15px; color: #ddd; }
.lib-result-head > div > span { color: #6f747c; font-size: 12px; }
.lib-sorts { display: flex; gap: 8px; flex-wrap: wrap; }
.lib-sort {
  height: 30px; padding: 0 11px;
  border: 1px solid #30353c; border-radius: 5px;
  background: var(--surface-2); color: #8e939a; font-size: 12px; cursor: pointer;
  font-family: inherit;
}
.lib-sort:hover { color: #ddd; }
.lib-sort.active { color: #f0c746; border-color: #645323; }

.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lib-card {
  border: 1px solid var(--border); border-radius: 9px;
  background: linear-gradient(180deg, #15181c, #111419);
  padding: 12px; display: flex; gap: 13px;
  min-height: 228px; transition: .18s;
}
.lib-card:hover { border-color: #50545a; transform: translateY(-2px); box-shadow: 0 15px 35px rgba(0, 0, 0, .5); }
.lib-cover {
  width: 132px; min-height: 200px; border-radius: 6px; flex: none;
  position: relative; overflow: hidden; border: 1px solid #363a40;
}
.lib-cover::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(155deg, transparent 35%, rgba(0, 0, 0, .35)),
    repeating-linear-gradient(115deg, transparent 0 23px, rgba(255, 255, 255, .025) 24px 25px);
}
.lib-cover.has-image::before { background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, .86) 100%); }
.lib-moon {
  position: absolute; width: 42px; height: 42px; border-radius: 50%;
  right: 15px; top: 16px;
  background: #c9d0ce; opacity: .7; box-shadow: 0 0 25px rgba(184, 201, 204, .33);
}
.lib-cover-title {
  position: absolute; left: 10px; right: 10px; bottom: 30px;
  color: #eee; text-align: center;
  font-family: 'STKaiti', 'KaiTi', serif;
  font-weight: 700; letter-spacing: 3px; line-height: 1.35;
  text-shadow: 0 2px 5px #000;
}
.lib-cover-sub {
  position: absolute; left: 8px; right: 8px; bottom: 11px;
  color: #c8a947; text-align: center;
  font-size: 8px; letter-spacing: 2px;
}
.lib-info { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.lib-title { font-size: 17px; margin: 2px 0 0; color: #eee; }
.lib-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.lib-meta .tag { font-size: 10px; padding: 2px 7px; }
.lib-desc {
  color: #8d9299; font-size: 12px; line-height: 1.6; margin: 10px 0 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.script-ratings { display: grid; gap: 5px; margin-top: 8px; }
.script-rating { display: flex; align-items: center; gap: 5px; line-height: 1; min-height: 16px; }
.script-rating b { width: 52px; color: #9299a2; font-size: 10px; font-weight: 600; }
.script-rating.community .rating-stars, .script-rating.community .rating-score { color: #83d8c5; }
.community-pending { color: #879098; font-size: 10px; }
.rating-stars { color: #f0c746; letter-spacing: 1px; font-size: 13px; white-space: nowrap; }
.rating-score { color: #f0c746; font-size: 12px; font-weight: 800; }
.rating-unit { color: #777d85; font-size: 10px; }
.lib-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.lib-time { color: #7d8289; font-size: 11px; }
.script-date-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.script-date-row.compact { margin: 7px 0 0; }
.script-date-tag { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 8px; border: 1px solid rgba(180,190,205,.2); border-radius: 999px; color: #aeb6c2; background: rgba(255,255,255,.035); font-size: 10px; line-height: 1.2; white-space: nowrap; }
.script-date-tag.updated { border-color: rgba(80,190,165,.3); color: #83d8c5; background: rgba(55,170,145,.08); }
.lib-create {
  height: 32px; padding: 0 14px;
  border: 1px solid var(--gold); border-radius: 6px;
  background: var(--gold); color: #17130a;
  font-size: 12px; font-weight: 800; cursor: pointer;
  white-space: nowrap; flex: none; font-family: inherit;
}
.lib-create:hover { background: #f0c746; }
.script-card-actions { display: flex; align-items: center; gap: 7px; flex: none; }
.review-open {
  height: 32px; padding: 0 12px; border: 1px solid #3a4650; border-radius: 6px;
  background: rgba(255,255,255,.025); color: #b9c2c9; cursor: pointer; white-space: nowrap;
  font-family: inherit; font-size: 11px; font-weight: 600;
}
.review-open:hover { color: var(--gold); border-color: rgba(231,184,75,.6); background: rgba(231,184,75,.06); }

.lib-empty { grid-column: 1 / -1; text-align: center; padding: 26px 0; }
.lib-empty-note {
  margin-top: 20px; padding: 16px;
  border: 1px dashed #2c3138; border-radius: 8px;
  text-align: center; color: #666c74; font-size: 12px;
}

@media (max-width: 1000px) {
  .lib-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .lib-grid { grid-template-columns: 1fr; }
  .lib-card { flex-direction: column; }
  .lib-cover { width: 100%; min-height: 170px; }
}

/* —— 剧本库（参考 fig 稿）END —— */

/* —— 创建房间页（参考 fig/deepseek_7bb6d3）—— */
.cr-header { margin: 22px 0 18px; }
.cr-header h1 { font-size: 26px; letter-spacing: 2px; display: flex; align-items: center; gap: 10px; }
.cr-header h1::before { content: ''; width: 4px; height: 22px; background: var(--gold); border-radius: 2px; }
.cr-header p { color: #7e838b; font-size: 13px; margin: 6px 0 0 14px; }
.cr-stepbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 40px; height: 68px;
  background: rgba(16, 19, 23, .8); border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: 22px;
}
.cr-step { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 14px; }
.cr-step .num {
  width: 26px; height: 26px; border-radius: 50%;
  background: #2a2a2e; color: #777;
  display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 13px;
}
.cr-step.active { color: var(--text); }
.cr-step.active .num { background: var(--gold); color: #17130a; }
.cr-step.done .num { background: #26231a; color: var(--gold); border: 1px solid var(--gold); }
.cr-step-line { flex: 1; height: 1px; background: #2c3138; margin: 0 18px; }
.cr-wrapper { display: flex; gap: 24px; align-items: flex-start; }
.cr-left { flex: 3; min-width: 0; }
.cr-actionbar h3 { font-size: 17px; }
.cr-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }
.cr-tabs button {
  color: var(--dim); font-size: 13px; padding: 5px 11px;
  border-radius: 4px; background: transparent; border: none; cursor: pointer; font-family: inherit;
}
.cr-tabs button:hover { color: var(--text); }
.cr-tabs button.active { background: var(--gold); color: #17130a; font-weight: bold; }
.cr-searchrow { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.cr-searchrow .lib-search { width: 240px; }
.cr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cr-script {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; cursor: pointer; transition: .2s; position: relative;
}
.cr-script:hover { border-color: #4a4a4e; transform: translateY(-2px); }
.cr-script.active { border-color: var(--gold); background: #2a251a; }
.cr-script-img {
  height: 110px; border-radius: 5px; position: relative;
  display: flex; justify-content: center; align-items: center; margin-bottom: 12px;
  font-family: 'STKaiti', 'KaiTi', serif; font-size: 17px; letter-spacing: 2px; color: #ddd;
  text-shadow: 0 2px 5px #000; overflow: hidden;
}
.cr-script-img.has-image { background-size: cover; background-position: center 38%; }
.cr-script.active .cr-script-img { outline: 1px solid var(--gold); }
.cr-img-moon {
  position: absolute; width: 26px; height: 26px; border-radius: 50%; right: 12px; top: 10px;
  background: #c9d0ce; opacity: .55; box-shadow: 0 0 18px rgba(184, 201, 204, .3); font-style: normal;
}
.cr-script-info h4 { font-size: 15px; margin-bottom: 6px; }
.cr-script-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.cr-script-tags span { background: #2b2b2f; padding: 2px 8px; border-radius: 10px; font-size: 10px; color: #aaa; }
.cr-script.active .cr-script-tags span { background: #3a3422; color: var(--gold); }
.cr-script-desc {
  font-size: 11px; color: var(--dim); margin-bottom: 8px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cr-script-meta { display: flex; gap: 6px 12px; flex-wrap: wrap; font-size: 11px; color: var(--dim); }
.cr-side {
  flex: 1; min-width: 290px; position: sticky; top: 78px; z-index: 2;
  align-self: flex-start; max-height: calc(100vh - 92px); max-height: calc(100dvh - 92px);
}
.cr-side-box {
  max-height: inherit; overflow-y: auto; scrollbar-gutter: stable;
  background: rgba(16, 19, 23, .8); border: 1px solid var(--border); border-radius: 8px; padding: 18px;
}
.cr-side-box h3 { font-size: 15px; margin-bottom: 16px; }
.cr-sel { padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.cr-sel-summary { display: flex; gap: 12px; }
.cr-sel-info { min-width: 0; }
.cr-sel-thumb {
  width: 60px; height: 60px; border-radius: 5px; flex: none;
  display: flex; justify-content: center; align-items: center;
  font-size: 10px; color: #999; text-align: center; line-height: 1.3; padding: 4px;
}
.cr-sel-thumb.has-image { background-size: cover; background-position: center; }
.cr-sel h4 { font-size: 14px; margin-bottom: 5px; }
.cr-sel-meta { font-size: 11px; color: var(--dim); margin-top: 6px; }
.cr-sel-intro { margin-top: 12px; padding: 10px 11px; border-radius: 6px; background: rgba(255, 255, 255, .025); border: 1px solid rgba(255, 255, 255, .055); }
.cr-sel-intro b { display: block; margin-bottom: 5px; color: var(--text); font-size: 12px; }
.cr-sel-intro p {
  margin: 0; color: var(--dim); font-size: 11px; line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.cr-role-preview-box > b { color: var(--gold-soft); }
.cr-role-preview-list { display: grid; gap: 7px; }
.cr-role-preview { display: grid; grid-template-columns: 9px 1fr; gap: 8px; align-items: start; padding-top: 7px; border-top: 1px dashed rgba(255,255,255,.08); }
.cr-role-preview:first-child { padding-top: 0; border-top: 0; }
.cr-role-preview .cr-role-dot { margin-top: 5px; }
.cr-role-preview b { display: inline; margin: 0 6px 0 0; color: var(--text); }
.cr-role-preview small { color: #9ca6ad; font-size: 10px; }
.cr-role-preview p { display: -webkit-box; margin-top: 3px; color: var(--dim); -webkit-line-clamp: 3; }
.cr-sel-warning { border-color: rgba(217, 164, 65, .22); background: rgba(217, 164, 65, .055); }
.cr-sel-warning b { color: var(--gold); }
.cr-sel-warning p { -webkit-line-clamp: 3; }
.cr-config { display: flex; flex-direction: column; gap: 4px; }
.cr-check {
  display: flex; gap: 9px; padding: 9px 10px; border-radius: 6px;
  color: var(--text); font-size: 13px; cursor: pointer; align-items: flex-start;
  border: 1px solid transparent;
}
.cr-check:hover { border-color: var(--border); }
.cr-check input { margin-top: 3px; accent-color: var(--gold); width: auto; flex: none; }
.cr-check b { display: block; font-size: 13px; }
.cr-check small { display: block; color: var(--dim); font-size: 11px; margin-top: 2px; }
.cr-password-field {
  display: grid; gap: 8px; padding: 9px 10px; border: 1px solid transparent; border-radius: 6px;
}
.cr-password-field:focus-within { border-color: var(--border); }
.cr-password-field b { display: block; font-size: 13px; }
.cr-password-field small { display: block; margin-top: 2px; color: var(--dim); font-size: 11px; }
.cr-password-field input {
  width: 100%; padding: 9px 10px; border: 1px solid #343c43; border-radius: 6px;
  background: #0b1014; color: var(--text); font-family: inherit;
}
.cr-ai-picker { margin-top: 5px; padding: 10px; border: 1px solid var(--border); border-radius: 7px; background: rgba(255, 255, 255, .018); }
.cr-ai-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.cr-ai-head b { display: block; font-size: 13px; }
.cr-ai-head small { display: block; color: var(--dim); font-size: 11px; margin-top: 2px; }
.cr-ai-actions { display: flex; gap: 5px; }
.cr-ai-actions button { border: 1px solid var(--border); background: var(--surface-2); color: var(--dim); border-radius: 5px; padding: 3px 7px; cursor: pointer; font-family: inherit; font-size: 11px; }
.cr-ai-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin-bottom: 7px; }
.cr-role-ai { display: flex; align-items: center; gap: 6px; padding: 6px 7px; border: 1px solid var(--border); border-radius: 5px; cursor: pointer; color: var(--dim); font-size: 12px; }
.cr-role-ai.selected { border-color: rgba(212, 175, 55, .7); background: #26231a; color: var(--text); }
.cr-role-ai input { width: auto; margin: 0; accent-color: var(--gold); }
.cr-role-ai-copy { min-width: 0; }
.cr-role-ai-copy b, .cr-role-ai-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-role-ai-copy small { margin-top: 2px; color: #7f8a91; font-size: 10px; }
.cr-role-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cr-go {
  width: 100%; padding: 12px; margin-top: 12px;
  border: none; border-radius: 6px;
  background: linear-gradient(180deg, #f2c748, #dda92d);
  color: #181309; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit;
  position: sticky; bottom: 0; z-index: 3;
  box-shadow: 0 -12px 18px rgba(16, 19, 23, .94);
}
.cr-go:disabled { opacity: .35; cursor: not-allowed; }
.cr-tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.tip-box {
  background: rgba(16, 19, 23, .8); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; display: flex; align-items: center; gap: 13px;
}
.tip-ico {
  width: 38px; height: 38px; border-radius: 50%; background: #26231a;
  display: flex; justify-content: center; align-items: center; font-size: 17px; flex: none;
}
.tip-box h4 { font-size: 13px; margin: 0; }
.tip-box p { font-size: 11px; color: var(--dim); margin: 3px 0 0; }

/* —— 快速加入页（参考 fig/script_quick_join.html）—— */
.qj-hero {
  position: relative; overflow: hidden; border-radius: 5px;
  margin: 20px 0 18px; padding: 24px 0 88px;
  background:
    linear-gradient(90deg, #090d12, rgba(11, 16, 22, .87) 45%, rgba(9, 12, 17, .93)),
    radial-gradient(circle at 65% 40%, #5d4421, transparent 25%),
    linear-gradient(120deg, #17130f, #080b0e 65%);
  border-bottom: 1px solid #1d2228;
}
.qj-hero::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, transparent 0 70px, rgba(255, 255, 255, .06) 71px 72px);
  pointer-events: none;
}
.qj-hero h1 { position: relative; margin: 4px 0 3px 60px; font-family: 'STKaiti', 'KaiTi', serif; font-size: clamp(28px, 3vw, 40px); letter-spacing: 4px; z-index: 1; }
.qj-hero h1 span { color: var(--gold); }
.qj-hero > p { position: relative; margin-left: 60px; color: #858b92; font-size: 12px; z-index: 1; }
.qj-steps { position: absolute; left: 60px; right: 60px; bottom: 16px; display: flex; justify-content: space-between; z-index: 2; }
.qj-step { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #777d85; font-size: 12px; position: relative; flex: 1; }
.qj-step i {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid #5d5d5d; background: #17191c;
  display: flex; justify-content: center; align-items: center; font-style: normal; font-size: 16px;
}
.qj-step.active { color: #f0c746; }
.qj-step.active i { border-color: var(--gold); color: #f0c746; box-shadow: 0 0 16px rgba(213, 168, 43, .25); }
.qj-step-dash { flex: 1; height: 1px; border-top: 1px dashed #5c5c58; margin-top: 18px; }
.qj-content { display: grid; grid-template-columns: minmax(300px, 460px) minmax(280px, 1fr) minmax(300px, 1.2fr); gap: 14px; align-items: stretch; }
.qj-panel {
  border: 1px solid var(--border); border-radius: 9px;
  background: linear-gradient(180deg, rgba(18, 21, 25, .9), rgba(16, 18, 22, .9));
  padding: 18px;
}
.qj-panel h2 { font-size: 15px; margin: 0 0 14px; }
.qj-sub { font-size: 12px; color: #8e939a; margin: 15px 0 8px; }
.qj-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.qj-opt {
  height: 32px; padding: 0 15px;
  border: 1px solid #2f343b; border-radius: 6px;
  background: #111419; color: #9ba0a7; font-size: 12px; cursor: pointer; font-family: inherit;
}
.qj-opt:hover { color: #ddd; }
.qj-opt.active { background: #302713; border-color: #876c21; color: #f0c746; }
.qj-check { display: flex; align-items: center; gap: 9px; color: #92979e; font-size: 12px; margin-top: 12px; cursor: pointer; }
.qj-check input { accent-color: var(--gold); width: auto; flex: none; }
.qj-start {
  width: 100%; height: 44px; margin-top: 18px;
  border: none; border-radius: 6px;
  background: linear-gradient(180deg, #f2c748, #dda92d);
  color: #181309; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit;
}
.qj-start:disabled { opacity: .55; cursor: wait; }
.qj-estimate { text-align: center; color: #777d85; font-size: 11px; margin-top: 9px; }
.qj-matching { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.qj-matching h2 { color: #f0c746; font-size: 17px; }
.qj-matching p { color: #8a8f97; font-size: 11px; }
.qj-radar {
  width: 170px; height: 170px; margin: 20px 0;
  border: 1px solid #6a5420; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  box-shadow: 0 0 30px rgba(211, 167, 42, .1);
}
.qj-radar::before, .qj-radar::after { content: ''; position: absolute; border: 1px solid #3e3623; border-radius: 50%; }
.qj-radar::before { inset: 24px; }
.qj-radar::after { inset: 50px; }
.qj-radar.scanning::before { animation: qj-pulse 1.2s ease-in-out infinite; }
.qj-radar .qj-radar-mask {
  width: 72px; height: 72px; border: 1px solid var(--gold); border-radius: 50%;
  display: grid; place-items: center; color: #f0c746; font-size: 32px; background: #11151a;
  z-index: 1;
}
.qj-radar .sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(230, 185, 56, .35), transparent 70deg);
  animation: qj-rotate 1.2s linear infinite;
}
@keyframes qj-rotate { to { transform: rotate(360deg); } }
@keyframes qj-pulse { 50% { box-shadow: 0 0 18px rgba(230, 185, 56, .35); border-color: #876c21; } }
.qj-cancel {
  height: 34px; padding: 0 22px; margin-top: 14px;
  border: 1px solid #4a4f55; border-radius: 6px;
  background: #101318; color: #bbb; font-size: 12px; cursor: pointer; font-family: inherit;
}
.qj-roomhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.qj-roomhead h2 { margin: 0; color: #f0c746; }
.qj-refresh { border: 0; background: none; color: #888; font-size: 12px; cursor: pointer; font-family: inherit; }
.qj-room {
  border: 1px solid #272c32; border-radius: 7px; background: #0e1115;
  margin-bottom: 9px; padding: 9px;
  display: flex; gap: 10px; align-items: center;
}
.qj-room.full { opacity: .55; }
.qj-room.mine { border-color: rgba(212, 175, 55, .52); background: linear-gradient(90deg, rgba(51,42,20,.5), #0e1115); }
.qj-thumb {
  width: 64px; height: 60px; border-radius: 5px; flex: none; position: relative;
}
.qj-thumb::after {
  content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  right: 8px; top: 8px; background: rgba(155, 166, 168, .5);
}
.qj-thumb.has-image::after { display: none; }
.qj-room-info { flex: 1; min-width: 0; }
.qj-room-info b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qj-lock { margin-right: 5px; font-size: 11px; }
.qj-mine-badge { display: inline-block; margin-left: 7px; padding: 1px 5px; border: 1px solid rgba(212,175,55,.5); border-radius: 999px; color: var(--gold); font-size: 9px; vertical-align: 1px; }
.qj-room-info p { margin: 6px 0 0; color: #7e848c; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qj-room-count { color: var(--dim); font-size: 12px; flex: none; }
.qj-join {
  height: 29px; padding: 0 13px; flex: none;
  border: 1px solid #846a21; border-radius: 5px;
  background: #171713; color: #f0c746; font-size: 11px; cursor: pointer; font-family: inherit;
}
.qj-join:disabled { opacity: .4; cursor: not-allowed; }
.qj-tips {
  margin-top: 16px; border: 1px solid var(--border); border-radius: 9px;
  background: rgba(16, 19, 23, .8); padding: 14px 20px;
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
}
.qj-tips-title { color: #f0c746; font-size: 13px; min-width: 80px; }
.qj-tips .tip { flex: 1; min-width: 160px; color: #81868d; font-size: 11px; }
.qj-tips .tip b { display: block; color: #c0c3c8; font-size: 12px; margin-bottom: 3px; }

@media (max-width: 1100px) {
  .qj-content { grid-template-columns: 1fr 1fr; }
  .qj-matching { grid-column: 1 / -1; }
  .cr-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .qj-content { grid-template-columns: 1fr; }
  .cr-wrapper { flex-direction: column; }
  .cr-side { order: -1; position: static; width: 100%; min-width: 0; max-height: none; }
  .cr-side-box { max-height: none; overflow-y: visible; scrollbar-gutter: auto; }
  .cr-go { position: static; box-shadow: none; }
  .cr-grid { grid-template-columns: 1fr; }
  .cr-stepbar { padding: 12px 16px; height: auto; flex-wrap: wrap; gap: 10px; }
  .cr-step-line { display: none; }
  .cr-tips { grid-template-columns: 1fr; }
  .qj-steps { left: 20px; right: 20px; }
}

/* —— 首页（参考 fig/deepseek 稿）：英雄区 + 统计卡 + 热门剧本 + 邀请横幅 —— */
.home-hero {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0b0b0c url('/img/login-bg.jpg') center 30% / cover;
  margin-top: 20px;
}
.home-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(11, 11, 12, .3), rgba(11, 11, 12, .93));
}
.home-hero-inner { position: relative; z-index: 1; padding: clamp(26px, 4.5vw, 52px) clamp(20px, 4vw, 46px); }
.home-slogan { font-size: clamp(30px, 4.2vw, 52px); font-weight: 900; letter-spacing: 2px; }
.home-slogan span { color: var(--gold); }
.home-sub { color: #cfd4d8; font-size: 14px; margin: 10px 0 24px; }
.home-stats { display: flex; gap: 14px; margin-bottom: 26px; flex-wrap: wrap; }
.stat-card {
  flex: 1 1 150px;
  background: rgba(0, 0, 0, .6);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 3px;
  backdrop-filter: blur(5px);
}
.stat-icon { font-size: 18px; margin-bottom: 4px; }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1.15; }
.stat-label { font-size: 13px; color: var(--dim); }
.stat-desc { font-size: 12px; color: var(--gold); }
.home-actions { display: flex; gap: 13px; flex-wrap: wrap; }
.btn-home-main {
  background: var(--gold); color: #141416;
  padding: 11px 24px; border: none; border-radius: 6px;
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.btn-home-main:hover { background: #c9a22e; }
.btn-home-sec {
  background: rgba(255, 255, 255, .1); border: 1px solid #4a4a4e; color: var(--text);
  padding: 11px 24px; border-radius: 6px; font-size: 15px; cursor: pointer; font-family: inherit;
}
.btn-home-sec:hover { background: rgba(255, 255, 255, .18); }

.hot-section { margin-top: 24px; }
.hot-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.hot-title { font-size: 19px; font-weight: 700; }
.hot-title .fire { filter: drop-shadow(0 0 6px rgba(255, 107, 0, .5)); }
.hot-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.home-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0 12px; width: 250px;
}
.home-search input { background: transparent; border: none; outline: none; color: var(--text); font-size: 14px; width: 100%; padding: 9px 0; }
.home-search span { opacity: .5; }
.home-sort {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--dim);
  border-radius: 6px; padding: 8px 12px; font-size: 13px; outline: none; width: auto;
}
.home-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.home-tag {
  background: var(--surface-2); border: 1px solid var(--surface-2);
  color: var(--dim); border-radius: 20px; padding: 5px 15px;
  font-size: 13px; cursor: pointer; font-family: inherit;
}
.home-tag:hover { background: #232326; color: var(--text); }
.home-tag.active { border-color: var(--gold); color: var(--text); background: #26231a; }

.game-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.game-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; overflow: hidden;
  min-height: 150px;
  transition: .2s;
}
.game-card:hover { transform: translateY(-3px); border-color: #3a3a3e; box-shadow: 0 6px 16px rgba(0, 0, 0, .5); }
.gc-cover {
  width: 38%; flex: none; position: relative;
  background: radial-gradient(circle at 50% 35%, var(--gc1, #3a3a3c), #0b0b0c 85%);
}
.gc-cover::after {
  content: '🕵'; position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%);
  font-size: 34px; opacity: .3; filter: grayscale(1);
}
.gc-cover.has-image::after { display: none; }
.gc-info { flex: 1; padding: 13px 14px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.gc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.gc-title { font-size: 16px; font-weight: 700; }
.gc-badge {
  font-size: 10px; color: var(--gold); border: 1px solid var(--gold);
  padding: 0 5px; border-radius: 4px; margin-left: 6px; vertical-align: 2px; white-space: nowrap;
}
.gc-tags { display: flex; gap: 8px; font-size: 11px; color: #8f8f95; margin: 4px 0; flex-wrap: wrap; }
.gc-desc {
  font-size: 12.5px; color: var(--dim); line-height: 1.45; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gc-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.gc-meta { color: #8f8f95; font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.gc-start {
  background: var(--gold); color: #141416;
  border: none; border-radius: 4px;
  padding: 5px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  white-space: nowrap; flex: none; font-family: inherit;
}
.gc-start:hover { background: #c9a22e; }

.home-cta {
  margin: 28px 0 48px;
  background: linear-gradient(90deg, #19191a, #111112);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 26px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.cta-content { display: flex; align-items: center; gap: 18px; }
.cta-icon { font-size: 36px; }
.cta-title { font-size: 17px; font-weight: 700; }
.cta-sub { font-size: 13px; color: var(--dim); margin-top: 4px; }

@media (max-width: 980px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .hot-controls { width: 100%; }
  .home-search { flex: 1; width: auto; }
}
@media (max-width: 620px) {
  .game-grid { grid-template-columns: 1fr; }
  .home-cta { flex-direction: column; text-align: center; }
  .cta-content { flex-direction: column; }
}

/* —— 快速加入 —— */
.quickjoin-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.quickjoin-bar .btn { margin: 0; }
.room-item .room-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.room-item .room-item-head h3 { margin: 0; }
.room-item .room-code { font-size: 15px; }
.room-item .room-item-meta { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.room-item.full { opacity: 0.65; }

/* —— 占位页（排行榜/活动中心） —— */
.placeholder-page { padding: 60px 24px; text-align: center; }
.placeholder-icon { font-size: 44px; margin-bottom: 12px; }
.placeholder-page h2 { letter-spacing: 3px; margin-bottom: 10px; }
.placeholder-page .dim { max-width: 420px; margin: 0 auto; }

/* —— 创建房间弹窗 —— */
.create-room-dialog {
  width: min(480px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.create-room-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.create-room-body > label.dim { font-size: 13px; }

/* —— 房间选座页 —— */
.share-bar .share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.room-code { color: var(--gold); letter-spacing: 3px; font-size: 18px; }
.tag.role { color: var(--dim); border-style: dashed; }

/* —— 管理后台 —— */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-table th { color: var(--gold); font-size: 13px; font-weight: 600; }
.admin-actions { display: flex; gap: 4px; }
.admin-account-table { min-width: 1380px; }
.admin-account-note { min-width: 180px; max-width: 280px; white-space: normal !important; line-height: 1.55; }
.tag.pending { color: #efc66a; border-color: rgba(239, 198, 106, .45); background: rgba(239, 198, 106, .08); }
.admin-review-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.admin-review-head h3 { margin-bottom: 3px; }
.admin-review-stats { display: flex; flex-wrap: wrap; gap: 7px; }
.admin-review-stats span { padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; color: var(--dim); font-size: 11px; }
.admin-review-stats b { color: var(--gold); margin-left: 3px; }
.admin-review-table-wrap { overflow: auto; max-height: 560px; margin-top: 12px; }
.admin-review-table { min-width: 1080px; }
.admin-review-table th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.admin-review-table td { vertical-align: top; }
.admin-review-table td small { display: block; margin-top: 5px; }
.admin-review-copy { min-width: 220px; max-width: 360px; white-space: pre-wrap !important; line-height: 1.6; color: #c6ccd1; }
.admin-review-copy.suggestion { color: #a9d9cf; }
.admin-review-hidden { opacity: .62; }

/* —— 剧本评论与评分 —— */
.review-overlay {
  position: fixed; inset: 0; z-index: 240; padding: 22px;
  display: grid; place-items: center; overflow: hidden;
  background: rgba(2,6,9,.82); backdrop-filter: blur(8px);
}
.review-dialog {
  width: min(880px, 100%); max-height: calc(100vh - 44px); overflow: hidden;
  display: flex; flex-direction: column; border: 1px solid #3a4953; border-radius: 16px;
  background: linear-gradient(145deg, #17232c, #0a1117); box-shadow: 0 34px 100px rgba(0,0,0,.72);
  animation: confirm-rise .22s ease-out;
}
.review-dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 14px; border-bottom: 1px solid #2b3942; }
.review-dialog-head span { color: var(--gold); font-size: 10px; letter-spacing: 3px; }
.review-dialog-head h2 { margin: 4px 0 0; font-size: 23px; }
.review-close { width: 38px; height: 38px; border: 1px solid #3b4851; border-radius: 10px; background: rgba(255,255,255,.025); color: #bac3c9; font-size: 25px; cursor: pointer; }
.review-close:hover { color: #fff; border-color: #66747d; }
.review-dialog-body { padding: 18px 22px 24px; overflow-y: auto; }
.review-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.review-summary-grid > div { padding: 13px 15px; border: 1px solid #2d3a43; border-radius: 10px; background: rgba(255,255,255,.025); }
.review-summary-grid > div > span { display: block; color: #87929a; font-size: 10px; letter-spacing: 1px; margin-bottom: 7px; }
.review-summary-grid > div > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-summary-grid strong { color: #f0c746; font-size: 22px; }
.review-summary-grid > div:nth-child(2) strong { color: #83d8c5; }
.review-summary-grid small { color: #7f8990; font-size: 10px; }
.review-form { padding: 16px; border: 1px solid rgba(231,184,75,.3); border-radius: 11px; background: rgba(231,184,75,.035); }
.review-form-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.review-form-title h3, .review-list-title h3 { margin: 0 0 3px; font-size: 16px; }
.review-form-title p, .review-list-title p { margin: 0; color: #7f8a91; font-size: 11px; line-height: 1.5; }
.review-hidden-badge { padding: 4px 8px; border: 1px solid rgba(233,69,96,.42); border-radius: 999px; color: #ff8c98; font-size: 10px; }
.review-score-input { margin: 13px 0; padding: 0; border: 0; }
.review-score-input legend { margin-bottom: 7px; color: #adb5bb; font-size: 12px; }
.review-score-input > div { display: flex; gap: 6px; flex-wrap: wrap; }
.review-score-input input { position: absolute; opacity: 0; pointer-events: none; }
.review-score-input label span { display: block; padding: 7px 10px; border: 1px solid #3b464d; border-radius: 7px; color: #89939a; font-size: 12px; cursor: pointer; }
.review-score-input label:hover span, .review-score-input input:checked + span { color: #f0c746; border-color: #c7a541; background: rgba(231,184,75,.09); }
.review-field { display: block; margin-top: 12px; }
.review-field > span { display: flex; justify-content: space-between; gap: 10px; color: #c2c9ce; font-size: 12px; }
.review-field em { color: #78848c; font-style: normal; font-size: 10px; }
.review-field textarea { width: 100%; min-height: 92px; margin-top: 6px; padding: 10px 11px; resize: vertical; border: 1px solid #35434c; border-radius: 8px; outline: none; background: #081118; color: #d7dcdf; font-family: inherit; font-size: 13px; line-height: 1.65; }
.review-field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231,184,75,.08); }
.review-field small { display: block; text-align: right; margin-top: 3px; color: #6f7b83; font-size: 9px; }
.review-field i { font-style: normal; }
.review-suggestion textarea { min-height: 72px; }
.review-submit { margin: 9px 0 0; }
.review-locked { padding: 16px; border: 1px dashed #3a4750; border-radius: 10px; background: rgba(255,255,255,.02); }
.review-locked strong { color: #d0d5d8; }
.review-locked p { margin: 6px 0 0; color: #829098; font-size: 12px; line-height: 1.65; }
.review-public-list { margin-top: 22px; }
.review-list-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid #2c3942; }
.review-list-title > span { color: var(--gold); font-size: 12px; }
.review-comment { padding: 14px 2px; border-bottom: 1px solid #253139; }
.review-comment-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.review-comment-head b { color: #d4d9dc; font-size: 13px; }
.review-comment-head time { margin-left: auto; color: #68757d; font-size: 9px; }
.review-comment p { margin: 8px 0 0; color: #aeb8be; font-size: 13px; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-empty { padding: 28px 12px; text-align: center; color: #78858d; font-size: 12px; }
.review-loading, .review-error { min-width: 280px; padding: 28px; border: 1px solid #3a4953; border-radius: 13px; background: #101b23; color: #bec7cd; text-align: center; }
.review-error p { color: #849099; }
.review-exit-cta { margin-top: 16px; padding: 15px; border: 1px solid rgba(231,184,75,.34); border-radius: 10px; background: rgba(231,184,75,.055); }
.review-exit-cta > b { color: var(--gold-soft); }
.review-exit-cta > p { margin: 5px 0 11px; color: #9ca7ad; font-size: 12px; line-height: 1.6; }

@media (max-width: 620px) {
  .review-overlay { padding: 0; place-items: stretch; }
  .review-dialog { width: 100%; max-height: 100vh; height: 100vh; border: 0; border-radius: 0; }
  .review-dialog-head, .review-dialog-body { padding-left: 15px; padding-right: 15px; }
  .review-summary-grid { grid-template-columns: 1fr; }
  .review-comment-head time { width: 100%; margin-left: 0; }
  .script-card-actions { width: 100%; }
  .script-card-actions button { flex: 1; }
}

/* —— 中栏顶部信息栏 —— */
.game-topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  min-height: 58px;
  background: linear-gradient(180deg, rgba(24, 25, 26, .97), rgba(16, 17, 18, .97));
  border: 1px solid #2b3033;
  border-radius: 10px 10px 0 0;
  padding: 9px 16px;
  margin-bottom: 0;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}
.room-tag {
  background: var(--red); color: #fff;
  border-radius: 6px; padding: 2px 10px;
  font-size: 13px; letter-spacing: 1px;
}
.topbar-title { font-weight: bold; }
.game-topbar .room-tag { background: none; color: var(--text); padding: 0; letter-spacing: 0; }
.topbar-divider { width: 1px; height: 18px; background: #3b3d3e; }
.topbar-clock { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--dim); }
.topbar-age {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  border: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
}
.topbar-actions { display: flex; gap: 6px; }

/* —— 沉浸场景：氛围光晕 + 卡片围坐 + 中央圆形倒计时（参考 fig/9c415e） —— */
.scene {
  position: relative;
  height: clamp(430px, 62vh, 650px);
  background:
    radial-gradient(circle at 50% 30%, rgba(214, 150, 63, .12), transparent 32%),
    radial-gradient(ellipse at 50% 0%, #1d1a12 0%, #121114 45%, #0b0b0d 100%);
  border: 1px solid #332d22;
  border-top: 0;
  border-radius: 0 0 10px 10px;
  margin-bottom: 0;
  overflow: hidden;
}
.scene-backdrop {
  position: absolute;
  inset: -18px;
  background-image: var(--scene-cover);
  background-size: cover;
  background-position: center 42%;
  filter: saturate(.72) brightness(.6);
  transform: scale(1.04);
  opacity: 0;
}
.scene.has-cover .scene-backdrop { opacity: 1; }
/* 两侧暗角，突出中央 */
.scene::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .2), transparent 25%, rgba(0, 0, 0, .22) 70%, rgba(0, 0, 0, .74)),
    linear-gradient(90deg, rgba(0, 0, 0, .58), transparent 24%, transparent 76%, rgba(0, 0, 0, .58));
  pointer-events: none;
  z-index: 1;
}
.scene-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 22%, rgba(240, 184, 89, .18), transparent 36%),
    radial-gradient(circle at 50% 62%, rgba(212, 175, 55, .12), transparent 52%);
  pointer-events: none;
  z-index: 1;
}
/* 中央暖光底盘（衬托圆形计时器） */
.scene-table {
  position: absolute; left: 50%; top: 45%;
  width: min(60%, 520px); height: 32%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(117, 79, 39, .36), rgba(22, 16, 11, .13) 58%, rgba(11, 11, 13, 0) 72%);
  border: 1px solid rgba(181, 125, 59, .25);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .45), 0 15px 70px rgba(0, 0, 0, .65);
  pointer-events: none;
  z-index: 1;
}
/* 玻璃卡片座位 */
.seat {
  position: absolute; left: var(--seat-x); top: var(--seat-y);
  transform: translate(-50%, -50%);
  width: 124px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: transparent;
  border: 0;
  padding: 0;
  z-index: 3;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .8));
}
.seat-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px;
  border-radius: 50%;
  border: 2px solid #c69b4c;
  background: linear-gradient(135deg, #d9c4a5, #4a433d);
  color: #1b1714;
  font-size: 24px; font-weight: 800;
  position: relative;
  box-shadow: 0 0 0 3px rgba(7, 9, 10, .72), 0 0 22px rgba(0, 0, 0, .7);
}
.seat-avatar img, .avatar img {
  display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover;
}
.seat.me .seat-avatar { border-color: var(--green); box-shadow: 0 0 0 3px rgba(46, 204, 113, .16), 0 0 24px rgba(46, 204, 113, .3); }
.seat.off { opacity: .45; }
.seat.off .seat-avatar { filter: grayscale(.9); }
.seat-you {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  background: var(--green); color: #10231a;
  font-size: 10px; border-radius: 8px; padding: 0 6px; font-weight: bold;
}
.seat-ai, .seat-ready {
  position: absolute; top: -7px;
  font-size: 10px; border-radius: 8px; padding: 0 5px;
  background: var(--gold); color: #141416; font-weight: bold;
}
.seat-ai { right: -5px; }
.seat-ready { left: -9px; background: var(--green); color: #10231a; }
.seat-name {
  width: 100%;
  font-size: 13px; margin-top: 5px;
  text-align: center;
  background: rgba(7, 9, 10, .82);
  border: 1px solid rgba(202, 157, 79, .72);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seat-chip {
  max-width: 96%;
  font-size: 11px;
  background: rgba(15, 18, 19, .72);
  padding: 3px 10px; border-radius: 0 0 8px 8px;
  border: 0 !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 中央圆形倒计时 */
.scene-timer {
  position: absolute; left: 50%; top: 45%;
  transform: translate(-50%, -50%);
  width: 148px; height: 148px;
  background: radial-gradient(circle, rgba(22, 26, 29, .94), rgba(11, 13, 14, .94));
  border: 2px solid #a87c3b;
  border-radius: 50%;
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 3;
  box-shadow: 0 0 0 8px rgba(9, 10, 11, .5), 0 0 36px rgba(0, 0, 0, .9), inset 0 0 26px rgba(204, 149, 62, .08);
  text-align: center;
  padding: 10px 8px;
}
.st-ico { font-size: 15px; line-height: 1; }
.st-time {
  font-size: 25px; font-weight: bold; color: var(--gold);
  letter-spacing: 1px; font-variant-numeric: tabular-nums; line-height: 1.2;
}
.st-time.paused { color: var(--dim); }
.st-time.urgent { color: var(--red); }
.st-time.st-stage { font-size: 30px; }
.st-desc { font-size: 10.5px; color: #aab2c4; margin-top: 2px; line-height: 1.35; }
.st-sub { font-size: 10px; color: var(--gold); margin-top: 2px; }
.st-sub:empty { display: none; }
.st-timer-wait { font-size: 9px; color: #8d949b; margin-top: 2px; }
.clue-action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 8px; }
.clue.published { border-color: rgba(46, 204, 113, .45); background: rgba(28, 67, 49, .2); }
.vote-round-result { margin: 0 0 12px; padding: 12px; border: 1px solid rgba(231,184,75,.28); border-radius: 9px; background: rgba(30,25,16,.32); }

/* —— 中央悬浮快捷动作栏 —— */
.scene-toolbar {
  position: relative;
  z-index: 6;
  width: min(610px, calc(100% - 48px));
  min-height: 78px;
  margin: -62px auto 16px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(12, 18, 22, .92);
  border: 1px solid #283640;
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
  backdrop-filter: blur(12px);
}
/* 快捷动作：方形图标 + 文字 */
.qa {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none;
  color: #b8bec2; font-size: 11px;
  cursor: pointer; padding: 2px 8px;
  font-family: inherit; white-space: nowrap;
}
.qa-ico {
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(180deg, #26313a, #1b242b); border: 1px solid #34434d;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1;
}
.qa:hover { color: var(--text); }
.qa:hover .qa-ico { border-color: var(--gold); }
.qa.on { color: var(--green); }
.qa.on .qa-ico { border-color: var(--green); color: var(--green); }

/* 房间横幅：复制房间号 */
.ri-copy {
  background: none; border: none; color: #fff;
  opacity: .7; cursor: pointer;
  margin: 0 0 0 6px; padding: 0 2px;
  font-size: 12px; font-family: inherit;
}
.ri-copy:hover { opacity: 1; }

/* —— 左栏玩家头像列表 —— */
.player-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
  position: relative;
}
.player-card.off { opacity: 0.5; }
.pc-no {
  font-size: 11px; color: var(--dim);
  border: 1px solid var(--border); border-radius: 4px;
  width: 20px; text-align: center; flex: none;
}
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--border);
  background: radial-gradient(circle at 35% 30%, #2e2a20, #17150f);
  font-weight: bold; flex: none;
}
.avatar-dm { border-color: var(--gold); }
.pc-info { flex: 1; min-width: 0; }
.pc-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-role { display: block; font-size: 11px; }
.pc-state { color: #737b80; font-size: 11px; flex: none; }
.pc-state.online { color: var(--green); }
.tag-row { margin: 6px 0; }
.my-role { margin: 8px 0; }

/* 右栏避免内外双层卡片，保持参考图的一体式工作台 */
.right-panel { padding: 0; overflow: hidden; }
.right-panel > #rightBox > .panel { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }

@media (max-width: 1199px) {
  /* 顶部导航：窄屏收紧，导航条横向滑动 */
  .topnav { gap: 10px; }
  .logo-text small { display: none; }
  .topnav-username { display: none; }
  .topnav-items button { padding: 0 9px; }
  .home-hero h1 { font-size: 24px; }
  .shell {
    grid-template-columns: 1fr;
    padding-bottom: 64px;
    min-height: calc(100vh - 58px);
  }
  .col-left, .col-right { min-height: auto; }
  .tabbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 40;
  }
  .tabbar button {
    flex: 1;
    background: none; border: none;
    color: var(--dim);
    font-size: 13px;
    padding: 12px 4px;
    cursor: pointer;
  }
  .shell[data-tab="center"] .col-left  { display: none; }
  .shell[data-tab="center"] .col-right { display: none; }
  .shell[data-tab="left"]   .col-center { display: none; }
  .shell[data-tab="left"]   .col-right  { display: none; }
  .shell[data-tab="right"]  .col-center { display: none; }
  .shell[data-tab="right"]  .col-left   { display: none; }
  .countdown { font-size: 32px; }
  /* 手机端沉浸场景压缩；底栏跟随文档流 */
  .scene { height: clamp(350px, 62vh, 520px); }
  .scene-table { width: 240px; height: 140px; }
  .seat { width: 76px; padding: 7px 4px 6px; }
  .seat-avatar { width: 40px; height: 40px; font-size: 16px; }
  .scene-timer { width: 108px; height: 108px; }
  .st-time { font-size: 20px; }
  .st-time.st-stage { font-size: 24px; }
  .scene-toolbar { width: calc(100% - 28px); margin-top: -52px; min-height: 70px; gap: 4px; padding-inline: 7px; }
  .qa { padding-inline: 5px; }
  .qa-ico { width: 34px; height: 34px; }
  .col-center { padding-bottom: 0; }
}

@media (max-width: 520px) {
  .shell { padding: 0 0 64px; gap: 0; }
  .game-topbar { border-radius: 0; padding: 8px 10px; gap: 7px; }
  .topbar-clock { order: 3; width: 100%; margin-left: 0; font-size: 11px; }
  .topbar-actions { margin-left: auto; }
  .game-topbar .btn.small { padding: 5px 8px; font-size: 11px; }
  .scene { height: 390px; border-left: 0; border-right: 0; border-radius: 0; }
  .seat { width: 72px; }
  .seat-name { font-size: 11px; padding-inline: 6px; }
  .seat-chip { font-size: 9px; padding-inline: 6px; }
  .scene-toolbar { margin-top: -44px; margin-bottom: 10px; min-height: 64px; border-radius: 10px; }
  .qa { font-size: 10px; }
  .qa-ico { width: 31px; height: 31px; font-size: 14px; }
  #centerBox { padding: 0 8px; }
  .stage-guide { width: 100%; align-items: flex-start; flex-wrap: wrap; }
  .stage-guide-icon { width: 36px; height: 36px; }
  .stage-guide-copy { flex-basis: calc(100% - 52px); }
  .stage-guide-action { width: 100%; }
  .room-chat-list { max-height: none; min-height: 180px; }
}

/* —— 参考稿视觉深化：登录 / 首页 / 对局工作台 —— */
:root {
  --bg: #070b0f;
  --surface: #111820;
  --surface-2: #0d1319;
  --border: #26323b;
  --gold: #e7b84b;
  --gold-soft: #f4d17d;
  --text: #edf0f1;
  --dim: #929ba3;
}

body {
  background:
    radial-gradient(circle at 48% -10%, rgba(89, 70, 36, .18), transparent 34%),
    linear-gradient(180deg, #090e13, #06090c 72%);
}

button, input, select, textarea { transition: border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid rgba(231, 184, 75, .78);
  outline-offset: 2px;
}

/* 登录注册 */
.login-page { background: #05090d; isolation: isolate; }
.login-bg { transform: scale(1.015); animation: login-cinematic 18s ease-in-out infinite alternate; }
.login-shade {
  background:
    linear-gradient(180deg, rgba(2, 5, 8, .14), rgba(2, 5, 8, .18) 50%, rgba(2, 5, 8, .82)),
    linear-gradient(90deg, rgba(2, 5, 8, .18), rgba(2, 5, 8, .08) 46%, rgba(3, 9, 15, .9) 74%, rgba(3, 8, 13, .97));
}
.login-page::after {
  content: '';
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.15) .6px, transparent .6px);
  background-size: 4px 4px;
  opacity: .08;
}
.login-header { min-height: 92px; padding: 20px clamp(24px, 5vw, 78px); justify-content: space-between; }
.login-header-tip { color: #a9b0b7; font-size: 13px; letter-spacing: 2px; }
.login-brand h2 { margin: 0; font-size: 28px; }
.login-mask {
  width: 46px; height: 42px;
  border-radius: 44% 44% 48% 48%;
  clip-path: polygon(4% 4%, 42% 13%, 50% 7%, 58% 13%, 96% 4%, 91% 68%, 72% 94%, 50% 83%, 28% 94%, 9% 68%);
  box-shadow: 0 0 24px rgba(231, 184, 75, .2);
  position: relative;
}
.login-mask::after {
  content: '••'; position: absolute; inset: 10px 0 0; text-align: center;
  color: #202229; letter-spacing: 8px; font-size: 14px; transform: translateX(4px);
}
.login-main { max-width: 1680px; margin: 0 auto; width: 100%; padding: 22px clamp(28px, 5vw, 82px) 38px; }
.login-hero { left: clamp(28px, 7vw, 112px); right: calc(530px + 12vw); }
.login-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--gold-soft); font-size: 11px; letter-spacing: 5px; margin-bottom: 18px;
}
.login-kicker::before { content: ''; width: 46px; height: 1px; background: var(--gold); }
.login-hero h1 { margin: 0; font-size: clamp(42px, 4.7vw, 72px); line-height: 1.25; }
.login-hero p { margin-top: 18px; font-size: clamp(12px, 1vw, 15px); }
.login-feature-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.login-feature-row span {
  padding: 7px 12px; border: 1px solid rgba(231, 184, 75, .28); border-radius: 999px;
  background: rgba(4, 9, 14, .42); color: #cbd1d5; font-size: 11px; letter-spacing: 1px;
  backdrop-filter: blur(6px);
}
.auth-card {
  width: min(520px, 43vw); padding: 30px 52px 34px;
  background: linear-gradient(145deg, rgba(14, 24, 34, .95), rgba(6, 13, 20, .94));
  border-color: rgba(126, 149, 167, .32);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255,255,255,.035);
}
.auth-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.auth-card-head > span { font-size: 13px; color: var(--gold-soft); letter-spacing: 2px; }
.auth-card-head small { color: #6f7d88; font-size: 11px; }
.auth-tabs { margin-bottom: 30px; }
.auth-tab { padding: 15px 12px; font-size: 22px; font-weight: 700; }
.auth-tab.active::after { left: 4%; right: 4%; height: 3px; box-shadow: 0 0 16px rgba(231,184,75,.45); }
.auth-field { height: 62px; margin-bottom: 16px; border-color: #33424e; background: rgba(17, 27, 37, .78); }
.auth-field:hover { border-color: #4b5c68; }
.auth-field:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231, 184, 75, .08); }
.auth-field input { font-size: 15px; }
.auth-assurance { display: flex; justify-content: space-between; margin: -2px 2px 4px; color: #77838d; font-size: 11px; }
.auth-assurance span:first-child { color: #8fbda3; }
.auth-assurance span:first-child::before { content: '✓'; margin-right: 5px; }
.auth-primary {
  height: 58px; border-radius: 999px;
  background: linear-gradient(90deg, #f0bc50, #e9c36e 50%, #dca53c);
  box-shadow: 0 10px 28px rgba(210, 155, 48, .2);
}
.auth-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(210, 155, 48, .3); }
.login-stats { gap: clamp(18px, 2.7vw, 42px); }
.login-stat { display: flex; align-items: center; gap: 10px; min-width: 122px; }
.stat-glyph {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  color: var(--gold-soft); border: 1px solid rgba(231,184,75,.42); border-radius: 9px;
  background: rgba(5,10,14,.48); box-shadow: inset 0 0 14px rgba(231,184,75,.06);
}
@keyframes login-cinematic { from { transform: scale(1.015); } to { transform: scale(1.045); } }

/* 全局导航与首页 */
.topnav {
  min-height: 66px; padding: 0 clamp(16px, 2.7vw, 44px);
  background: rgba(6, 11, 15, .94); border-bottom-color: #202b33;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .2);
}
.topnav-items button { height: 65px; padding-inline: 17px; }
.topnav-user .avatar { background: linear-gradient(145deg, #44381d, #151a1d); border-color: #9b7934; }
.topnav-user #tnLogout { border-color: rgba(231,184,75,.42); color: var(--gold-soft); }
.lobby-wrap { max-width: 1500px; padding: 0 clamp(18px, 3vw, 42px) 52px; }
.home-hero { min-height: 325px; margin-top: 18px; border-color: #2c343a; background-position: center 38%; }
.home-hero::before {
  background:
    linear-gradient(90deg, rgba(5,8,11,.92), rgba(5,8,11,.58) 48%, rgba(5,8,11,.25)),
    linear-gradient(180deg, rgba(5,8,11,.12), rgba(5,8,11,.88));
}
.home-hero-inner { min-height: 325px; display: grid; grid-template-columns: minmax(390px, 1fr) minmax(520px, .95fr); align-items: center; gap: 42px; }
.home-eyebrow { display: block; color: var(--gold-soft); font-size: 11px; letter-spacing: 4px; margin-bottom: 13px; }
.home-slogan { font-family: 'STKaiti', 'KaiTi', serif; font-size: clamp(38px, 4.2vw, 62px); line-height: 1.1; margin: 0; }
.home-slogan span { color: var(--gold-soft); }
.home-sub { max-width: 620px; line-height: 1.9; margin: 18px 0 24px; color: #c1c7cb; }
.home-stats { display: grid; grid-template-columns: repeat(4, minmax(104px, 1fr)); gap: 12px; margin: 0; }
.stat-card {
  min-height: 160px; padding: 19px 14px; align-items: center; justify-content: center; text-align: center;
  background: linear-gradient(180deg, rgba(17,23,29,.78), rgba(8,13,17,.82));
  border-color: rgba(255,255,255,.11); box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(231,184,75,.38); }
.stat-icon { display: grid; place-items: center; height: 25px; color: var(--gold); font-size: 22px; }
.stat-num { font-size: 29px; }
.stat-label { color: #c5c9cc; }
.stat-desc { color: #737c84; font-size: 11px; }
.btn-home-main, .btn-home-sec { min-height: 48px; padding-inline: 23px; }
.btn-home-main { box-shadow: 0 10px 25px rgba(231,184,75,.16); }
.hot-section { margin-top: 30px; }
.hot-heading { display: flex; align-items: baseline; gap: 12px; }
.hot-count { color: #68727a; font-size: 12px; }
.hot-title .fire { color: var(--gold); }
.home-tags { padding-bottom: 3px; }
.home-tag { border-radius: 6px; background: #0f151a; border-color: #242d34; }
.game-card { min-height: 170px; background: linear-gradient(145deg, #12181d, #0d1216); border-color: #273138; }
.game-card:hover { border-color: rgba(231,184,75,.38); box-shadow: 0 16px 34px rgba(0,0,0,.42); }
.gc-cover { width: 40%; }
.gc-info { padding: 15px; }
.gc-start { min-height: 32px; box-shadow: 0 6px 16px rgba(231,184,75,.13); }
.home-cta { background: linear-gradient(100deg, rgba(30,27,20,.95), rgba(15,20,24,.96)); border-color: rgba(231,184,75,.22); }

/* 房间三栏工作台 */
.shell {
  max-width: 1920px; grid-template-columns: clamp(270px, 19vw, 330px) minmax(620px, 1fr) clamp(310px, 23vw, 390px);
  gap: 12px; padding: 12px; min-height: calc(100vh - 66px);
}
.col-left, .col-right { min-height: calc(100vh - 90px); }
.panel {
  border-color: #22313a; background: linear-gradient(180deg, rgba(17,27,35,.97), rgba(10,19,25,.97));
  box-shadow: 0 12px 36px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.025);
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.panel-heading h3 { display: flex; align-items: center; gap: 7px; margin: 0; color: #e8ecee; letter-spacing: 1px; }
.panel-heading-icon { color: var(--gold); font-size: 13px; }
.room-card { border-color: #2b3740; }
.script-cover { min-height: 154px; }
.script-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 25%, rgba(3,7,10,.88)); }
.script-cover-info { z-index: 2; }
.room-card .room-tag { display: inline-flex; align-items: center; background: rgba(115,30,32,.92); border: 1px solid rgba(255,130,130,.2); color: #fff; }
.room-card-body { background: rgba(5,10,13,.38); }
.progress-panel { padding-block: 11px; }
.progress-panel .progress { margin-top: 7px; }
.players-panel { flex: 1 1 250px; }
.players-panel #playersBox { padding-right: 2px; }
.player-card { padding: 7px 3px; gap: 7px; border-bottom-color: #26323a; }
.player-card:hover { background: rgba(255,255,255,.025); }
.pc-no { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: var(--gold-soft); }
.pc-ai-btn { background: rgba(8,13,17,.74); border-color: #33404a; }
.room-chat-panel { flex: 0 1 250px; min-height: 205px; }
.room-chat-head { margin-bottom: 4px; }
.room-chat-head h3 { display: flex; align-items: center; gap: 7px; color: #e8ecee; }
.chat-channel-active { color: var(--gold-soft) !important; padding: 3px 9px; border-bottom: 2px solid var(--gold); }
.room-chat-list { max-height: none; }
.room-stage { position: relative; }
.game-topbar {
  min-height: 58px; margin: 0; border-radius: 10px 10px 0 0;
  background: linear-gradient(90deg, rgba(27,27,27,.98), rgba(17,21,24,.98));
  border-color: #31373b; border-bottom-color: rgba(231,184,75,.18);
}
.game-topbar .room-tag { color: #e8ebed; font-size: 13px; }
.topbar-title { color: var(--gold-soft); }
.scene {
  /* 为顶部导航、操作栏和下方阶段提示预留首屏空间；dvh 可正确响应浏览器可用高度。 */
  height: clamp(400px, calc(100vh - 330px), 760px);
  height: clamp(400px, calc(100dvh - 330px), 760px);
  border-radius: 0 0 12px 12px;
  border-color: #303435; box-shadow: inset 0 -90px 100px rgba(0,0,0,.5), 0 16px 38px rgba(0,0,0,.32);
}
.scene-backdrop { filter: saturate(.72) contrast(1.08) brightness(.78); }
.scene::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(4,7,9,.16), transparent 35%, rgba(3,5,7,.54));
}
.scene-table { z-index: 1; border-color: rgba(180,124,55,.5); box-shadow: 0 0 0 12px rgba(20,13,7,.42), 0 28px 60px rgba(0,0,0,.76), inset 0 0 45px rgba(194,129,47,.12); }
.seat { z-index: 6; }
.seat-avatar { box-shadow: 0 8px 24px rgba(0,0,0,.64); }
.seat.me .seat-avatar { box-shadow: 0 0 0 4px rgba(231,184,75,.12), 0 8px 25px rgba(0,0,0,.65); }
.scene-timer { z-index: 5; border-color: #c59648; box-shadow: 0 0 0 9px rgba(9,10,11,.64), 0 0 48px rgba(0,0,0,.95), inset 0 0 30px rgba(204,149,62,.12); }
.scene-toolbar { margin-top: -76px; min-height: 86px; background: rgba(10,17,22,.94); border-color: #31404a; }
.qa { min-width: 68px; }
.qa-ico { background: linear-gradient(180deg, #293640, #172128); }
#centerBox > .panel, #centerBox > .card { border-color: #26343d; }
.right-panel { flex: 1 1 320px; min-height: 310px; }
.right-panel > #rightBox { height: 100%; }
.right-panel > #rightBox > .panel { height: 100%; }
.rtab-tabs { background: rgba(6,12,16,.38); }
.room-tools-panel { flex: none; }
.room-tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.room-tools-grid button {
  min-width: 0; padding: 10px 4px 8px; border: 1px solid #2c3942; border-radius: 9px;
  background: linear-gradient(180deg, #202c34, #121a20); color: #aeb7bd; cursor: pointer;
  font-family: inherit; font-size: 10px; white-space: nowrap;
}
.room-tools-grid button span { display: grid; place-items: center; min-height: 29px; margin-bottom: 4px; color: #d9dde0; font-size: 19px; }
.room-tools-grid button:hover { color: var(--gold-soft); border-color: rgba(231,184,75,.48); transform: translateY(-2px); }

/* 矮屏桌面（常见 1366×768 以下）：缩短非核心装饰，保证阶段提示仍在首屏。 */
@media (min-width: 1200px) and (max-height: 760px) {
  .topnav { min-height: 58px; }
  .topnav-items button { height: 57px; }
  .shell {
    padding: 8px;
    min-height: calc(100vh - 58px);
    min-height: calc(100dvh - 58px);
  }
  .col-left, .col-right {
    min-height: calc(100vh - 74px);
    min-height: calc(100dvh - 74px);
  }
  .game-topbar { min-height: 50px; padding-block: 6px; }
  .scene {
    height: clamp(300px, calc(100vh - 270px), 430px);
    height: clamp(300px, calc(100dvh - 270px), 430px);
  }
  .seat-avatar { width: 58px; height: 58px; font-size: 20px; }
  .seat { top: clamp(15%, var(--seat-y), 74%); }
  .seat-name { margin-top: 3px; padding-block: 2px; font-size: 12px; }
  .seat-chip { padding-block: 2px; font-size: 10px; }
  .scene-timer { width: 126px; height: 126px; }
  .scene-toolbar { min-height: 68px; margin-top: -58px; margin-bottom: 10px; padding-block: 6px; }
  .qa-ico { width: 34px; height: 34px; }
  .stage-guide { padding: 10px 12px; }
  .stage-guide-icon { width: 36px; height: 36px; }
  .stage-guide h3 { font-size: 15px; }
  .stage-guide-task { font-size: 12px; }
}

@media (max-width: 1320px) {
  .home-hero-inner { grid-template-columns: 1fr; gap: 28px; }
  .home-stats { max-width: 760px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shell { grid-template-columns: 270px minmax(540px, 1fr) 310px; }
}

@media (max-width: 1199px) {
  .topnav { min-height: 58px; }
  .topnav-items button { height: 57px; padding-inline: 10px; }
  .shell { grid-template-columns: 1fr; min-height: calc(100vh - 58px); }
  .col-left, .col-right { min-height: auto; }
  .scene {
    height: clamp(380px, calc(100vh - 310px), 620px);
    height: clamp(380px, calc(100dvh - 310px), 620px);
  }
  .seat { top: clamp(15%, var(--seat-y), 74%); }
  .scene-toolbar { margin-top: -52px; min-height: 70px; }
  .room-tools-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .login-header-tip { display: none; }
  .login-main { padding-top: 12px; }
  .login-hero { position: static; transform: none; text-align: left; }
  .login-hero h1 { font-size: clamp(34px, 10vw, 54px); }
  .login-feature-row { justify-content: flex-start; }
  .auth-card { width: 100%; margin-top: 28px; }
  .login-stats { position: static; max-width: none; margin-top: 24px; display: grid; grid-template-columns: repeat(2, 1fr); }
  .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { min-height: 132px; }
  .game-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topnav { min-height: auto; padding: 0 10px; gap: 6px 9px; flex-wrap: wrap; }
  .logo, .topnav-user { min-height: 56px; }
  .logo-text { font-size: 18px; }
  .topnav-user { margin-left: auto; gap: 6px; }
  .topnav-user .btn.small { padding: 5px 8px; font-size: 11px; }
  .point-balance { padding: 5px 7px; font-size: 11px; }
  .room-point-card { align-items: flex-start; flex-direction: column; }
  .topnav-items {
    order: 3; width: calc(100% + 20px); height: 42px; margin: -1px -10px 0;
    padding: 0 8px; border-top: 1px solid #202a31; background: rgba(7,12,16,.92);
  }
  .topnav-items button { height: 41px; padding-inline: 11px; font-size: 12px; }
  .login-header { min-height: 74px; padding: 14px 18px; }
  .login-brand h2 { font-size: 23px; }
  .login-brand small { letter-spacing: 1px; }
  .login-main { padding: 10px 15px 28px; }
  .login-kicker { letter-spacing: 3px; }
  .login-feature-row { display: none; }
  .auth-card { padding: 24px 20px 26px; border-radius: 14px; }
  .auth-card-head small { display: none; }
  .auth-tab { font-size: 19px; }
  .auth-field { height: 56px; }
  .login-stats { gap: 12px; }
  .login-stat { min-width: 0; }
  .stat-glyph { width: 30px; height: 30px; }
  .login-footer { position: static; padding: 10px 0 18px; }
  .lobby-wrap { padding-inline: 12px; }
  .home-hero-inner { min-height: 0; padding: 30px 20px; }
  .home-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { min-height: 118px; padding: 12px 8px; }
  .stat-num { font-size: 23px; }
  .home-actions > button { flex: 1 1 100%; }
  .hot-controls, .home-search { width: 100%; }
  .home-sort { flex: 1; }
  .game-card { min-height: 158px; }
  .room-tools-grid { grid-template-columns: repeat(2, 1fr); }
  .scene-toolbar { width: calc(100% - 20px); gap: 0; padding-inline: 3px; }
  .qa { flex: 1; min-width: 0; padding-inline: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-bg { animation: none; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* 房间等待与 AI 阵容配置 */
.seat-lobby-page { max-width: 1420px; margin: 0 auto; padding: 18px clamp(18px, 3vw, 42px) 50px; }
.seat-lobby-hero {
  position: relative; min-height: 245px; display: flex; align-items: flex-end; overflow: hidden;
  border: 1px solid #293640; border-radius: 14px;
  background:
    radial-gradient(circle at 72% 25%, rgba(129,88,42,.35), transparent 28%),
    linear-gradient(135deg, #17222b, #080d11 72%);
}
.seat-lobby-hero.has-cover { background-image: linear-gradient(90deg, rgba(4,8,11,.94), rgba(4,8,11,.58) 58%, rgba(4,8,11,.3)), var(--seat-cover); background-size: cover; background-position: center 32%; }
.seat-lobby-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(3,7,10,.88)); pointer-events: none; }
.seat-lobby-copy { position: relative; z-index: 1; width: min(760px, 72%); padding: 34px 40px; }
.seat-lobby-kicker { display: block; color: var(--gold-soft); font-size: 11px; letter-spacing: 3px; margin-bottom: 10px; }
.seat-lobby-page .game-title { color: #fff; text-align: left; font-family: 'STKaiti','KaiTi',serif; font-size: clamp(34px,4vw,54px); margin: 0 0 12px; }
.seat-lobby-page .game-bg { max-height: 88px; overflow: hidden; color: #c4cbd0; text-align: left; line-height: 1.85; margin: 0; mask-image: linear-gradient(180deg,#000 65%,transparent); }
.seat-lobby-page .game-bg .rich-p { margin: 0; }
.seat-lobby-page .share-bar { margin: -1px 0 14px; border-radius: 0 0 12px 12px; background: linear-gradient(90deg, rgba(21,28,33,.98), rgba(12,18,23,.98)); }
.seat-lobby-page .share-row { gap: 10px; }
.seat-lobby-page .share-row > span { margin-right: auto; }
.seat-lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 14px; align-items: start; }
.seat-config-card { margin: 0; padding: 20px; }
.seat-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; padding-bottom: 13px; border-bottom: 1px solid #26323a; }
.seat-section-head > div { display: flex; align-items: center; gap: 9px; }
.seat-section-head > div > span { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid rgba(231,184,75,.5); border-radius: 50%; color: var(--gold); font-size: 10px; }
.seat-section-head h3 { margin: 0; color: #eef0f1; }
.seat-section-head small { color: #77828a; font-size: 11px; }
.seat-section-head.compact { padding-bottom: 10px; }
.seat-lobby-page .role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; margin: 16px 0; }
.seat-lobby-page .seat-role-wrap { min-width: 0; gap: 7px; }
.seat-lobby-page .role-card { min-height: 260px; padding: 18px 12px; background: linear-gradient(180deg, #121a20, #0c1217); border-width: 1px; }
.seat-lobby-page .role-card:hover:not(:disabled) { transform: translateY(-3px); background: linear-gradient(180deg, #172129, #10171c); }
.seat-lobby-page .role-card.selected { box-shadow: 0 0 0 2px rgba(231,184,75,.14), inset 0 0 25px rgba(231,184,75,.06); }
.seat-lobby-page .role-card-avatar { width: 76px; height: 76px; border: 2px solid rgba(255,255,255,.16); box-shadow: 0 10px 26px rgba(0,0,0,.45); }
.seat-lobby-page .seat-ai-toggle { height: 36px; border-color: #32404a; background: #0c1217; }
.seat-lobby-page .seat-ai-toggle.primary { background: linear-gradient(90deg, #dca83d, #f0c55f); border-color: var(--gold); color: #111; }
.owner-start-panel { display: grid; grid-template-columns: minmax(190px, 280px) 1fr; align-items: center; gap: 14px; padding: 14px; margin-top: 18px; }
.owner-start-panel .btn { min-height: 44px; margin: 0; }
.seat-dm-entry { width: 100%; margin: 4px 0 0; border-color: #394750; }
.seat-owner-tip { margin: 9px 2px 0; }
.seat-lobby-side { display: flex; flex-direction: column; gap: 14px; }
.seat-lobby-side .card { margin: 0; }
.seat-guide-card { display: flex; align-items: flex-start; gap: 13px; padding: 17px; border-color: rgba(231,184,75,.24); background: linear-gradient(135deg, rgba(39,33,20,.82), rgba(14,21,26,.96)); }
.seat-guide-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; color: var(--gold); border: 1px solid rgba(231,184,75,.45); border-radius: 10px; }
.seat-guide-card h3 { margin: 0 0 6px; color: #f0f1f2; }
.seat-guide-card p { color: #949da4; font-size: 12px; line-height: 1.7; }
.seat-mechanic-card { display: flex; align-items: flex-start; gap: 13px; padding: 17px; border-color: rgba(127, 99, 210, .42); background: linear-gradient(135deg, rgba(43, 31, 70, .88), rgba(13, 20, 25, .98)); }
.seat-mechanic-card h3 { margin: 0 0 6px; color: #f0eaff; }
.seat-mechanic-card p { color: #a8a0b8; font-size: 12px; line-height: 1.7; }
.seat-mechanic-card ol { margin: 10px 0 0; padding-left: 1.35em; color: #9ca5ab; font-size: 11px; line-height: 1.6; }
.seat-mechanic-features { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.seat-mechanic-features span { padding: 3px 7px; border: 1px solid rgba(191, 171, 255, .32); border-radius: 999px; color: #c8baff; font-size: 10px; }
.seat-chat-card { min-height: 350px; display: flex; flex-direction: column; }
.seat-chat-card #seatChat { flex: 1; min-height: 230px; max-height: 390px; margin: 8px 0; }

@media (max-width: 980px) {
  .seat-lobby-grid { grid-template-columns: 1fr; }
  .seat-lobby-side { display: grid; grid-template-columns: minmax(240px,.65fr) 1fr; }
  .seat-chat-card { min-height: 280px; }
  .seat-chat-card #seatChat { min-height: 150px; }
}

@media (max-width: 620px) {
  .seat-lobby-page { padding: 10px 10px 74px; }
  .seat-lobby-hero { min-height: 225px; border-radius: 10px 10px 0 0; }
  .seat-lobby-copy { width: 100%; padding: 26px 20px; }
  .seat-lobby-page .game-title { font-size: 34px; }
  .seat-lobby-page .share-bar { padding: 13px; }
  .seat-lobby-page .share-row { align-items: stretch; }
  .seat-lobby-page .share-row > span { width: 100%; }
  .seat-lobby-page .share-row .btn { flex: 1; margin: 0; }
  .seat-section-head { align-items: flex-start; flex-direction: column; }
  .seat-lobby-page .role-grid { grid-template-columns: 1fr; gap: 9px; }
  .seat-lobby-page .role-card { min-height: 0; padding-inline: 14px; }
  .seat-lobby-page .role-card-avatar { width: 62px; height: 62px; }
  .owner-start-panel { grid-template-columns: 1fr; }
  .seat-lobby-side { display: flex; }
}

/* —— 站内确认弹窗 —— */
.confirm-backdrop {
  position: fixed; inset: 0; z-index: 220;
  display: grid; place-items: center; padding: 20px;
  background: rgba(2, 6, 9, .76); backdrop-filter: blur(8px);
  animation: confirm-fade .18s ease-out;
}
.confirm-dialog {
  width: min(520px, 100%); padding: 26px;
  display: grid; grid-template-columns: 48px 1fr; gap: 16px;
  border: 1px solid #3a4953; border-radius: 16px;
  background: linear-gradient(145deg, rgba(18,29,38,.99), rgba(7,14,20,.99));
  box-shadow: 0 32px 90px rgba(0,0,0,.68), inset 0 1px 0 rgba(255,255,255,.04);
  animation: confirm-rise .22s ease-out;
}
.confirm-symbol {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid rgba(231,184,75,.58); border-radius: 13px;
  color: var(--gold-soft); background: rgba(231,184,75,.08); font-size: 22px;
}
.confirm-dialog.danger .confirm-symbol { color: #ff8290; border-color: rgba(233,69,96,.62); background: rgba(233,69,96,.09); }
.confirm-copy { min-width: 0; }
.confirm-kicker { color: var(--gold); font-size: 10px; letter-spacing: 3px; }
.confirm-copy h2 { margin: 6px 0 9px; font-size: 23px; color: #f2f3f4; }
.confirm-copy p { color: #b9c1c7; font-size: 13px; line-height: 1.75; }
.confirm-copy ul { margin: 13px 0 0; padding: 12px 14px 12px 30px; border: 1px solid #2c3942; border-radius: 9px; background: rgba(255,255,255,.025); }
.confirm-copy li { margin: 4px 0; color: #8f9aa2; font-size: 12px; line-height: 1.55; }
.confirm-copy li::marker { color: var(--gold); }
.confirm-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.confirm-actions .btn { min-width: 116px; margin: 0; }
.password-dialog-input {
  width: 100%; margin-top: 13px; padding: 11px 12px; border: 1px solid #3a4953; border-radius: 8px;
  background: #071018; color: var(--text); font: inherit; outline: none;
}
.password-dialog-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(231,184,75,.1); }
.confirm-copy .password-dialog-error { margin: 8px 0 0; color: #ff8290; font-size: 12px; }
@keyframes confirm-fade { from { opacity: 0; } }
@keyframes confirm-rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* —— 开局后：玩家改为横向头像网格，聊天占用释放空间 —— */
.players-panel.is-compact { flex: 0 0 auto; max-height: none; }
.players-panel.is-compact #playersBox {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 1px 0 3px;
}
.players-panel.is-compact .player-card {
  min-width: 0;
  padding: 5px 3px;
  gap: 4px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: center;
}
.players-panel.is-compact .player-card:hover { border-color: #2d3942; }
.players-panel.is-compact .avatar { width: 28px; height: 28px; border-width: 1px; font-size: 11px; }
.players-panel.is-compact .pc-no,
.players-panel.is-compact .pc-role,
.players-panel.is-compact .pc-state,
.players-panel.is-compact .tag.ready { display: none; }
.players-panel.is-compact .pc-info { width: 100%; flex: none; }
.players-panel.is-compact .pc-name { font-size: 11px; line-height: 1.25; }
.players-panel.is-compact .tag { position: absolute; top: 2px; right: 2px; padding: 0 4px; font-size: 8px; }
.players-panel.is-compact .tag.me { right: auto; left: 2px; }
.players-panel.is-compact .players-start-panel { display: none; }
.players-panel.is-compact + .room-chat-panel { flex: 1 1 320px; min-height: 285px; }
.players-panel.is-compact + .room-chat-panel .room-chat-list { min-height: 190px; max-height: none; }

/* —— 搜证工作台：公共事件可折叠，线索区域独立可见 —— */
.right-panel > #rightBox > .panel { display: flex; flex-direction: column; min-height: 0; }
.right-panel .rtab-tabs { flex: none; margin-bottom: 0; }
.right-panel .tab-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 14px; scrollbar-gutter: stable; }
.search-event-card { padding: 0; overflow: hidden; }
.search-event-card > summary {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px;
  padding: 11px 12px; cursor: pointer; list-style: none;
}
.search-event-card > summary::-webkit-details-marker { display: none; }
.search-event-card > summary:hover { background: rgba(231,184,75,.05); }
.search-event-card .event-card-label { margin: 0; }
.event-card-summary { display: flex; flex-direction: column; min-width: 0; }
.event-card-summary b { color: #e8ebed; font-size: 13px; }
.event-card-summary small { color: #88939b; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-card-chevron { color: var(--gold); transition: transform .2s ease; }
.search-event-card[open] .event-card-chevron { transform: rotate(180deg); }
.event-card-body { max-height: 250px; overflow-y: auto; padding: 12px; border-top: 1px solid rgba(212,175,55,.18); background: rgba(4,9,13,.28); }
.search-clue-section { margin-top: 12px; }
.search-clue-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.search-clue-head strong { color: #e9ecee; font-size: 14px; }
.search-clue-head span { color: #87929a; font-size: 10px; }
.search-clue-list { display: grid; gap: 8px; }
.search-clue-list .clue { margin: 0; background: linear-gradient(145deg, #111a20, #0b1217); border-color: #2c3942; }
.search-clue-list .clue:hover { border-color: rgba(231,184,75,.48); }

@media (min-width: 1200px) {
  .col-left.game-started { height: calc(100vh - 90px); }
}

@media (max-width: 560px) {
  .confirm-dialog { padding: 21px 18px; grid-template-columns: 40px 1fr; gap: 12px; }
  .confirm-symbol { width: 40px; height: 40px; }
  .confirm-copy h2 { font-size: 20px; }
  .confirm-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .confirm-actions .btn { min-width: 0; width: 100%; }
  .event-card-body { max-height: 210px; }
  .mechanic-player-hero { align-items: flex-start; flex-direction: column; }
  .mechanic-score-strip { grid-template-columns: 1fr; }
  .mechanic-wallet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mechanic-inline-field { grid-template-columns: 1fr; }
  .dm-bid-table > div, .dm-choice-table > div, .dm-quiz-table > div { grid-template-columns: 1fr auto; }
  .dm-bid-table small, .dm-choice-table small, .dm-quiz-table small { grid-column: 1 / -1; }
}

/* 手机对局：去掉重复导航，把浏览器动态高度与底部安全区留给核心功能栏。 */
@media (max-width: 620px) {
  body { min-height: 100vh; min-height: 100dvh; }

  .game-global-nav { display: none; }

  .shell {
    --mobile-game-nav-height: 58px;
    min-height: 100vh;
    min-height: 100dvh;
    padding-bottom: calc(var(--mobile-game-nav-height) + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(var(--mobile-game-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  .scene {
    height: clamp(300px, calc(100vh - 210px), 470px);
    height: clamp(300px, calc(100dvh - 210px), 470px);
    margin-bottom: 10px;
  }

  .scene-toolbar,
  .room-tools-panel { display: none; }

  .stage-guide { align-items: flex-start; flex-wrap: wrap; }
  .stage-guide-copy { flex-basis: calc(100% - 52px); }
  .stage-guide-actions { width: 100%; flex-wrap: wrap; }
  .stage-guide-actions .btn { flex: 1 1 150px; width: auto; margin: 0; }
  .mobile-ready-action { display: inline-flex; align-items: center; justify-content: center; }
  .mobile-ready-action.is-ready { color: var(--green); border-color: var(--green); }

  .shell[data-tab="right"] .col-right {
    min-height: calc(100vh - var(--mobile-game-nav-height) - env(safe-area-inset-bottom, 0px));
    min-height: calc(100dvh - var(--mobile-game-nav-height) - env(safe-area-inset-bottom, 0px));
  }
  .shell[data-tab="right"] .right-panel { min-height: 0; margin-bottom: 0; }

  .tabbar {
    min-height: var(--mobile-game-nav-height);
    padding: 5px 6px max(6px, env(safe-area-inset-bottom, 0px));
    background: rgba(11, 18, 23, .97);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .36);
    backdrop-filter: blur(14px);
  }
  .tabbar button {
    min-width: 0;
    min-height: 48px;
    padding: 4px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 9px;
  }
  .tabbar .phone-tab-icon { display: inline; font-size: 18px; line-height: 1; }
  .tabbar .tab-label { font: inherit; font-size: 11px; line-height: 1.2; }
  .tabbar .tablet-workbench-tab { display: none; }
  .tabbar .phone-script-tab { display: flex; }
  .shell[data-tab="center"] .tabbar [data-mobile-tab="center"],
  .shell[data-tab="left"] .tabbar [data-mobile-tab="left"],
  .shell[data-tab="right"] .tabbar [data-mobile-tab="right"] {
    color: var(--gold-soft);
    background: rgba(231, 184, 75, .09);
  }
}

/* —— 网页底部 ICP 备案号（工信部要求） —— */
.beian-line { display: block; text-align: center; padding: 12px 0 18px; font-size: 12px; color: #fff; }
.beian-line a { color: #fff !important; text-decoration: none; }
.beian-line .beian-sep { margin: 0 7px; opacity: .55; }
.beian-line .beian-mps { display: inline-flex !important; vertical-align: middle; }
.beian-line img { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 4px; }
