:root {
  --bg: #0f1016;
  --surface: #171923;
  --surface-2: #1e2130;
  --line: #2a2e3d;
  --text: #e9e7e3;
  --muted: #8b90a0;
  --accent: #d94f63;
  --accent-dim: rgba(217, 79, 99, 0.14);
  --gold: #d9a441;
  --green: #7fb069;
  --radius: 14px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.view {
  height: 100vh;
  height: var(--app-height, 100dvh);
}

/* ---------------- 首页 ---------------- */

#view-home {
  overflow-y: auto;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(217, 79, 99, 0.14), transparent 60%),
    var(--bg);
}

.home-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 64px 24px 40px;
  text-align: center;
}

.home-mark {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
  border: 1px solid rgba(217, 79, 99, 0.35);
  border-radius: 999px;
  padding: 3px 14px;
  margin-bottom: 22px;
}

.home-title {
  font-size: 44px;
  line-height: 1.15;
  letter-spacing: 0.16em;
  margin: 0 0 12px;
  font-weight: 600;
  text-indent: 0.16em;
}

.home-sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 32px;
}

.home-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 20px;
  text-align: left;
}

.field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin: 0 0 8px;
}

.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s;
}

.input:focus {
  border-color: var(--accent);
}

.textarea {
  display: block;
  resize: vertical;
  min-height: 78px;
  line-height: 1.6;
  font-family: inherit;
}

.soup-form {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.soup-preview {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: #cfcbc6;
  line-height: 1.7;
  white-space: pre-wrap;
}

.input-code {
  letter-spacing: 0.4em;
  text-transform: uppercase;
  text-align: center;
  font-weight: 600;
}

.input-code.is-flash {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* 首页的剧本选择 */

.case-list {
  display: grid;
  gap: 10px;
}

.case-pick {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.case-pick.is-on {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.cp-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.cp-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.cp-count {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.cp-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  padding: 2px 2px 0;
}

.cp-tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 400;
  color: #b9a5d6;
  border: 1px solid rgba(185, 165, 214, 0.45);
  border-radius: 999px;
  padding: 0 7px;
  vertical-align: middle;
}

.map-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.map-img {
  width: 100%;
  display: block;
  border-radius: 8px;
  background: #14161f;
}

/* 海龟汤问答 */

.msg-answer {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 1px 10px;
  align-self: flex-start;
}

.ans-yes {
  color: #9fe0b0;
  background: rgba(127, 176, 105, 0.18);
}

.ans-no {
  color: #f0a0a0;
  background: rgba(217, 79, 99, 0.18);
}

.ans-irrelevant {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.answer-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.ans-btn {
  appearance: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
}

.ans-btn:active {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.05s;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-block {
  display: block;
  width: 100%;
  margin-top: 14px;
}

.btn-mini {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
}

.home-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.home-divider::before,
.home-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.home-foot {
  margin-top: 26px;
  font-size: 12px;
  color: var(--muted);
}

.home-tools {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.home-tools .btn {
  flex: 1;
  font-size: 13px;
  padding: 10px;
}

/* ---------------- 大厅 ---------------- */

#view-lobby {
  overflow-y: auto;
  background:
    radial-gradient(120% 50% at 50% 0%, rgba(217, 79, 99, 0.1), transparent 60%),
    var(--bg);
}

.lobby-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 22px 40px;
}

.lobby-head {
  text-align: center;
  margin-bottom: 28px;
}

.lobby-label {
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.lobby-code {
  font-size: 46px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-indent: 0.24em;
  margin: 6px 0 12px;
  font-variant-numeric: tabular-nums;
}

.lobby-case {
  font-size: 13px;
  color: var(--muted);
  margin: -6px 0 12px;
}

.lobby-list {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.lobby-seat {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}

.lobby-seat.empty {
  opacity: 0.45;
  border-style: dashed;
}

.seat-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}

.seat-dot.off {
  background: var(--muted);
}

.seat-name {
  flex: 1;
  font-weight: 500;
}

.seat-tag {
  font-size: 11px;
  color: var(--accent);
  border: 1px solid rgba(217, 79, 99, 0.4);
  padding: 1px 8px;
  border-radius: 999px;
}

.lobby-hint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  min-height: 22px;
}

.lobby-actions {
  margin-top: 18px;
}

/* 剧本工坊 · 分步表单 */

#view-builder {
  overflow-y: auto;
  background: var(--bg);
}

.builder-wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 18px 40px;
}

.builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.builder-title {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}

.builder-bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 18px;
}

.builder-bar b {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.2s;
}

.field {
  margin-bottom: 14px;
}

.b-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.b-grid .field {
  margin-bottom: 0;
}

.b-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.b-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.b-card-title {
  font-weight: 600;
}

.b-colors {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}

.b-color {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.b-color.is-on {
  border-color: #fff;
}

.b-clue {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
}

.b-clue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.b-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.builder-error {
  background: rgba(217, 79, 99, 0.12);
  border: 1px solid rgba(217, 79, 99, 0.4);
  color: #f0b3b9;
  font-size: 12px;
  white-space: pre-wrap;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0;
}

.builder-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.builder-actions .btn {
  flex: 1;
}

.builder-foot {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.builder-foot a {
  color: var(--accent);
}

.b-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 6px;
}

/* 创作中心 */

.create-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.create-tab {
  flex: 1;
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  padding: 11px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.create-tab.is-on {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

/* 我的汤库 */

.lib-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.lib-check {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  flex: none;
  accent-color: var(--accent);
}

.lib-main {
  flex: 1;
  min-width: 0;
}

.lib-title {
  font-weight: 600;
  font-size: 15px;
}

.lib-surface {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lib-acts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
}

/* ---------------- 游戏主界面 ---------------- */

.game-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: var(--app-height, 100dvh);
  max-width: 620px;
  margin: 0 auto;
  background: var(--bg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}

.topbar-phase {
  font-size: 15px;
  font-weight: 600;
}

.topbar-room {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.topbar-right {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  line-height: 1.4;
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: none;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: none;
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  padding: 8px 9px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
}

.tab.is-active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.phasebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.015);
  border-bottom: 1px solid var(--line);
  flex: none;
}

.phasebar .phase-tip {
  flex: 1;
  line-height: 1.5;
}

.phasebar .btn {
  flex: none;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 8px;
}

.panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 28px;
  -webkit-overflow-scrolling: touch;
}

.composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}

.chat-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  padding: 11px 12px;
  outline: none;
  font-family: inherit;
}

.chat-input:focus {
  border-color: var(--accent);
}

.btn-send {
  flex: none;
  padding: 0 18px;
  font-size: 14px;
}

/* ---------------- 剧本 ---------------- */

.role-card {
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--role-color, #d94f63), #1b1d28 130%);
}

.role-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.role-job {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 2px;
}

.role-meta {
  font-size: 12px;
  opacity: 0.72;
  margin-top: 8px;
}

.section {
  margin-bottom: 18px;
}

.section-title {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.story {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 8px;
}

.story p {
  margin: 0 0 12px;
  color: #d8d5d0;
  font-size: 15px;
  line-height: 1.85;
}

.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.box ul {
  margin: 0;
  padding-left: 18px;
}

.box li {
  margin-bottom: 8px;
  color: #d8d5d0;
}

.box li:last-child {
  margin-bottom: 0;
}

.box-danger {
  border-color: rgba(217, 79, 99, 0.4);
  background: linear-gradient(180deg, var(--accent-dim), var(--surface));
}

.box-danger .box-head {
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
}

/* ---------------- 搜证 ---------------- */

.search-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.search-head .big {
  font-size: 20px;
  font-weight: 700;
}

.search-head .small {
  font-size: 12px;
  color: var(--muted);
}

.loc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.loc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.loc-name {
  font-size: 17px;
  font-weight: 600;
}

.loc-count {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}

.loc-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.loc-card .btn {
  width: 100%;
  font-size: 14px;
  padding: 10px;
}

/* ---------------- 线索 ---------------- */

.clue {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.clue.private {
  border-left-color: var(--accent);
}

.clue-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.clue-text {
  font-size: 14px;
  color: #d0cdc8;
  line-height: 1.75;
}

.clue-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.badge {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 500;
}

.badge-gold {
  color: var(--gold);
  background: rgba(217, 164, 65, 0.12);
}

.badge-red {
  color: var(--accent);
  background: var(--accent-dim);
}

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 40px 20px;
  line-height: 1.9;
}

/* ---------------- 讨论 ---------------- */

.msg-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 86%;
}

.msg.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-who {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 3px;
  padding: 0 4px;
}

.msg-bubble {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.msg.mine .msg-bubble {
  background: var(--accent-dim);
  border-color: rgba(217, 79, 99, 0.35);
}

.msg-sys {
  align-self: center;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 4px 14px;
  max-width: 92%;
}

/* ---------------- 投票 ---------------- */

.vote-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.vote-card .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  flex: none;
}

.vote-card .who {
  flex: 1;
  min-width: 0;
}

.vote-card .who .n {
  font-weight: 600;
}

.vote-card .who .j {
  font-size: 12px;
  color: var(--muted);
}

.vote-card.picked {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* 私聊名单 */

.dm-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.dm-who {
  flex: 1;
  min-width: 0;
}

.dm-who .n {
  font-weight: 600;
}

.dm-who .j {
  font-size: 12px;
  color: var(--muted);
}

.vote-card .btn {
  font-size: 13px;
  padding: 8px 14px;
}

/* ---------------- 复盘 ---------------- */

.result-hero {
  border-radius: 18px;
  padding: 24px 20px;
  margin-bottom: 18px;
  text-align: center;
  background: linear-gradient(160deg, rgba(217, 79, 99, 0.22), var(--surface) 70%);
  border: 1px solid rgba(217, 79, 99, 0.3);
}

.result-hero .r-winner {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.result-hero .r-head {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
}

/* 本局评价 */

.eval-card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.eval-card.is-mvp {
  border-color: rgba(217, 164, 65, 0.55);
  background: linear-gradient(180deg, rgba(217, 164, 65, 0.1), var(--surface) 65%);
}

.eval-main {
  flex: 1;
  min-width: 0;
}

.eval-line1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.eval-role {
  font-weight: 700;
  font-size: 16px;
}

.eval-player {
  font-size: 12px;
  color: var(--muted);
}

.eval-crown {
  font-size: 10px;
  font-weight: 700;
  color: #1a1408;
  background: var(--gold);
  border-radius: 999px;
  padding: 1px 8px;
}

.eval-title {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  border: 1px solid rgba(217, 79, 99, 0.4);
  border-radius: 999px;
  padding: 1px 9px;
  margin: 6px 0 4px;
}

.eval-comment {
  font-size: 13px;
  color: #cfcbc6;
  line-height: 1.65;
}

.eval-bars {
  margin-top: 10px;
  display: grid;
  gap: 5px;
}

.eval-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.eval-bar .lbl {
  width: 26px;
  flex: none;
}

.eval-bar .track {
  flex: 1;
  height: 5px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.eval-bar .track b {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #f08a6a);
}

.eval-bar .val {
  width: 24px;
  text-align: right;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.eval-badges {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.eval-badge {
  font-size: 11px;
  color: #d8d4cf;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}

.eval-quip {
  font-size: 12.5px;
  color: #9aa0ad;
  font-style: italic;
  margin-top: 5px;
  line-height: 1.6;
}

.eval-hist {
  font-size: 11px;
  color: #6f7482;
  margin-top: 9px;
}

/* 本机战绩 */

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}

.rank-row:last-child {
  border-bottom: none;
}

.rank-no {
  width: 18px;
  flex: none;
  color: var(--muted);
  font-size: 12px;
}

.rank-name {
  flex: 1;
  font-weight: 500;
}

.rank-stat {
  font-size: 12px;
  color: var(--muted);
}

.rank-tip {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  text-align: right;
}

/* 战报长图 */

.share-card {
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.share-img {
  width: 100%;
  display: block;
  border-radius: 12px;
  background: var(--surface-2);
}

.share-tip {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 12px 0;
}

.truth-step {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.truth-step .idx {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 2px;
}

.truth-step .txt {
  font-size: 14px;
  color: #d0cdc8;
  line-height: 1.8;
}

.role-truth {
  border-left: 3px solid var(--line);
  padding: 2px 0 2px 14px;
  margin-bottom: 16px;
}

.role-truth .rt-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.role-truth .rt-job {
  font-size: 12px;
  color: var(--muted);
}

/* ---------------- 弹窗 / 提示 ---------------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
}

.modal-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  max-height: 88vh;
  overflow-y: auto;
  animation: pop 0.18s ease-out;
}

.script-area {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  min-height: 240px;
}

.script-tools {
  display: flex;
  gap: 8px;
  margin: 10px 0 4px;
}

.script-error {
  background: rgba(217, 79, 99, 0.12);
  border: 1px solid rgba(217, 79, 99, 0.4);
  color: #f0b3b9;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  max-height: 160px;
  overflow-y: auto;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
}

.modal-tag {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 6px;
}

.modal-title {
  font-size: 20px;
  margin: 0 0 10px;
  font-weight: 700;
}

.modal-text {
  font-size: 14px;
  color: #d0cdc8;
  margin: 0 0 12px;
  line-height: 1.8;
}

.modal-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 18px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  line-height: 1.7;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(30, 33, 48, 0.96);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 60;
  max-width: 86vw;
  text-align: center;
  animation: pop 0.16s ease-out;
}
