/* 自托管 Inter（latin 子集可变字体，一个文件覆盖 100–900 全字重）。
   之前字体栈里 Inter 排第一却从未打包，各平台各自 fallback：Mac 落 SF、
   Windows 落 Segoe UI + ClearType 偏重 → 数字/英文在 Win 上明显更粗。
   自托管后三平台统一渲染 Inter，从源头消除差异。unicode-range 限定 latin，
   中文照常落 PingFang SC/系统字体（Inter 本就无中文字形）。 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #1d2825;
  --muted: #71807a;
  --line: #dfe7e3;
  --canvas: #eef3f0;
  --paper: #fbfcfb;
  --accent: #175f4c;
  --accent-soft: #e0eee8;
  --warm: #fff7ea;
  --danger: #a84b42;
  --shadow: 0 18px 50px rgba(24, 53, 44, 0.12);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--canvas); min-width: 1000px; overflow-x: auto; overflow-y: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }

.app-shell { display: grid; grid-template-columns: 260px minmax(520px, 1fr) 280px; height: 100vh; height: 100dvh; min-height: 0; padding: 14px; gap: 1px; overflow: hidden; }
.sidebar, .chat-panel { min-height: 0; background: var(--paper); border: 1px solid rgba(29, 40, 37, .07); overflow: hidden; }
.left-panel { border-radius: 20px 0 0 20px; display: flex; flex-direction: column; padding: 22px 16px; }
.right-panel { border-radius: 0 20px 20px 0; padding: 25px 18px; display: flex; flex-direction: column; }
.chat-panel { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; position: relative; }
.chat-header { grid-row: 1; }
.game-console { grid-row: 2; }
.private-memory-notice { grid-row: 3; }
.messages { grid-row: 4; }
.composer-wrap { grid-row: 5; }

.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 25px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--accent); border-radius: 50%; font-family: Georgia, serif; font-size: 18px; box-shadow: 0 7px 18px rgba(23, 95, 76, .25); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 16px; letter-spacing: .04em; }
.brand span { color: var(--muted); font-size: 11px; margin-top: 3px; }

.room-list { display: flex; flex-direction: column; gap: 4px; max-height: 30vh; overflow-y: auto; margin-bottom: 20px; }
.room-row { display: flex; align-items: center; border-radius: 13px; }
.room-row.active { background: var(--accent-soft); }
.room-card, .thread-item { width: 100%; border: 0; background: transparent; display: flex; align-items: center; text-align: left; border-radius: 13px; cursor: pointer; }
.room-card { padding: 10px; gap: 10px; min-width: 0; }
.room-card.active { background: var(--accent-soft); }
.room-manage { width: 26px; flex: 0 0 26px; height: 30px; border: 0; background: transparent; color: #83908b; cursor: pointer; opacity: 0; }
.room-row:hover .room-manage, .room-row.active .room-manage { opacity: 1; }
.room-icon { background: var(--accent); color: white; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.room-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-card span:nth-child(2) { min-width: 0; flex: 1; }
.room-card b, .room-card small, .thread-item b, .thread-item small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-card b, .thread-item b { font-size: 13px; }
.room-card small, .thread-item small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.section-label { padding: 0 8px 9px; display: flex; align-items: baseline; justify-content: space-between; }
.section-label span { color: #46534f; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .11em; }
.section-label small { color: #9aa5a1; font-size: 9px; }
.room-label button { border: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 700; cursor: pointer; }
.thread-list { min-height: 0; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overscroll-behavior: contain; }
.thread-section { margin-bottom: 4px; }
.thread-section-head { width: 100%; border: 0; background: transparent; display: flex; align-items: center; gap: 5px; padding: 5px 8px 3px; cursor: pointer; color: #7d8a85; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.thread-section-head i { font-style: normal; font-size: 9px; color: #9aa5a1; }
.thread-section-head:hover { color: var(--accent); }
.thread-section-body { display: flex; flex-direction: column; gap: 3px; }
.thread-empty { display: block; padding: 4px 12px; color: #a8b2ad; font-size: 10px; }
.thread-item { padding: 9px 10px; gap: 10px; }
.thread-item:hover, .thread-item.active { background: #edf2ef; }
.avatar { flex: 0 0 auto; width: 33px; height: 33px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; color: white; font-weight: 700; font-size: 11px; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thread-item span:nth-child(2) { min-width: 0; flex: 1; }
.left-actions { margin-top: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding-top: 15px; }
.left-actions .ghost-button { min-width: 0; height: 40px; display: grid; place-items: center; padding: 0 5px; line-height: 1.15; white-space: nowrap; }
.reset-button { color: #8f625d; }

.chat-header { min-height: 86px; padding: 19px 28px 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.header-title { min-width: 0; }
.title-line { display: flex; align-items: center; gap: 6px; }
.title-line h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-line button { border: 0; background: transparent; color: #93a09b; cursor: pointer; letter-spacing: .08em; padding: 3px 6px; }
.title-line .back-to-room { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 6px 9px; margin-right: 3px; font-size: 10px; font-weight: 700; letter-spacing: 0; white-space: nowrap; }
.eyebrow { display: block; text-transform: uppercase; font-size: 9px; color: #8b9893; letter-spacing: .13em; font-weight: 800; margin-bottom: 3px; }
h1, h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-weight: 600; }
h1 { font-size: 21px; }
h2 { font-size: 20px; }
.header-actions { display: flex; gap: 8px; }
.primary-button, .soft-button, .ghost-button, .danger-button { border: 0; border-radius: 10px; padding: 9px 14px; cursor: pointer; font-size: 12px; font-weight: 700; }
.primary-button { background: var(--accent); color: white; box-shadow: 0 5px 12px rgba(23, 95, 76, .15); }
.primary-button:hover { background: #104f3e; }
.soft-button { background: var(--accent-soft); color: var(--accent); }
.sound-settings-button { width: 36px; padding: 0; display: grid; place-items: center; font-size: 15px; }
.ghost-button { background: #edf2ef; color: #53615c; text-align: center; }
.danger-button { background: #f4e4e2; color: var(--danger); }
button:disabled { opacity: .5; cursor: not-allowed; }
.round-control { position: relative; display: inline-flex; }
.round-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 220px; padding: 6px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.round-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 9px; padding: 8px 10px; cursor: pointer; }
.round-menu button:hover { background: var(--accent-soft); }
.round-menu b { display: block; font-size: 12px; color: var(--accent); }
.round-menu small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.hidden { display: none !important; }

.game-console { margin: 12px 28px 0; border: 1px solid #e3d3c0; background: #fbf6ee; border-radius: 12px; padding: 12px 14px; font-size: 11px; color: #5b5346; }
.game-console.collapsed { padding-bottom: 3px; }
.game-console-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.game-console.collapsed .game-console-head { margin-bottom: 0; }
.game-console-head b { font-size: 12px; color: #7a4a2f; }
.game-console-phase { padding: 3px 9px; border-radius: 999px; background: #7a4a2f; color: white; font-size: 10px; font-weight: 700; }
.game-console-head .spacer { flex: 1; }
.game-flow { display: grid; gap: 6px; margin: -1px 0 10px; padding: 8px 10px; border: 1px solid #eadfcf; border-radius: 10px; background: #fffaf2; }
.game-flow-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.game-flow-steps span { padding: 4px 8px; border-radius: 999px; background: #efe6d8; color: #8b7965; font-size: 9px; font-weight: 700; }
.game-flow-steps span.done { background: #e6f0e9; color: #4f7a60; }
.game-flow-steps span.current { background: #7a4a2f; color: white; }
.game-flow small { color: #8a7a65; font-size: 9px; line-height: 1.45; }
.task-card { margin: 0 0 10px; border: 1px solid #e5dac9; border-radius: 11px; background: #fffaf2; overflow: hidden; }
.task-card summary { cursor: pointer; list-style: none; padding: 8px 10px; color: #7a4a2f; font-size: 10px; font-weight: 800; }
.task-card summary::-webkit-details-marker { display: none; }
.task-card summary::before { content: "▾"; display: inline-block; width: 14px; color: #a8835f; }
.task-card:not([open]) summary::before { content: "▸"; }
.task-card-body { display: grid; gap: 7px; padding: 0 10px 10px; }
.task-card-line { margin: 0; color: #6d604f; font-size: 10px; line-height: 1.55; }
.task-card-content { max-height: 300px; margin: 0; padding: 9px 10px; overflow: auto; border: 1px solid #eadfcf; border-radius: 8px; background: #fff; color: #5f5548; font: inherit; font-size: 10px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.speaker-queue { display: flex; flex-wrap: wrap; gap: 5px; }
.speaker-queue span { padding: 4px 7px; border-radius: 999px; background: #efe6d8; color: #8b7965; font-size: 9px; font-weight: 700; }
.speaker-queue span.done { background: #e6f0e9; color: #4f7a60; }
.speaker-queue span.current { background: #7a4a2f; color: white; }
.speaker-queue span.pending { background: white; border: 1px solid #eadfcf; }
.game-history { margin: 9px 0 0; border-top: 1px solid #eadfcf; padding-top: 8px; }
.game-history summary { cursor: pointer; color: #7a4a2f; font-size: 10px; font-weight: 800; }
.game-history div { display: grid; gap: 4px; max-height: 260px; overflow-y: auto; margin-top: 7px; }
.game-history p { margin: 0; padding: 5px 7px; border-radius: 7px; background: #fffaf2; color: #6d604f; font-size: 9px; line-height: 1.45; }
.game-history p span { color: #a39582; margin-right: 6px; }
.game-console-roster { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.game-roster-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: white; border: 1px solid #e6dccd; font-size: 10px; }
.game-roster-chip > b { color: #7a4a2f; font-size: 9px; }
.game-roster-chip.dead { opacity: .5; text-decoration: line-through; }
.game-roster-chip .role-tag { color: #7a4a2f; font-weight: 700; }
.game-roster-chip .role-tag.wolf { color: var(--danger); }
.sheriff-badge { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #c48b3e; color: white; font-size: 9px; font-weight: 800; text-decoration: none; }
.roundtable-wrap { display: grid; gap: 7px; margin: 0 0 10px; padding: 9px 10px; border: 1px solid #eadfcf; border-radius: 12px; background: #fffdf8; }
.roundtable-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: #7a4a2f; }
.roundtable-title b { font-size: 11px; }
.roundtable-title small { color: #9a8d78; font-size: 9px; }
.roundtable { position: relative; width: min(100%, 300px); aspect-ratio: 1 / 1; margin: 0 auto; border-radius: 50%; background: radial-gradient(circle at center, #fffaf2 0 30%, transparent 31%), linear-gradient(#f7efe4, #f7efe4); border: 1px dashed #d7c7b1; }
.roundtable-core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; background: #7a4a2f; color: #fff; font-size: 11px; font-weight: 800; box-shadow: 0 6px 16px rgba(122,74,47,.18); }
.table-seat { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; min-width: 54px; max-width: 78px; padding: 5px 7px; border: 1px solid #ded0bf; border-radius: 12px; background: white; color: #53483d; font-size: 9px; line-height: 1.2; text-align: center; box-shadow: 0 4px 12px rgba(76,54,34,.08); }
.table-seat b { color: #7a4a2f; font-size: 10px; }
.table-seat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 64px; }
.table-seat i { position: absolute; right: -5px; top: -5px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: #c48b3e; color: white; font-style: normal; font-size: 9px; font-weight: 800; }
.table-seat.sheriff { border-color: #c48b3e; box-shadow: 0 0 0 2px rgba(196,139,62,.18); }
.table-seat.dead { opacity: .45; text-decoration: line-through; }
.game-console-setup { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.game-console-setup label { display: inline-flex; align-items: center; gap: 5px; margin: 0; color: #6a604f; font-size: 10px; font-weight: 700; }
.game-console-setup input[type="number"] { width: 52px; height: 30px; border: 1px solid #ddd3c3; border-radius: 8px; text-align: center; }
.game-console-setup input[type="checkbox"] { width: 15px; height: 15px; accent-color: #7a4a2f; }
.game-console-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.game-button { border: 0; border-radius: 9px; padding: 7px 13px; font-size: 11px; font-weight: 700; cursor: pointer; background: #7a4a2f; color: white; }
.game-button.compact { padding: 5px 10px; font-size: 10px; }
.game-button:hover { background: #693d25; }
.game-button.ghost { background: #efe6d8; color: #6a4a30; }
.night-panel { display: flex; flex-direction: column; gap: 7px; }
.night-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 9px; background: white; border: 1px solid #ece2d3; border-radius: 9px; font-size: 10px; }
.night-row > b { color: #7a4a2f; min-width: 44px; }
.night-row .game-button { padding: 5px 10px; }
.night-info { color: #6a604f; white-space: pre-line; }
.game-note { font-size: 10px; color: #9a8d78; align-self: center; }

.private-memory-notice { margin: 12px 28px 0; min-height: 38px; border: 1px solid #cfe0da; background: #eef7f3; border-radius: 11px; display: flex; align-items: center; padding: 8px 12px; gap: 9px; color: #527067; font-size: 10px; }
.private-memory-notice b { color: var(--accent); white-space: nowrap; }

.messages { min-height: 0; height: auto; padding: 24px 28px 14px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; scroll-behavior: auto; }
.messages.selecting { overflow-anchor: none; }
.message-entry { position: relative; min-width: 0; }
.message-check { position: absolute; z-index: 1; left: -25px; top: 9px; width: 21px; height: 21px; display: grid; place-items: center; padding: 0; border: 1px solid #bdcac5; border-radius: 6px; background: white; color: white; cursor: pointer; font-size: 12px; font-weight: 800; line-height: 1; }
.message-check:hover { border-color: #76a292; }
.message-check.selected { border-color: var(--accent); background: var(--accent); }
.message-entry.selected { border-radius: 12px; background: rgba(224, 238, 232, .45); }
.empty-state { height: 100%; min-height: 280px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-state .empty-icon { margin: auto auto 14px; width: 54px; height: 54px; border: 1px solid #cfdbd6; border-radius: 50%; display: grid; place-items: center; font-family: Georgia, serif; font-size: 21px; color: var(--accent); }
.empty-state .empty-icon { overflow: hidden; }
.empty-state .empty-icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
.empty-state h3 { margin: 0 0 7px; color: #394742; font-family: Georgia, "Songti SC", serif; font-size: 18px; }
.empty-state p { margin: 0; font-size: 12px; line-height: 1.7; }
.message { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; margin-bottom: 18px; max-width: 84%; }
.message.mine { grid-template-columns: minmax(0, 1fr) 38px; margin-left: auto; }
.message.mine .avatar { grid-column: 2; grid-row: 1; }
.message.mine .message-body { grid-column: 1; grid-row: 1; align-items: flex-end; }
.message-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.message-meta { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #8c9994; margin: 0 3px 5px; }
.message-meta b { color: #40504a; font-size: 11px; }
.message-meta .fast-marker { color: #9a6a2f; font-weight: 700; }
.bubble { background: #f0f4f2; border: 1px solid #e4eae7; border-radius: 4px 14px 14px 14px; padding: 10px 13px; font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.mine .bubble { color: white; background: var(--accent); border: 0; border-radius: 14px 4px 14px 14px; }
.system-message { margin: 11px auto 20px; width: fit-content; max-width: 86%; border-radius: 999px; padding: 7px 13px; background: #f7f1e5; color: #8b734d; font-size: 10px; text-align: center; }
.system-message.multiline { border-radius: 14px; text-align: left; white-space: pre-wrap; line-height: 1.65; }
.typing { display: flex; gap: 4px; padding: 12px 16px; }
.typing i { width: 5px; height: 5px; background: #80918b; border-radius: 50%; animation: pulse 1s infinite alternate; }
.typing i:nth-child(2) { animation-delay: .2s; }.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .25; transform: translateY(-2px); } }

.composer-wrap { position: relative; z-index: 5; padding: 9px 28px 22px; background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 -8px 18px rgba(251, 252, 251, .92); }
.workflow-status { display: flex; align-items: center; gap: 8px; margin: 0 3px 7px; color: #806b49; font-size: 10px; line-height: 1.45; }
.workflow-status::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border: 2px solid #d8c9aa; border-top-color: #8b734d; border-radius: 50%; animation: workflow-spin .8s linear infinite; }
@keyframes workflow-spin { to { transform: rotate(360deg); } }
.reply-row { display: flex; align-items: center; gap: 8px; margin: 0 3px 7px; font-size: 10px; color: var(--muted); }
.reply-row label { font-weight: 700; color: #53625c; }
.reply-row select { border: 0; background: transparent; color: var(--accent); outline: 0; font-size: 10px; font-weight: 700; }
.reply-row span { margin-left: auto; color: #9aa49f; }
.composer { padding: 7px 7px 7px 14px; background: white; border: 1px solid #ccd8d3; border-radius: 15px; box-shadow: 0 8px 28px rgba(32, 64, 54, .08); display: flex; align-items: flex-end; gap: 8px; }
.composer:focus-within { border-color: #80a99b; box-shadow: 0 8px 28px rgba(23, 95, 76, .12); }
.composer textarea { flex: 1; max-height: 130px; resize: none; border: 0; outline: 0; padding: 7px 0; line-height: 1.5; font-size: 13px; color: var(--ink); }
.composer textarea::placeholder { color: #a7b1ad; }
.composer button { width: 34px; height: 34px; border: 0; border-radius: 11px; background: var(--accent); color: white; font-size: 19px; cursor: pointer; }
.composer .stop-composer-button { flex: 0 0 34px; background: #f4e4e2; color: var(--danger); font-size: 13px; box-shadow: none; }
.composer .stop-composer-button:hover { background: #ead3d0; }

.panel-heading { display: flex; align-items: center; justify-content: space-between; margin: 1px 5px 20px; }
.panel-actions { display: flex; align-items: center; gap: 7px; }
.icon-button { border: 1px solid var(--line); background: white; border-radius: 10px; width: 32px; height: 32px; cursor: pointer; font-size: 18px; color: var(--accent); }
.agent-list { min-height: 0; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; overscroll-behavior: contain; }
.agent-card { border: 1px solid transparent; background: transparent; border-radius: 13px; padding: 9px 8px; display: flex; gap: 10px; align-items: center; cursor: pointer; text-align: left; }
.agent-card:hover { border-color: var(--line); background: white; }
.agent-card.dragging { opacity: .45; border-color: var(--accent); background: #f4faf7; }
.agent-card.drag-over { border-color: var(--accent); background: #eef8f3; }
.agent-card.static { cursor: default; }
.agent-card.static:hover { border-color: transparent; background: transparent; }
.session-note { margin-top: 8px; padding: 8px 10px; border-radius: 9px; background: #f4f8f6; color: #8a958f; font-size: 9px; line-height: 1.5; }
.agent-info { flex: 1; min-width: 0; }
.agent-info b, .agent-info small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-info b { font-size: 12px; }
.agent-info small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.agent-menu { opacity: 0; color: #96a19d; font-weight: 900; }
.agent-card:hover .agent-menu { opacity: 1; }
.provider-button { margin-top: auto; width: 100%; border: 1px solid var(--line); background: white; border-radius: 13px; padding: 11px; display: flex; align-items: center; gap: 9px; cursor: pointer; text-align: left; }
.provider-button span:nth-child(2) { flex: 1; }
.provider-button b, .provider-button small { display: block; }
.provider-button b { font-size: 11px; }.provider-button small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.status-dot { width: 8px; height: 8px; background: #44a57e; border-radius: 50%; box-shadow: 0 0 0 4px #e1f1ea; }
.privacy-note { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--warm); color: #76684d; }
.privacy-note b { font-size: 10px; }.privacy-note p { font-size: 9px; line-height: 1.5; margin: 4px 0 0; }
.file-button { cursor: pointer; }.file-button input { display: none; }

.modal { width: min(550px, calc(100vw - 40px)); border: 0; border-radius: 20px; padding: 0; color: var(--ink); box-shadow: var(--shadow); }
.modal.wide { width: min(820px, calc(100vw - 40px)); }
.modal::backdrop { background: rgba(15, 27, 23, .48); backdrop-filter: blur(3px); }
.modal form { padding: 25px; }
.modal-title { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.close-button { border: 0; background: #eef2f0; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 18px; color: #7b8883; }
.modal label { display: block; color: #43514c; font-size: 11px; font-weight: 700; margin-bottom: 13px; }
.modal label > span { color: #98a29e; font-weight: 400; float: right; }
.modal input, .modal textarea, .modal select { display: block; width: 100%; margin-top: 6px; border: 1px solid #d9e1de; border-radius: 10px; outline: none; color: var(--ink); background-color: white; font-size: 12px; text-align: left; }
.modal input, .modal select { height: 37px; padding: 0 12px; line-height: 35px; }
.modal input[type="range"] { height: 28px; padding: 0; accent-color: var(--accent); }
.modal textarea { padding: 9px 12px; resize: vertical; line-height: 1.5; }
.modal textarea[data-line-scroll] { padding: 10px 12px; line-height: 20px; }
.modal textarea[readonly] { color: #697771; background: #f5f8f6; cursor: default; }
.crop-stage { display: grid; place-items: center; margin: 4px 0 16px; }
.crop-stage canvas { width: 256px; height: 256px; max-width: 100%; aspect-ratio: 1; border-radius: 50%; background: #f5f8f6; box-shadow: 0 0 0 2px var(--line); cursor: grab; touch-action: none; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.crop-zoom input[type="range"] { margin-top: 0; flex: 1; }
.scenario-custom-action { margin: -4px 0 13px; padding: 10px 12px; border: 1px solid #d9e5e0; border-radius: 12px; background: #f5f9f7; }
.phase-hints-preview { margin: -3px 0 13px; border: 1px solid #d9e5e0; border-radius: 12px; background: #f5f9f7; overflow: hidden; }
.phase-hints-preview summary { cursor: pointer; list-style: none; padding: 10px 12px; color: var(--accent); font-size: 11px; font-weight: 800; }
.phase-hints-preview summary::-webkit-details-marker { display: none; }
.phase-hints-preview summary::before { content: "▸"; display: inline-block; width: 14px; color: #7da193; }
.phase-hints-preview[open] summary::before { content: "▾"; }
.phase-hints-preview summary span { float: right; color: #8c9994; font-size: 9px; font-weight: 400; }
.phase-hints-preview textarea { width: calc(100% - 20px); margin: 0 10px 10px; border-color: #d2ded9; background: #fbfdfc; color: #53625c; font-size: 11px; resize: vertical; }
.cognition-setting { margin: 2px 0 12px; padding: 9px 10px; border: 1px solid #d7e5df; border-radius: 10px; background: #f2f8f5; }
.modal .cognition-toggle { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; column-gap: 8px; margin: 0; color: var(--accent); cursor: pointer; }
.modal .cognition-toggle input { appearance: none; display: grid; place-content: center; width: 16px; height: 16px; margin: 1px 0 0 1px; padding: 0; border: 1px solid #87a89c; border-radius: 3px; background: #fff; cursor: pointer; }
.modal .cognition-toggle input::after { content: ""; width: 4px; height: 8px; margin-top: -2px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transform-origin: center; }
.modal .cognition-toggle input:checked { border-color: var(--accent); background: var(--accent); }
.modal .cognition-toggle input:checked::after { transform: rotate(45deg) scale(1); }
.modal .cognition-toggle input:focus-visible { outline: 2px solid #9fc5b7; outline-offset: 2px; }
.modal .cognition-toggle > span { min-width: 0; float: none; color: inherit; }
.cognition-toggle b, .cognition-toggle small, .cognition-title b { display: block; }
.cognition-toggle b, .cognition-title b { font-size: 11px; line-height: 16px; }
.cognition-toggle small { margin-top: 2px; color: #72817b; font-size: 9px; font-weight: 400; line-height: 1.45; }
.setting-action { display: flex; align-items: center; gap: 9px; margin: 9px 0 0 26px; padding-top: 9px; border-top: 1px solid #dce7e2; }
.setting-action button { flex: 0 0 auto; padding: 7px 11px; }
.setting-action small { color: #72817b; font-size: 9px; line-height: 1.45; }
/* 说明改为“悬停标题才出现”：标题带虚线下划线暗示可看说明，鼠标移上或聚焦才弹浮层，不再用扎眼的图标。 */
.modal .tip { float: none; color: inherit; font-weight: inherit; text-decoration: underline dotted rgba(120, 140, 130, .55); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.modal .tip:hover, .modal .tip:focus-visible { text-decoration-color: var(--accent); outline: none; }
/* 选项与其操作按钮同一行、按钮统一右对齐。 */
/* min-height = 操作按钮(重置认知/更新信息)的高度：让带按钮与不带按钮的行等高，三个方框整体外观统一。 */
.cognition-row { display: flex; align-items: center; gap: 10px; min-height: 31px; }
.cognition-row > .cognition-toggle, .cognition-row > .cognition-title { flex: 1 1 auto; min-width: 0; margin: 0; }
.cognition-row > .cognition-title { padding-left: 26px; color: var(--accent); } /* 无勾选框，缩进 26px(18px 框+8px 间距)与其它系统标题对齐 */
.cognition-row .cognition-select { flex: 0 0 auto; width: auto; min-width: 132px; height: 30px; margin: 0; box-sizing: border-box; border: 1px solid #cddbd5; border-radius: 8px; padding: 0 10px; font-size: 12px; line-height: 28px; color: #43514c; background: #fff; cursor: pointer; text-align: center; text-align-last: center; } /* height:30px + margin:0 压到与其它行同一基线：否则 select 默认 37px 高、又从 .modal select 继承 margin-top:6px，把思考系统那个框撑高 5~12px；提高特异性覆盖 .modal select 的 width:100%，否则下拉占满整行、把标题挤成竖排；text-align(-last):center 让选中项「每次询问」在框内水平居中；line-height:28px 覆盖 .modal select 继承的 35px（35px 塞进 28px 内容区会把文字顶得上下不居中）＝垂直居中 */
.cognition-title { display: flex; align-items: center; color: var(--accent); font-size: 11px; font-weight: 700; }
.cognition-row > .setting-action { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 0; border: 0; }
/* 断线重取密码：验证密码按钮贴在输入框右侧。 */
.input-with-action { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.input-with-action > input { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.input-with-action > .setting-action { flex: 0 0 auto; margin: 0; padding: 0; border: 0; }
/* 房间头像：上传/移除按钮推到最右，头像预览留在左侧。 */
#roomDialog .agent-avatar-row .avatar-upload-button { margin-left: auto; }
/* 悬停浮层本体：进入浏览器顶层（popover），JS 按位置定位，避免被滚动的对话框裁剪。 */
.hint-tip { position: fixed; margin: 0; inset: auto; width: min(248px, calc(100vw - 24px)); padding: 9px 12px; border: 0; border-radius: 10px; background: #263230; color: #eef4f1; font-size: 11px; font-weight: 400; line-height: 1.55; box-shadow: 0 10px 28px rgba(15, 27, 23, .3); opacity: 0; transform: translateY(-3px); transition: opacity .12s ease, transform .12s ease; pointer-events: none; }
.hint-tip.show { opacity: 1; transform: translateY(0); }
.hint-tip code { font-family: inherit; }
/* 二级菜单：场景说明 / 玩法提示折叠，展开才看到长文本域。 */
.field-details { margin: 0 0 13px; border: 1px solid #d9e1de; border-radius: 12px; background: #fff; overflow: hidden; }
.field-details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; padding: 11px 13px; color: #43514c; font-size: 11px; font-weight: 700; }
.field-details > summary::-webkit-details-marker { display: none; }
.field-details > summary::before { content: "▸"; margin-right: 7px; color: #7da193; font-size: 10px; }
.field-details[open] > summary::before { content: "▾"; }
.field-details > summary .status { margin-left: auto; padding-left: 10px; color: #98a29e; font-weight: 400; }
.field-details-body { padding: 0 13px 12px; }
/* 显式折叠：.modal textarea 的 display:block 会盖过原生 details 收起，必须手动隐藏内容。 */
.field-details:not([open]) > .field-details-body { display: none; }
.field-details-body > .scenario-custom-action, .field-details-body > .phase-hints-preview { margin-top: 11px; margin-bottom: 0; }
.modal select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%2371807a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; }
.modal input:focus, .modal textarea:focus, .modal select:focus { border-color: #7ca696; }
.form-grid.two { display: grid; grid-template-columns: 1fr 110px; gap: 12px; }
.agent-avatar-setting { margin: -1px 0 13px; }
.agent-avatar-label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; color: #43514c; font-size: 11px; }
.agent-avatar-label span { color: #98a29e; font-size: 10px; }
.agent-avatar-row { display: flex; align-items: center; gap: 9px; }
.agent-avatar-preview { width: 42px; height: 42px; background: var(--accent); font-size: 12px; }
.modal .avatar-upload-button { display: grid; place-items: center; margin: 0; padding: 9px 14px; color: #53615c; cursor: pointer; font-size: 12px; font-weight: 700; }
.avatar-upload-button input { display: none; }
.agent-avatar-row .ghost-button { padding: 9px 14px; }
.agent-cognition-view { margin: 4px 0 0; border: 1px solid #d9e5e0; border-radius: 11px; background: #f5f9f7; overflow: hidden; }
.agent-cognition-view summary { cursor: pointer; list-style: none; padding: 10px 12px; color: var(--accent); font-size: 11px; font-weight: 800; }
.agent-cognition-view summary::-webkit-details-marker { display: none; }
.agent-cognition-view summary::before { content: "▸"; display: inline-block; width: 14px; color: #7da193; }
.agent-cognition-view[open] summary::before { content: "▾"; }
.agent-cognition-view summary span { float: right; color: #8c9994; font-size: 9px; font-weight: 400; }
.agent-cognition-view textarea { width: calc(100% - 20px); margin: 0 10px 10px; border-color: #d2ded9; background: #fbfdfc; color: #53625c; font-size: 11px; line-height: 1.55; resize: vertical; }
.modal-actions { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-actions > span { flex: 1; }
.modal-actions button { white-space: nowrap; }
.delete-button, .provider-delete { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border: 1px solid #e4bcb7; border-radius: 8px; background: #fff7f6; color: var(--danger); cursor: pointer; font-size: 19px; line-height: 1; padding: 0; }
.delete-button:hover, .provider-delete:hover { background: #f5dfdc; border-color: #d99c94; }
.modal-intro { padding: 10px 12px; background: #f2f6f4; border-radius: 10px; color: #6a7772; font-size: 10px; line-height: 1.6; margin: -5px 0 16px; }
.sound-toggle { display: inline-flex !important; align-items: center; gap: 9px; width: 100%; margin-bottom: 12px !important; }
.sound-toggle input { display: inline-block; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.sound-preview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 6px; }
.sound-preview-grid .ghost-button { min-width: 0; padding: 8px 6px; }
.compact-modal { width: min(440px, calc(100vw - 28px)); }
.failure-modal .failure-body { display: grid; gap: 8px; }
.failure-message { max-height: 180px; overflow-y: auto; padding: 10px 12px; border-radius: 10px; background: #fff7f6; border: 1px solid #edd0cc; color: #8f4b43; font-size: 10px; line-height: 1.6; white-space: pre-wrap; }
.failure-modal .modal-actions { margin-top: 14px; }
.confirm-action-modal .modal-intro { white-space: pre-wrap; }
.discussion-rule-note { display: grid; gap: 3px; margin-top: 12px; padding: 10px 12px; border: 1px solid #d9e5e0; border-radius: 10px; background: #f5f9f7; }
.discussion-rule-note b { color: var(--accent); font-size: 10px; }
.discussion-rule-note span { color: #72817b; font-size: 9px; line-height: 1.55; }
.provider-list { max-height: min(520px, 62vh); overflow-y: auto; padding-right: 5px; }
.provider-row { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 9px; background: #fdfefd; overflow: hidden; }
/* 折叠标题是"点了就展开"的按钮、不是可编辑文本：禁选中并把插入符设为透明，
   否则点标题里的名称/模型 ID 会在文字后留下一个闪动的文本光标（子元素的 user-select 算出来是 text）。 */
.provider-summary { width: 100%; min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; align-items: center; gap: 12px; padding: 10px 14px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; -webkit-user-select: none; user-select: none; caret-color: transparent; }
.provider-summary:hover { background: #f6f9f7; }
.provider-summary-main { min-width: 0; }
.provider-summary-main b, .provider-summary-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-summary-main b { font-size: 11px; color: #33453e; }
.provider-summary-main small { margin-top: 4px; color: #84908b; font-size: 9px; }
.provider-summary-type { padding: 5px 8px; border-radius: 7px; background: #eef4f1; color: #62736c; font-size: 9px; white-space: nowrap; }
.provider-chevron { color: #71807a; font-size: 18px; line-height: 1; text-align: center; transition: transform .18s ease; }
.provider-row.expanded .provider-chevron { transform: rotate(180deg); }
.provider-body { display: none; padding: 13px 14px 14px; border-top: 1px solid var(--line); }
.provider-row.expanded .provider-body { display: block; }
.provider-row-head { display: grid; grid-template-columns: minmax(180px, 1fr) 180px auto; gap: 10px; align-items: end; margin-bottom: 11px; }
.provider-row-head label, .provider-fields label { min-width: 0; margin: 0; color: #66736e; font-size: 9px; }
.provider-row-head input, .provider-row-head select, .provider-fields input { min-width: 0; margin-top: 4px; }
.provider-row-head input { font-weight: 700; }
.provider-row-actions { height: 37px; display: flex; flex-direction: row; align-items: stretch; gap: 6px; }
.provider-row-actions .provider-delete { width: 37px; height: 37px; flex-basis: 37px; line-height: 0; padding-bottom: 2px; }
.provider-inline-note { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; margin: 0 0 11px; padding: 8px 10px; border: 1px solid #eadfc8; border-radius: 9px; background: #fffaf0; color: #806b49; font-size: 9px; line-height: 1.5; }
.provider-inline-note > b { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: #b5853f; color: white; font-size: 11px; line-height: 1; }
.provider-inline-note a { color: #765322; font-weight: 700; text-decoration: none; white-space: nowrap; }
.provider-test, .provider-duplicate { height: 37px; display: grid; place-items: center; border: 1px solid #cddbd5; border-radius: 8px; background: #f4f8f6; color: var(--accent); cursor: pointer; padding: 0 10px; font-size: 10px; font-weight: 700; line-height: 1; white-space: nowrap; }
.provider-duplicate { color: #5f6d68; background: white; }
.provider-test:disabled { cursor: wait; }
.provider-fields { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 10px; }
.provider-options { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .9fr) minmax(0, .8fr) minmax(0, 1.4fr); column-gap: 8px; row-gap: 9px; align-items: end; margin-top: 9px; }
.provider-options label { margin: 0; font-size: 9px; color: #66736e; }
.provider-options input, .provider-options select { height: 32px; margin-top: 4px; line-height: 30px; font-size: 10px; }
.provider-options-note { grid-column: 1 / -1; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; padding: 8px 10px; border: 1px solid #e0e9e5; border-radius: 9px; background: #f7faf8; color: #82908a; font-size: 9px; font-weight: 400; line-height: 1.5; }
.provider-options-note > b { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: #e7f0ec; color: #648176; font-size: 10px; font-family: Georgia, serif; line-height: 1; }
/* 「桌游不限信息」与携带消息数并排。必须显式覆盖两条给"标题+输入框"写的通用规则，否则：
   ① `.modal input { display:block; width:100%; height:37px }` 会把勾选框拉成一个占满整格的大蓝方块；
   ② `.modal label > span { float:right }` 又把说明文字甩到方块下面、还染成浅灰。
   此处把它做成与输入框同高的状态卡，和前三项按比例共同铺满整行；开关状态由右侧徽标同步表达。 */
.provider-options .provider-check { grid-column: 4; justify-self: stretch; display: flex; align-items: center; gap: 7px; width: 100%; min-width: 0; height: 32px; margin-top: 4px; padding: 0 9px; box-sizing: border-box; border: 1px solid #d8e4df; border-radius: 9px; background: #f7faf8; cursor: pointer; transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease; }
.provider-options .provider-check:hover { border-color: #b8cec5; background: #f1f7f4; }
.provider-options .provider-check:has(input:checked) { border-color: #bfd5cc; background: #f0f7f4; box-shadow: inset 0 0 0 1px rgba(79, 126, 108, .04); }
.provider-options .provider-check input[type="checkbox"] { flex: none; display: inline-block; width: 14px; height: 14px; min-width: 14px; margin: 0; padding: 0; line-height: normal; accent-color: var(--accent); }
.provider-options .provider-check input[type="checkbox"]:focus-visible { outline: 2px solid #9fc5b7; outline-offset: 2px; }
.provider-options .provider-check > span { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; float: none; color: #43514c; font-weight: 700; font-size: 9px; line-height: 1.3; white-space: nowrap; }
.provider-options .provider-check > span::after { content: "按上限"; flex: none; margin-left: auto; padding: 2px 6px; border-radius: 999px; background: #edf1ef; color: #85918c; font-size: 8px; font-weight: 600; line-height: 1.2; }
.provider-options .provider-check input:checked + span::after { content: "全量＋深思"; background: #dfeee7; color: #3f765f; }
.provider-test-status { display: none; margin: 8px 2px 0; font-size: 9px; line-height: 1.5; }
.provider-test-status.show { display: block; }
.provider-test-status.success { color: #2e7c61; }
.provider-test-status.error { color: var(--danger); }
.add-provider { width: 100%; border: 1px dashed #b7c8c1; color: var(--accent); background: #f6faf8; border-radius: 11px; padding: 10px; cursor: pointer; font-size: 11px; font-weight: 700; }
/* Popover 让提示进入浏览器“顶层”，盖在 showModal 对话框之上；inset+margin:auto 居中显示。 */
.toast { position: fixed; inset: 0; margin: auto; width: fit-content; height: fit-content; max-width: min(680px, calc(100vw - 40px)); background: #20342d; color: white; border: 0; border-radius: 10px; padding: 12px 18px; font-size: 12px; line-height: 1.5; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; transform: translateY(8px); box-shadow: 0 12px 44px rgba(0, 0, 0, .4); }
.toast.show { opacity: 1; transform: translateY(0); }

/* 开发者模式：发言核对队列 */
.dev-review-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; margin: 4px 0 6px; }
.dev-review-empty { color: #8c9994; font-size: 12px; padding: 18px 4px; text-align: center; }
.dev-review-item { border: 1px solid #e2e8e4; border-left: 3px solid #c9b79a; border-radius: 10px; padding: 10px 12px; background: #fbfcfb; }
.dev-review-item.is-bad { border-left-color: #a84b42; background: #fdf6f4; }
.dev-review-item.is-fp { border-left-color: #9aa6a0; opacity: .62; }
.dev-review-item.is-uncertain { border-left-color: #c9a94e; background: #fdfbf3; }
.dev-review-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dev-review-head b { color: #394742; font-size: 12px; }
.dev-review-head span { color: #98a29e; font-size: 10px; white-space: nowrap; }
.dev-flags { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
.dev-flag { padding: 2px 8px; border-radius: 999px; background: #f2e4d6; color: #8b5a34; font-size: 10px; font-weight: 700; }
.dev-flag-manual { background: #e3efe7; color: #3d7a52; } /* 手动＝绿，自动＝默认琥珀，一眼分清标记来源 */
.dev-review-text { color: #3a4844; font-size: 12px; line-height: 1.55; white-space: pre-wrap; max-height: 130px; overflow-y: auto; }
.dev-review-controls { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.dev-status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dev-status-row .dev-status-spacer { flex: 1 1 auto; }
.dev-review-controls .dev-status { padding: 5px 12px; font-size: 11px; }
.dev-review-item.is-bad .dev-status[data-dev-status="confirmed"], .dev-review-item.is-fp .dev-status[data-dev-status="false-positive"], .dev-review-item.is-uncertain .dev-status[data-dev-status="uncertain"] { outline: 2px solid currentColor; outline-offset: 1px; }
.dev-review-controls .dev-delete { padding: 5px 12px; font-size: 11px; border: 1px solid #e2c4bf; border-radius: 8px; background: white; color: #a84b42; cursor: pointer; }
.dev-review-controls .dev-delete:hover { background: #fdf2f0; }
.dev-review-controls .dev-handled { padding: 5px 12px; font-size: 11px; border: 1px solid #cddbd5; border-radius: 8px; background: white; color: #53615c; cursor: pointer; }
.dev-review-controls .dev-handled:hover { background: #f2f6f4; }
.dev-review-controls .dev-handled.is-on { border-color: #7fae8e; background: #eef6f0; color: #2f6b45; font-weight: 700; }
.dev-review-item.is-handled { opacity: .5; }
.dev-review-item.is-handled .dev-handled { opacity: 1; }
.dev-review-controls .dev-note { box-sizing: border-box; width: 100%; height: 30px; border: 1px solid #cddbd5; border-radius: 8px; padding: 6px 9px; font-size: 11px; line-height: 16px; color: #43514c; background: white; }
/* 已处理条目缩成一行的紧凑卡片：小巧、低调、右侧一个小徽章式「已处理」键 */
.dev-review-item.dev-collapsed { padding: 3px 6px 3px 10px; border-left-width: 2px; border-radius: 7px; }
.dev-collapsed-row { display: flex; align-items: center; gap: 6px; }
.dev-collapsed-desc { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: #7c8b85; }
.dev-collapsed-row .dev-handled { flex: 0 0 auto; padding: 2px 8px; font-size: 10px; line-height: 15px; border: 1px solid #cbdcd2; border-radius: 999px; background: #eef6f0; color: #3d7a52; cursor: pointer; white-space: nowrap; }
.dev-collapsed-row .dev-handled:hover { background: #e3f0e7; }
/* 案发快照（真相）折叠展示 */
.dev-snapshot { margin: 8px 0 2px; border: 1px dashed #d6ddd8; border-radius: 8px; background: #f7faf8; }
.dev-snapshot > summary { cursor: pointer; list-style: none; padding: 6px 10px; color: #6a7b74; font-size: 10px; font-weight: 700; }
.dev-snap-body { padding: 2px 10px 9px; display: flex; flex-direction: column; gap: 4px; color: #46534f; font-size: 11px; line-height: 1.5; }
.dev-snap-body b { color: #394742; }
.dev-snap-sub { margin-top: 2px; padding: 5px 8px; background: #eef3f0; border-radius: 6px; color: #55635d; font-size: 10.5px; white-space: pre-wrap; max-height: 120px; overflow-y: auto; }
/* 消息上的手动「标记」按钮（仅开发者模式 + 狼人杀公屏出现） */
.dev-mark-btn { margin-left: 6px; border: 1px solid #e0cdb6; background: #fbf4ea; color: #8b5a34; border-radius: 999px; padding: 0 8px; font-size: 10px; font-weight: 700; line-height: 18px; cursor: pointer; }
.dev-mark-btn:hover { background: #f4e6d3; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 220px minmax(500px, 1fr) 240px; padding: 8px; }
  .chat-header, .messages { padding-left: 20px; padding-right: 20px; }
  .private-memory-notice, .composer-wrap { margin-left: 20px; margin-right: 20px; }
  .composer-wrap { padding-left: 0; padding-right: 0; }
}

/* 角色卡「思考风格」模块。排在性格下方——它是"怎么想"，性格是"怎么说"，两者相邻便于一起调。
   下拉里直接显示具体风格名（不是"随机/自动"这种占位），选「自定义」才展开输入框。 */
.reasoning-style { margin: 12px 0 4px; padding: 12px 13px 11px; border: 1px solid #dfe8e4; border-radius: 12px; background: #f8fbfa; }
.reasoning-style-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.reasoning-style-head b { font-size: 12px; font-weight: 700; color: #2f3d38; }
.reasoning-style-head .soft-button { flex: none; padding: 5px 11px; font-size: 11px; }
.reasoning-style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.modal .reasoning-style-grid label { display: block; margin: 0; font-size: 11px; font-weight: 600; color: #66736e; }
.modal .reasoning-style-grid select { width: 100%; height: 34px; margin-top: 5px; font-size: 12px; }
.modal .reasoning-style-custom { display: block; width: 100%; height: 34px; margin-top: 9px; font-size: 12px; }
.modal .reasoning-style-custom.hidden { display: none; }
.reasoning-style-preview { margin: 9px 0 0; padding: 9px 10px; border-radius: 9px; background: #eef4f1; color: #46554f; font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.reasoning-style-preview:empty { display: none; }
