:root {
  --bg: #0e1016;
  --bg-soft: #151822;
  --card: #191d28;
  --card-2: #202633;
  --line: #2a303d;
  --text: #e8ecf3;
  --text-dim: #8d97a8;
  --accent: #f5b942;
  --accent-2: #ffd479;
  --green: #37d39b;
  --blue: #4b9cff;
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(245, 185, 66, 0.10), transparent 60%),
    radial-gradient(700px 500px at 110% 10%, rgba(75, 156, 255, 0.10), transparent 55%),
    var(--bg);
}

.view { display: flex; flex-direction: column; height: 100dvh; }
.view[hidden] { display: none; }

/* ---------------- 首页 ---------------- */
.home-wrap {
  margin: auto;
  width: 100%;
  max-width: 420px;
  padding: 28px 20px 40px;
}

.brand { text-align: center; margin-bottom: 26px; }
.brand-mark {
  font-size: 44px;
  line-height: 1;
  filter: drop-shadow(0 6px 18px rgba(245, 185, 66, 0.35));
}
.brand h1 {
  margin: 10px 0 6px;
  font-size: 30px;
  letter-spacing: 4px;
  font-weight: 700;
}
.brand-sub { margin: 0; color: var(--text-dim); font-size: 13.5px; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  backdrop-filter: blur(6px);
}

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field input, .code-input, #input-msg {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .code-input:focus, #input-msg:focus {
  border-color: rgba(245, 185, 66, 0.6);
  box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.12);
}

.btn {
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform .08s, background .15s, border-color .15s, opacity .15s;
  font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { display: block; width: 100%; margin-top: 4px; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: transparent;
  color: #221a05;
  font-weight: 700;
}
.btn-ghost { background: transparent; }
.btn-ghost:hover { border-color: #3a4356; background: rgba(255,255,255,0.03); }
.btn-text { background: none; border: none; color: var(--text-dim); width: 100%; margin-top: 12px; font-size: 13px; }
.btn-text:hover { color: var(--text); }
.btn-small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-warn { border-color: rgba(245,185,66,.45); color: var(--accent-2); background: rgba(245,185,66,.08); }

.divider {
  position: relative;
  text-align: center;
  margin: 18px 0 14px;
  color: var(--text-dim);
  font-size: 12px;
}
.divider::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--line);
}
.divider span { position: relative; background: #171b25; padding: 0 10px; }

.join-row { display: flex; gap: 8px; }
.code-input {
  flex: 1;
  text-align: center;
  letter-spacing: 8px;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 17px;
  padding-left: 20px;
}
.home-tip { text-align: center; color: var(--text-dim); font-size: 12px; margin-top: 18px; }

/* ---------------- 房间 ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(14,16,22,.82);
  backdrop-filter: blur(10px);
  padding-top: max(10px, env(safe-area-inset-top));
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; gap: 8px; }
.icon-btn {
  background: none; border: none; color: var(--text-dim);
  font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,.05); }
.room-code-wrap { display: flex; flex-direction: column; line-height: 1.15; }
.room-code { font-weight: 700; letter-spacing: 3px; font-size: 17px; }
.room-code-label { font-size: 10.5px; color: var(--text-dim); letter-spacing: 1px; }

.players-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-dim);
  min-height: 39px;
  align-items: center;
}
.player-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card-2); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 999px; color: #c6cedb;
}
.player-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.player-chip.offline { opacity: .5; }
.player-chip.offline .dot { background: #6b7484; }

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.msg { display: flex; flex-direction: column; max-width: 84%; animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.msg .who { font-size: 11.5px; color: var(--text-dim); margin: 0 0 3px 4px; }
.msg .bubble {
  padding: 9px 13px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid var(--line);
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-me { align-self: flex-end; align-items: flex-end; }
.msg-me .who { margin: 0 4px 3px 0; }
.msg-me .bubble { background: linear-gradient(180deg, #2a3345, #232b3a); border-color: #33405a; }

.msg-host { align-self: flex-start; }
.msg-host .bubble {
  background: linear-gradient(180deg, #1e2432, #191e29);
  border-color: #2c3546;
}

.msg-answer .bubble {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 10px 16px;
  color: var(--accent-2);
  border-color: rgba(245,185,66,.28);
  background: rgba(245,185,66,.07);
}

.msg-hint .bubble {
  border-color: rgba(55,211,155,.3);
  background: rgba(55,211,155,.07);
  color: #b8f0da;
}
.msg-hint .bubble::before { content: "💡 "; }

.msg-guess .bubble { border-style: dashed; }
.msg-judge .bubble { font-weight: 700; }

.msg-system {
  align-self: center;
  max-width: 92%;
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255,255,255,.03);
  border-radius: 999px;
  padding: 4px 12px;
  text-align: center;
}
.msg-error {
  align-self: center;
  color: #ff9b9b;
  font-size: 12.5px;
  background: rgba(255,107,107,.08);
  border-radius: 10px;
  padding: 6px 12px;
}

.surface-card {
  margin: 12px 14px 0;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(245,185,66,.25);
  background: linear-gradient(180deg, rgba(245,185,66,.10), rgba(245,185,66,.02));
}
.surface-label { font-size: 11.5px; letter-spacing: 2px; color: var(--accent); margin-bottom: 6px; }
.surface-text { font-size: 15.5px; line-height: 1.7; }
.surface-empty { color: var(--text-dim); font-size: 14px; }

.truth-card {
  margin: 4px 0 8px;
  align-self: stretch;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(75,156,255,.3);
  background: linear-gradient(180deg, rgba(75,156,255,.10), rgba(75,156,255,.02));
  font-size: 14.5px;
  line-height: 1.75;
  white-space: pre-wrap;
}
.truth-card b { display: block; color: var(--blue); font-size: 12px; letter-spacing: 2px; margin-bottom: 6px; }

.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ---------------- 输入区 ---------------- */
.composer {
  border-top: 1px solid var(--line);
  background: rgba(14,16,22,.92);
  backdrop-filter: blur(10px);
  padding: 10px 12px calc(10px + var(--safe-b));
}
.composer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  flex-wrap: wrap;
}
.seg {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.seg-btn.active { background: var(--card-2); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.composer-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.composer-input { display: flex; gap: 8px; align-items: center; }
.composer-input input { flex: 1; padding: 12px 14px; }
.send-btn {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #221a05;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .08s, opacity .15s;
}
.send-btn:active { transform: scale(.95); }
.send-btn:disabled { opacity: .4; }

/* ---------------- 提示条 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: #232a38;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 99;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: pop .18s ease-out;
}

@media (min-width: 720px) {
  .view { max-width: 820px; margin: 0 auto; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .chat { padding: 20px 22px 10px; }
  .surface-card { margin: 14px 22px 0; }
  .composer { padding: 12px 22px 14px; }
  .topbar, .players-bar { padding-left: 22px; padding-right: 22px; }
}

/* ---------------- 设置页 ---------------- */
.admin-wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 26px 18px 60px;
}
.section-title {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
}
.btn-row { display: flex; gap: 8px; margin-top: 6px; }
.hint-text { color: var(--text-dim); font-size: 12.5px; line-height: 1.7; }
.field .hint-text { display: block; margin-top: 6px; }

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pill {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text-dim);
}
.pill.live { color: #9ef0c9; border-color: rgba(55,211,155,.4); background: rgba(55,211,155,.1); }
.pill.mock { color: #ffd98a; border-color: rgba(245,185,66,.35); background: rgba(245,185,66,.08); }

select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8d97a8 50%), linear-gradient(135deg, #8d97a8 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select:focus { border-color: rgba(245,185,66,.6); }

.test-result {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------------- 大厅 ---------------- */
.lobby-page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 18px 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.lobby-head { text-align: center; margin-bottom: 30px; }
.lobby-mark {
  font-size: 40px;
  line-height: 1;
  filter: drop-shadow(0 8px 20px rgba(245, 185, 66, 0.3));
}
.lobby-head h1 {
  margin: 12px 0 6px;
  font-size: 26px;
  letter-spacing: 3px;
  font-weight: 700;
}
.lobby-head p { margin: 0; color: var(--text-dim); font-size: 13.5px; }

.game-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-card {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012));
  text-decoration: none;
  color: var(--text);
  transition: transform .12s, border-color .15s, background .15s;
}
.game-card:hover {
  border-color: rgba(245, 185, 66, 0.4);
  background: linear-gradient(180deg, rgba(245,185,66,0.07), rgba(255,255,255,0.012));
  transform: translateY(-1px);
}
.game-card:active { transform: scale(0.99); }
.game-card.soon { opacity: .55; cursor: default; }
.game-card.soon:hover { border-color: var(--line); background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012)); transform: none; }

.game-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--card-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.game-body { flex: 1; min-width: 0; }
.game-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.game-title { font-size: 16.5px; font-weight: 700; letter-spacing: .5px; }
.game-badge {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
}
.game-badge.live { color: #9ef0c9; border-color: rgba(55,211,155,.4); background: rgba(55,211,155,.1); }
.game-badge.soon { color: var(--text-dim); }

.game-desc {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.6;
  color: #a9b3c3;
}
.game-tag { font-size: 11.5px; color: var(--text-dim); }

.game-arrow {
  position: absolute;
  right: 16px;
  top: 18px;
  color: var(--text-dim);
  font-size: 15px;
}

.lobby-foot {
  margin-top: auto;
  padding-top: 26px;
  text-align: center;
  font-size: 12.5px;
}
.lobby-foot a { color: var(--text-dim); text-decoration: none; }
.lobby-foot a:hover { color: var(--text); }

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
}
.back-link:hover { color: var(--text); }




/* ---------------- 模式选择 / 题目列表 ---------------- */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 4px;
}
.mode-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 13px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s, background .15s, transform .08s;
}
.mode-card:hover { border-color: #3a4356; }
.mode-card:active { transform: scale(.985); }
.mode-card.active {
  border-color: rgba(245, 185, 66, .55);
  background: rgba(245, 185, 66, .09);
}
.mode-icon { font-size: 19px; line-height: 1.2; }
.mode-name { font-size: 14.5px; font-weight: 700; }
.mode-desc { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; }

.soup-list { display: flex; flex-direction: column; gap: 8px; }
.soup-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s, background .15s;
}
.soup-item:hover:not(:disabled) { border-color: rgba(245, 185, 66, .45); background: #242c3b; }
.soup-item:disabled { opacity: .45; cursor: not-allowed; }
.soup-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.soup-name { font-size: 15px; font-weight: 600; }
.soup-meta { font-size: 11.5px; color: var(--text-dim); }
.soup-go { color: var(--accent); font-size: 15px; }
.soup-todo {
  font-size: 11px;
  color: var(--text-dim);
  border: 1px dashed var(--line);
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.soup-loading { font-size: 13px; color: var(--text-dim); padding: 8px 2px; }

/* ---------------- 线索簿 ---------------- */
.notes-card {
  align-self: stretch;
  margin: 4px 0;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(55, 211, 155, .28);
  background: linear-gradient(180deg, rgba(55, 211, 155, .09), rgba(55, 211, 155, .02));
  font-size: 13.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  color: #cdeee0;
}
.notes-card b {
  display: block;
  font-size: 11.5px;
  letter-spacing: 2px;
  color: var(--green);
  margin-bottom: 6px;
}

/* 汤面里用颜色区分的角色 */
.c-y { color: #f5d36b; }
.c-p { color: #ff8fb1; }
.c-b { color: #7cc4ff; }

.surface-text.collapsed {
  max-height: 7.2em;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(#000 60%, transparent 100%);
  mask-image: linear-gradient(#000 60%, transparent 100%);
}
.surface-toggle {
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

/* ---------------- 访问密码页 ---------------- */
.gate-wrap {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
}
.gate-mark { font-size: 46px; line-height: 1; filter: drop-shadow(0 8px 22px rgba(245,185,66,.3)); }
.gate-wrap h1 { margin: 16px 0 6px; font-size: 22px; letter-spacing: 2px; }
.gate-sub { margin: 0 0 22px; color: var(--text-dim); font-size: 13px; }
.gate-card {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gate-card input {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 13px 14px;
  font-size: 15px;
  text-align: center;
  letter-spacing: 2px;
  outline: none;
}
.gate-card input:focus { border-color: rgba(245,185,66,.6); }
.gate-err { color: #ff9b9b; font-size: 12.5px; margin: 2px 0 0; }

/* ---------------- 纪念册 ---------------- */
.album-page { max-width: 720px; margin: 0 auto; padding: 22px 16px 60px; min-height: 100dvh; }
.album-head { margin-bottom: 18px; }
.album-head h1 { font-size: 22px; letter-spacing: 3px; margin: 4px 0 6px; }
.album-sub { color: var(--text-dim); font-size: 12.5px; margin: 0; }

.album-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.album-tab {
  padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-soft); color: var(--text-dim); font-size: 12.5px; cursor: pointer;
  font-family: inherit; transition: all .15s; white-space: nowrap;
}
.album-tab.active { color: var(--text); border-color: rgba(249,168,212,.55); background: rgba(249,168,212,.10); }

.album-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.album-pwd {
  flex: 1; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 8px 12px; font-size: 13px; outline: none; font-family: inherit;
}
.album-pwd:focus { border-color: rgba(249,168,212,.5); }

.album-list { display: flex; flex-direction: column; gap: 10px; }
.album-empty {
  text-align: center; color: var(--text-dim); font-size: 13px; padding: 44px 0;
  border: 1px dashed var(--line); border-radius: 14px;
}
.album-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012));
}
.item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-main b { font-size: 15px; font-weight: 600; }
.item-date { font-size: 11.5px; color: #f9a8d4; }
.item-main small { font-size: 12.5px; color: var(--text-dim); }
.item-ops { display: flex; gap: 6px; flex-shrink: 0; }
.op {
  border: 1px solid var(--line); background: transparent; color: var(--text-dim);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.op:hover { color: var(--text); border-color: #3a4356; }
.op.danger:hover { color: #ff9b9b; border-color: rgba(255,107,107,.5); }

.photo-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg-soft); }
.photo-thumb { width: 100%; aspect-ratio: 4/3; background: #0b0d13; display: flex; align-items: center; justify-content: center; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-loading { color: var(--text-dim); font-size: 12px; }
.photo-meta { padding: 10px 14px 4px; display: flex; flex-direction: column; gap: 2px; }
.photo-meta b { font-size: 14.5px; }
.photo-meta small { color: var(--text-dim); font-size: 12px; }
.photo-card .item-ops { padding: 8px 14px 12px; }

.album-editor {
  position: fixed; inset: 0; background: rgba(8,10,16,.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 9999;
}
.album-editor[hidden] { display: none; }
.editor-card {
  width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px;
}
.editor-card h2 { margin: 0 0 14px; font-size: 16px; letter-spacing: 2px; }

.item-thumb {
  width: 58px; height: 58px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: #0b0d13; border: 1px solid var(--line);
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-item { align-items: center; }

/* ---------------- 跑团 ---------------- */
.coc-lobby .home-wrap { max-width: 560px; }
.coc-scenarios { display: flex; flex-direction: column; gap: 8px; }
.coc-scenario {
  text-align: left; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text);
  font-family: inherit; display: flex; flex-direction: column; gap: 3px; transition: all .15s;
}
.coc-scenario:hover { border-color: #3a4356; }
.coc-scenario.active { border-color: rgba(140, 200, 255, .5); background: rgba(140, 200, 255, .08); }
.coc-scenario b { font-size: 14.5px; }
.coc-scenario span { font-size: 11.5px; color: #8fb8d8; }
.coc-scenario small { font-size: 12px; color: var(--text-dim); line-height: 1.6; }

.coc-games { display: flex; flex-direction: column; gap: 8px; }
.coc-game-row { display: flex; gap: 8px; align-items: center; }
.coc-game-open {
  flex: 1; text-align: left; padding: 10px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card-2); color: var(--text); font-family: inherit;
  display: flex; flex-direction: column; gap: 2px;
}
.coc-game-open b { font-size: 14px; }
.coc-game-open small { font-size: 11.5px; color: var(--text-dim); }

.coc-topbar {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: rgba(14,16,22,.9);
  padding-top: max(10px, env(safe-area-inset-top));
}
.coc-title-wrap { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.coc-title { font-size: 15px; font-weight: 700; }
.coc-sub { font-size: 11px; color: var(--text-dim); }

.coc-sheet {
  margin: 10px 14px 0; padding: 14px; border-radius: 14px;
  border: 1px solid rgba(140,200,255,.22); background: rgba(140,200,255,.05);
  font-size: 12.5px;
}
.sheet-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.sheet-head b { font-size: 15px; }
.sheet-head span { color: var(--text-dim); font-size: 12px; }
.sheet-bars { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sheet-bar { position: relative; height: 20px; border-radius: 6px; background: rgba(0,0,0,.35); overflow: hidden; }
.sheet-bar i { position: absolute; inset: 0 auto 0 0; background: rgba(220,80,80,.55); }
.sheet-bar.san i { background: rgba(120,120,220,.55); }
.sheet-bar.mp i { background: rgba(80,180,180,.5); }
.sheet-bar span, .sheet-bar em { position: relative; z-index: 1; font-style: normal; font-size: 11.5px; padding: 0 8px; line-height: 20px; }
.sheet-bar em { float: right; }
.sheet-attrs, .sheet-skills { display: flex; flex-wrap: wrap; gap: 6px 12px; color: #b9c4d4; }
.sheet-attrs span { font-size: 12px; }
.sheet-skills { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.sheet-skills span { font-size: 11.5px; color: var(--text-dim); }

.coc-log {
  flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.coc-msg { max-width: 88%; display: flex; flex-direction: column; gap: 3px; }
.coc-msg.kp { align-self: flex-start; }
.coc-msg.me { align-self: flex-end; align-items: flex-end; }
.coc-who { font-size: 11px; color: #8fb8d8; letter-spacing: 1px; }
.coc-bubble {
  padding: 10px 14px; border-radius: 14px; line-height: 1.75; font-size: 14.5px;
  background: #1b2130; border: 1px solid #2b3648;
}
.coc-msg.kp .coc-bubble { background: linear-gradient(180deg,#1c2331,#182029); border: 1px solid #2b3648; }
.coc-msg.me .coc-bubble { background: linear-gradient(180deg,#2a3a4f,#233246); border-color: #35506e; }
.coc-sys {
  align-self: center; font-size: 12px; color: #9fb0c4; text-align: center;
  background: rgba(140,200,255,.08); border: 1px dashed rgba(140,200,255,.25);
  padding: 5px 12px; border-radius: 999px;
}
.coc-thinking { color: var(--text-dim); font-size: 13px; text-align: center; padding: 30px 0; }

.coc-composer { border-top: 1px solid var(--line); background: rgba(14,16,22,.94); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.coc-pending { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(245,185,66,.08); border: 1px solid rgba(245,185,66,.3); }
.coc-pending[hidden] { display: none; }
.coc-hintbar { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.coc-quick {
  flex-shrink: 0; padding: 6px 12px; border-radius: 999px; font-size: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text-dim); font-family: inherit;
}
.coc-quick:hover { color: var(--text); border-color: #3a4356; }

/* 语义记忆状态灯 */
.mem-off { color: #ff9b9b !important; border-color: rgba(255,107,107,.45) !important; background: rgba(255,107,107,.08) !important; }
.mem-on { color: #7df0bd !important; border-color: rgba(55,211,155,.5) !important; background: rgba(55,211,155,.12) !important; }
.mem-mid { color: #ffd479 !important; border-color: rgba(245,185,66,.45) !important; background: rgba(245,185,66,.10) !important; }
.mem-btn-off { border-color: rgba(255,107,107,.4) !important; color: #ffb3b3 !important; }
.mem-btn-on { border-color: rgba(55,211,155,.45) !important; color: #9ef0c9 !important; }
.coc-topbar .btn.mem-on, .coc-topbar .btn.mem-off, .coc-topbar .btn.mem-mid { font-weight: 600; }

/* 酒馆状态面板 */
.status-panel {
  margin: 10px 14px 0; padding: 12px 14px; border-radius: 14px;
  border: 1px solid rgba(140,200,255,.22); background: rgba(140,200,255,.05);
  font-size: 12.5px; max-height: 38vh; overflow-y: auto;
}
.status-panel[hidden] { display: none; }
.sp-row { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; color: #c3d0e0; }
.sp-row span b { color: #8fb8d8; font-weight: 500; margin-right: 4px; }
.sp-roles { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.sp-role { display: flex; align-items: center; gap: 10px; }
.sp-name { min-width: 4.5em; color: var(--text); }
.sp-bar { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.sp-bar i { display: block; height: 100%; background: linear-gradient(90deg,#ff7eb3,#ff758c); }
.sp-fav { color: #ffb3c8; min-width: 3em; text-align: right; }
.sp-here { color: #9ef0c9; font-size: 11px; }
.option-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.option-chips[hidden] { display: none; }
.opt-chip {
  border: 1px solid rgba(140,200,255,.3); background: rgba(140,200,255,.08);
  color: #bcd6ef; border-radius: 999px; padding: 6px 12px; font-size: 12.5px;
  cursor: pointer; font-family: inherit;
}
.opt-chip:hover { background: rgba(140,200,255,.16); }

.sp-roles { display: flex; flex-direction: column; gap: 4px; }
.sp-role-line { font-size: 12px; color: #c3d0e0; }
.sp-role-line b { color: #fff; font-weight: 600; margin-right: 2px; }

.sp-hist { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 3px; }
.sp-hist b { color: #8fb8d8; font-size: 11.5px; font-weight: 500; margin-bottom: 2px; }
.sp-hist span { font-size: 11.5px; color: #94a3b8; }

/* 角色卡封面 */
.coc-cover {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: #150208; overflow: hidden;
}
.coc-cover[hidden] { display: none; }
.cv-bg {
  position: absolute; inset: -10%;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,20,80,.55), transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(255,60,120,.28), transparent 50%),
    radial-gradient(circle at 80% 15%, rgba(120,0,60,.6), transparent 55%),
    #14020a;
  filter: blur(2px);
}
.cv-inner { position: relative; text-align: center; padding: 0 24px; max-width: 620px; }
.cv-kicker { font-size: 10.5px; letter-spacing: .32em; color: #ff7aa2; opacity: .9; margin-bottom: 18px; }
.cv-title {
  font-size: clamp(30px, 7vw, 52px); font-weight: 800; letter-spacing: .06em; margin: 0 0 14px;
  color: #fff; text-shadow: 0 0 24px rgba(255,40,100,.75), 0 0 60px rgba(255,20,80,.45);
}
.cv-sub { font-size: 12px; letter-spacing: .22em; color: #ffb3c9; margin-bottom: 22px; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 34px; }
.cv-tags span {
  font-size: 11.5px; padding: 5px 11px; border-radius: 999px;
  border: 1px solid rgba(255,120,160,.45); color: #ffc9d9; background: rgba(255,40,90,.12);
}
.cv-enter {
  font-family: inherit; font-size: 17px; letter-spacing: .3em; font-weight: 700;
  padding: 16px 46px; border: 0; border-radius: 2px; cursor: pointer;
  background: linear-gradient(135deg, #ff2d63, #ff5c8a); color: #fff;
  box-shadow: 0 10px 40px rgba(255,30,80,.5);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cv-enter:hover { transform: translateY(-2px); box-shadow: 0 14px 46px rgba(255,30,80,.6); }
.cv-foot { margin-top: 26px; font-size: 10px; letter-spacing: .28em; color: rgba(255,180,200,.55); }

/* 文风 / 场景 */
.mood-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 14px 0; }
.mood-label { font-size: 11px; color: var(--muted); margin-right: 4px; }
.mood-chip {
  font-family: inherit; font-size: 11.5px; padding: 4px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(140,200,255,.22); background: rgba(140,200,255,.06); color: #a9c0d8;
}
.mood-chip.active { border-color: rgba(255,120,160,.6); background: rgba(255,60,120,.18); color: #ffd0de; }

.coc-create {
  position: fixed; inset: 0; z-index: 61; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(255,20,80,.35), transparent 55%), #14020a;
  overflow-y: auto; padding: 40px 20px;
}
.coc-create[hidden] { display: none; }
.cc-inner { width: 100%; max-width: 420px; text-align: center; }
.cc-kicker { font-size: 10px; letter-spacing: .3em; color: #ff7aa2; margin-bottom: 14px; }
.cc-title { font-size: 24px; margin: 0 0 26px; color: #fff; letter-spacing: .08em; }
.cc-field { display: block; text-align: left; margin-bottom: 16px; }
.cc-field span { display: block; font-size: 11px; letter-spacing: .18em; color: #ffb3c9; margin-bottom: 8px; }
.cc-field input, .cc-field select {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14px;
  padding: 12px 14px; border-radius: 4px; color: #fff;
  border: 1px solid rgba(255,120,160,.35); background: rgba(255,255,255,.05);
}
.cc-field select option { background: #1b0309; color: #fff; }
.cc-preview { font-size: 11.5px; color: rgba(255,190,210,.7); line-height: 1.7; margin: 6px 0 26px; }
.cc-foot { margin-top: 22px; font-size: 10px; letter-spacing: .1em; color: rgba(255,180,200,.45); line-height: 1.7; }

.coc-bubble.beauty { padding: 0; background: transparent; border: 0; overflow: hidden; }
.beauty-frame {
  width: 100%; height: 520px; border: 0; border-radius: 14px; display: block;
  background: #0a0206;
}

/* 聊天气泡适配（手机 / 电脑） */
.coc-log { padding: 12px 14px 24px; }
.coc-msg { display: flex; flex-direction: column; margin-bottom: 14px; max-width: 100%; }
.coc-msg.kp { align-items: stretch; }
.coc-msg .coc-bubble {
  max-width: min(780px, 100%);
  width: fit-content;
  padding: 12px 16px;
  line-height: 1.85;
  font-size: 14.5px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.coc-msg.me { align-items: flex-end; }
.coc-msg.me .coc-bubble { max-width: min(560px, 88%); background: rgba(140,200,255,.12); }
.coc-msg.kp .coc-bubble { background: rgba(255,255,255,.04); }
.coc-bubble.beauty { width: 100%; max-width: min(820px, 100%); }
.beauty-frame { width: 100%; height: 460px; border: 0; border-radius: 14px; display: block; background: #0a0206; }
@media (max-width: 640px) {
  .coc-log { padding: 10px 10px 20px; }
  .coc-msg .coc-bubble { font-size: 14px; padding: 10px 12px; }
  .beauty-frame { height: 420px; }
  .mood-bar { gap: 5px; }
  .mood-chip { font-size: 11px; padding: 4px 9px; }
}

/* 双人团 · 两位调查员 */
.duo-sheet-card {
  border: 1px solid rgba(140,200,255,.18); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; background: rgba(140,200,255,.04);
}
.duo-sheet-head { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 10px; }
.duo-me { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: rgba(255,120,160,.25); color: #ffd0de; margin-left: 4px; }
.duo-occ { font-size: 11.5px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.duo-bar-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; font-size: 11.5px; }
.duo-bar-label { width: 2.6em; color: #a9c0d8; }
.duo-bar-track { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.duo-bar-track i { display: block; height: 100%; }
.duo-bar-num { width: 4.4em; text-align: right; color: #c3d0e0; }
.duo-attrs { margin-top: 8px; font-size: 11.5px; color: #9fb4c9; line-height: 1.7; }
.duo-skills { margin-top: 4px; font-size: 11px; color: #8ea4ba; line-height: 1.7; }

.duo-clues { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 3px; }
.duo-clues b { font-size: 11px; color: #8fb8d8; font-weight: 500; margin-bottom: 2px; }
.duo-clues span { font-size: 11.5px; color: #9fb4c9; line-height: 1.6; }
