:root {
  --bg: #faf9f7; --side: #f3f1ed; --panel: #ffffff; --text: #1f1e1c; --muted: #6f6b66; --border: #e5e2dc;
  --accent: #c2410c; --accent-soft: #fbe9df; --accent-text: #ffffff; --ok: #15803d; --fail: #dc2626; --run: #2563eb;
  --wait: #a8a29e; --warn-bg: #fef3c7; --warn-text: #854d0e; --err-bg: #fee2e2; --err-text: #991b1b;
  --code-bg: #f1efeb; --user-bg: #efece6; --shadow: 0 1px 2px rgba(0,0,0,.05);
  --pro-bg: #f0fdf4; --pro-line: #86efac; --con-bg: #fef2f2; --con-line: #fca5a5; --neu-bg: #eff6ff; --neu-line: #93c5fd;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1e1c; --side: #181715; --panel: #262523; --text: #ecebe8; --muted: #a29e97; --border: #3a3834;
    --accent: #f08a5d; --accent-soft: #3a2a22; --accent-text: #1b1310; --ok: #4ade80; --fail: #f87171; --run: #60a5fa;
    --wait: #78716c; --warn-bg: #3b3210; --warn-text: #fde68a; --err-bg: #3b1515; --err-text: #fecaca;
    --code-bg: #2f2d2a; --user-bg: #33312d; --shadow: none;
    --pro-bg: #16251b; --pro-line: #2f6b43; --con-bg: #2a1a1a; --con-line: #7a3434; --neu-bg: #18212f; --neu-line: #34527a;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { display: flex; flex-direction: column; }
body { margin: 0; background: var(--bg); color: var(--text); overflow: hidden;
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

/* ---------- 三栏布局 ---------- */
.app { display: grid; grid-template-columns: 260px minmax(0, 1fr) var(--rw, 460px); flex: 1; min-height: 0; }
.app.no-right { grid-template-columns: 260px minmax(0, 1fr) 0; }
.app.no-right .right { display: none; }
.left { background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.mid { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.right { position: relative; background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
@media (max-width: 1280px) { .app { grid-template-columns: 230px minmax(0, 1fr) var(--rw, 400px); } .app.no-right { grid-template-columns: 230px minmax(0, 1fr) 0; } }
@media (max-width: 880px) {
  .app, .app.no-right { grid-template-columns: minmax(0, 1fr); }
  .left, .right { position: fixed; top: 0; bottom: 0; z-index: 30; width: min(86vw, 360px); transition: transform .2s; box-shadow: 0 0 24px rgba(0,0,0,.2); }
  .left { left: 0; transform: translateX(-105%); }
  .right { right: 0; transform: translateX(105%); }
  .app.no-right .right { display: flex; }
  body.show-left .left, body.show-right .right { transform: none; }
  body.show-left .scrim, body.show-right .scrim { display: block; }
}
.scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 25; }
.only-narrow { display: none !important; }
@media (max-width: 880px) { .only-narrow { display: inline-flex !important; } .only-wide { display: none !important; } }

/* ---------- 左栏 ---------- */
.left-top { padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 10px; }
.brand { font-weight: 700; font-size: 17px; padding: 0 6px; }
.new-btn { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel); cursor: pointer; font-weight: 600; }
.new-btn:hover { border-color: var(--accent); }
.hist-title { font-size: 12px; color: var(--muted); padding: 8px 18px 4px; }
.hist { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.hist-item { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.hist-item:hover { background: var(--code-bg); }
.hist-item.active { background: var(--accent-soft); }
.hist-item .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.left-foot { border-top: 1px solid var(--border); padding: 8px; }
.nav-btn { width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.nav-btn:hover, .nav-btn.active { background: var(--code-bg); }

/* ---------- 中栏 ---------- */
.mid-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); min-height: 52px; }
.mid-head .title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mid-body { flex: 1; overflow-y: auto; padding: 20px 16px 28px; }
.col { max-width: 780px; margin: 0 auto; }
.composer-wrap { padding: 0 16px 14px; }
.composer { max-width: 780px; margin: 0 auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 12px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.composer textarea { width: 100%; border: 0; background: transparent; resize: none; outline: none; padding: 4px 2px; min-height: 48px; max-height: 40vh; }
.composer-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.composer-bar .spacer { flex: 1; }
.hero { text-align: center; padding: max(8px, calc(8vh - 3.2em)) 0 18px; }   /* 比原来上移两行 */
.hero h1 { font-size: 26px; font-weight: 600; margin: 0 0 8px; font-family: Georgia, "Songti SC", "SimSun", serif; }

/* 对话流 */
.bubble-user { margin: 14px 0 14px auto; max-width: 85%; width: fit-content; background: var(--user-bg); padding: 10px 14px;
  border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-user .lbl { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.round-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 22px 0 10px; }
.round-sep::before, .round-sep::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.msg { display: flex; gap: 10px; margin: 12px 0; }
.msg-main { flex: 1; min-width: 0; }
.msg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msg-head .who { font-weight: 600; }
.msg-head .meta { color: var(--muted); font-size: 12px; }
.msg-body { overflow-wrap: anywhere; }
.msg-body.plain { white-space: pre-wrap; }
.msg-foot { color: var(--muted); font-size: 12px; }
.report-chip { display: flex; gap: 10px; align-items: center; margin: 16px 0; padding: 12px 14px; border: 1px solid var(--accent);
  background: var(--accent-soft); border-radius: 12px; cursor: pointer; }
.report-chip .t { font-weight: 600; flex: 1; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--wait); flex: none; display: inline-block; }
.dot.running { background: var(--run); animation: pulse 1s infinite; }
.dot.ok, .dot.done { background: var(--ok); } .dot.failed { background: var(--fail); }
.dot.partial, .dot.cancelled, .dot.interrupted, .dot.stopped { background: #d97706; }
/* 支持/反对/中立：发言卡片淡色底 */
.msg.stance-pro, .msg.stance-con, .msg.stance-neu { padding: 10px 12px; border-radius: 12px; border-left: 3px solid; }
.msg.stance-pro { background: var(--pro-bg); border-left-color: var(--pro-line); }
.msg.stance-con { background: var(--con-bg); border-left-color: var(--con-line); }
.msg.stance-neu { background: var(--neu-bg); border-left-color: var(--neu-line); }
/* 讨论进行中，参会者列表里每人此刻的状态 */
.seat .live-st { grid-column: 2 / -1; display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.seat .live-st.running { color: var(--run); font-weight: 600; }
.seat .live-st.failed { color: var(--fail); }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- 右栏 ---------- */
.tabs { display: flex; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--border); }
.tabs button { background: none; border: 0; padding: 8px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .back { order: -1; color: var(--accent); padding-left: 2px; }
.right-body { flex: 1; overflow-y: auto; padding: 14px; }
.sec { margin-bottom: 18px; }
.sec h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
/* 参会者：一人一行（勾选 · 名称 · 模型 · 角色 · 加减） */
.seats { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seat { display: grid; grid-template-columns: 18px 24px 104px minmax(0, 1fr) auto; gap: 6px; align-items: center;
  padding: 5px 8px; border-top: 1px solid var(--border); background: var(--panel); }
.seat.people { grid-template-columns: 24px 104px minmax(0, 1fr) 26px; }
.seat .pname { font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 模型自带图标（内置 SVG，简化版） */
.picon { width: 24px; height: 24px; flex: none; display: inline-block; border-radius: 6px; overflow: hidden; }
.picon svg { width: 100%; height: 100%; display: block; }
.picon.big { width: 30px; height: 30px; border-radius: 8px; }
/* 角色名：按角色上色、换字体，本身就是下拉菜单 */
.rolename { border: 1px solid transparent; background: transparent; font-size: 15px; padding: 2px 2px; border-radius: 6px;
  cursor: pointer; min-width: 0; max-width: 100%; appearance: auto; }
.rolename:hover:not(:disabled) { border-color: var(--border); background: var(--code-bg); }
.rolename:disabled { cursor: default; opacity: 1; }
.rolename option { color: var(--text); font-style: normal; font-weight: 400; font-family: inherit; }
.rolechip { font-size: 14px; }
.addrow { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.addrow select { flex: 1; min-width: 0; }
.seat.added { background: var(--accent-soft); }
.seat:first-child { border-top: 0; }
.seat.off .sel { opacity: .5; }
.seat .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .sel { padding: 4px 6px; font-size: 13px; }
.seat .acts { display: flex; gap: 2px; }
.seat .acts button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px 4px; border-radius: 6px; }
.seat .acts button:hover { background: var(--code-bg); color: var(--text); }
.seat .nokey { grid-column: 4 / 6; font-size: 13px; }

/* ---------- 通用控件 ---------- */
input[type=text], input[type=password], input[type=number], textarea.box, select {
  width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); min-width: 0; }
input:focus, textarea.box:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel); cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn.danger { color: var(--fail); }
.btn.small { padding: 3px 9px; font-size: 13px; }
.btn.icon { padding: 4px 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.hint { color: var(--muted); font-size: 13px; }
.badge { display: inline-block; font-size: 12px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: var(--ok); } .badge.fail { color: var(--fail); border-color: var(--fail); }
.badge.free { color: var(--accent); border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 4px 2px 8px; border-radius: 8px;
  background: var(--code-bg); border: 1px solid var(--border); max-width: 100%; }
.chip .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; }
.composer.drop { outline: 2px dashed var(--accent); }
.warn { background: var(--warn-bg); color: var(--warn-text); padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.err { background: var(--err-bg); color: var(--err-text); padding: 7px 10px; border-radius: 8px; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.num { width: 64px !important; text-align: center; }
label.lbl { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.md h1, .md h2, .md h3, .md h4 { margin: 14px 0 6px; line-height: 1.35; }
.md h1 { font-size: 18px; } .md h2 { font-size: 16px; } .md h3, .md h4 { font-size: 15px; }
.md p { margin: 6px 0; } .md ul, .md ol { margin: 6px 0; padding-left: 22px; }
.md code { background: var(--code-bg); padding: 1px 4px; border-radius: 4px; font-size: 90%; }
.md pre { background: var(--code-bg); padding: 10px; border-radius: 6px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--border); color: var(--muted); }
.md table { border-collapse: collapse; margin: 8px 0; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; }
.md hr { border: 0; border-top: 1px solid var(--border); }
.srow { padding: 14px 0; border-top: 1px solid var(--border); }
.srow:first-child { border-top: 0; }
.empty { color: var(--muted); text-align: center; padding: 24px 8px; font-size: 14px; }
.toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 8px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: 90vw; }
.toast.show { opacity: .95; }
.login { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 60; padding: 16px; }
.login form { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 22px; display: grid; gap: 10px; }
.login h2 { margin: 0 0 4px; }
.login input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); }
.me-row { display: flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.me-row .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col > .warn { margin: 0 0 12px; }


/* ---------- 清单改进 ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.nav-btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cost { margin-top: 6px; display: grid; gap: 4px; }
.cost:empty { display: none; }
.cost .warn { padding: 5px 10px; }
#start-reason a { margin-left: 2px; }
.head-acts { display: inline-flex; gap: 6px; margin-left: 10px; vertical-align: middle; }
.tstat { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--muted); }
.tstat.ok { color: var(--ok); } .tstat.fail { color: var(--fail); } .tstat.run { color: var(--run); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: 13px; text-decoration: underline; }
.linkbtn.danger { color: var(--fail); }
.spin { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.srow .row .picon { flex: none; }
.help { background: var(--code-bg); border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 13px; display: grid; gap: 6px; }
.help .tstat { margin-top: 0; }
.cmdrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmdrow .os { width: 64px; color: var(--muted); }
.cmdrow code { background: var(--panel); padding: 2px 6px; border-radius: 4px; font-size: 12px; word-break: break-all; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.grid2 input, .grid2 select { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
@media (max-width: 600px) { .grid2 { grid-template-columns: 1fr; } }
.custom-edit { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.sample-report { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 4px 16px 12px; }
.sample-bar { display: flex; align-items: center; gap: 8px; }
.sample-bar .grow { flex: 1; }
.seat .acts button:disabled { opacity: .35; cursor: default; }
.cloud { display: inline-flex; width: 16px; height: 16px; flex: none; }
.cloud svg { width: 16px; height: 16px; }
.cloud { position: relative; }
.cloud.anon svg, .cloud.private svg { fill: var(--wait); opacity: .6; }
.cloud.private svg { opacity: .8; }
.cloud.synced svg { fill: var(--run); }
.cloud.remote svg { fill: #ea7a1c; }
.cloud.pending::after { content: ""; position: absolute; right: -2px; top: -1px; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 1.5px var(--panel); }
.head-acts .storage { width: auto; padding: 3px 6px; font-size: 12px; }
.login .oauth { display: grid; gap: 8px; }
.login .oauth .btn { width: 100%; justify-content: center; }
.spk { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; vertical-align: -3px; margin: 0 1px; }
.spk .picon { width: 16px; height: 16px; border-radius: 4px; }
.spk .rolechip { font-size: inherit; }

/* ---------- 顶部菜单 ---------- */
.topbar { display: flex; align-items: center; gap: 16px; height: 44px; flex: none; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--border); }
.tb-brand { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; white-space: nowrap; font-family: Georgia, "Songti SC", "SimSun", serif; }
.tb-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tb-nav::-webkit-scrollbar { display: none; }
.tb-item { background: none; border: 0; padding: 6px 10px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 14px; white-space: nowrap; text-decoration: none; }
.tb-item:hover { background: var(--code-bg); color: var(--text); }
.tb-item.active { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 600px) { .topbar { gap: 8px; padding: 0 8px; } .tb-item { padding: 6px 7px; font-size: 13px; } }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal-card { width: min(560px, 100%); max-height: 86vh; overflow-y: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.modal-card h2 { margin: 0; font-size: 18px; }
.modal-card h3 { margin: 16px 0 6px; font-size: 15px; }
.modal-card p { margin: 8px 0; }
.about { display: grid; grid-template-columns: 52px 1fr; gap: 6px 10px; margin: 12px 0; }
.about dt { color: var(--muted); }
.about dd { margin: 0; word-break: break-all; }
.help-steps { padding-left: 20px; margin: 10px 0; }
.help-steps li { margin: 4px 0; }

/* 云朵按钮与菜单 */
.cloudbtn { display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: auto; padding: 3px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; }
.cloudbtn:hover, .cloudbtn:focus-visible { border-color: var(--border); background: var(--panel); }
.cloudbtn.labelled { margin-left: 0; padding: 4px 8px; border-color: var(--border); background: var(--panel); }
.cloudbtn .caret { font-size: 10px; opacity: .7; }
.cloudmenu { position: fixed; z-index: 70; width: 264px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.16); padding: 6px; font-size: 13px; }
.cloudmenu .cm-head { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.cloudmenu .cm-tx { display: grid; gap: 2px; text-align: left; min-width: 0; }
.cloudmenu .cm-tx small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.cloudmenu .cm-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); cursor: pointer; font: inherit; }
.cloudmenu .cm-item:hover, .cloudmenu .cm-item:focus-visible { background: var(--bg); }
.cloudmenu .cm-item b { font-weight: 500; }
.cloudmenu .cm-item.danger b { color: var(--fail); }
.cloudmenu .cm-ic { display: inline-flex; width: 16px; justify-content: center; flex: none; margin-top: 1px; color: var(--muted); }
.cloudmenu .cm-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.cloudmenu .cm-note { padding: 6px 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.login .oauth-sep { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.login .oauth-sep::before, .login .oauth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login .oauth.small { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.login .oauth.small .btn { font-size: 12px; opacity: .55; cursor: not-allowed; }

/* 导入未登录时的历史 */
.imp-list { max-height: 40vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; margin: 6px 0 10px; }
.imp-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; font-size: 14px; }
.imp-list .imp-row + .imp-row { border-top: 1px solid var(--border); }
.imp-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-all { padding-left: 11px; font-weight: 500; }

/* 左下角的显示名（点击修改） */
.me-row .me-name { background: none; border: 0; padding: 2px 4px; margin: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; border-radius: 6px; min-width: 0; }
.me-row .me-name:hover { background: var(--panel); }
/* 点登录链接打开的新标签页：提示可以关掉 */
.handoff { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.handoff-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px 24px; text-align: center; }
.handoff-card h2 { margin: 0 0 8px; }
.imp-h { margin: 14px 0 4px; font-weight: 600; font-size: 14px; }

/* 首页简明说明 */
.welcome { max-width: 560px; margin: 26px auto 0; text-align: left; }
.welcome ol { margin: 0; padding: 0; list-style: none; counter-reset: w; display: grid; gap: 10px; }
.welcome li { counter-increment: w; display: grid; grid-template-columns: 26px auto 1fr; gap: 4px 8px; align-items: baseline; font-size: 14px; line-height: 1.6; }
.welcome li::before { content: counter(w); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.welcome li strong { white-space: nowrap; }
.welcome li span { color: var(--muted); }
.welcome-foot { margin-top: 16px; text-align: center; }
.disclaimer { padding-left: 20px; margin: 6px 0; }
.disclaimer li { margin: 6px 0; line-height: 1.6; }
@media (max-width: 600px) { .welcome li { grid-template-columns: 26px 1fr; } .welcome li span { grid-column: 2; } }

/* 首页标题上方的模型图标 */
.model-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 auto 18px; }
.model-chip { border: 1px solid var(--border); background: var(--panel); border-radius: 10px; padding: 6px; cursor: pointer; display: inline-grid; place-items: center; transition: transform .12s, box-shadow .12s; }
.model-chip:hover, .model-chip:focus-visible { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.model-chip .picon { width: 26px; height: 26px; }
.model-links a { margin: 0 2px; }
/* 反馈、联系我们、留言板 */
.modal-card.wide { width: min(820px, 100%); }
.fb-field { display: grid; gap: 4px; margin: 10px 0; }
.fb-field > span:first-child { font-weight: 600; font-size: 13px; }
.fb-field input[type=text], .fb-field textarea { width: 100%; box-sizing: border-box; }
.counter { justify-self: end; font-size: 12px; }
.counter.over { color: var(--fail); }
.fb-msg { flex: 1; font-size: 13px; }
.fb-msg.err { color: var(--fail); }
.fb-msg.ok { color: var(--ok); font-weight: 600; }
.fb-msg .btn { margin: 0 6px; }
.modal-card.xwide { width: min(1080px, 100%); }
.fb-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; margin-top: 6px; }
.fb-left { display: flex; flex-direction: column; min-width: 0; }
.fb-contact { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 4px; }
.fb-mails { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.board { border-left: 1px solid var(--border); padding-left: 22px; min-width: 0; display: flex; flex-direction: column; }
.board .board-list { flex: 1; max-height: 62vh; }
.board-compose { display: grid; gap: 2px; margin-top: 6px; }
.board-compose input { flex: 1; min-width: 0; }
.board-list { display: grid; gap: 8px; align-content: start; max-height: 46vh; overflow-y: auto; margin-top: 8px; }
.board-item { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.board-item.hidden-post { opacity: .6; border-style: dashed; }
.board-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; flex-wrap: wrap; }
.board-meta .tag { background: var(--warn-bg); color: var(--warn-text); border-radius: 6px; padding: 0 6px; }
.board-body { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.board-rules { font-size: 12px; margin: -4px 0 0; }
@media (max-width: 760px) { .fb-grid { grid-template-columns: 1fr; } .board .board-list { max-height: 50vh; } .board { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 8px; } }
.custom-add { margin: 4px 0 12px; gap: 10px; }
.custom-add .btn { color: var(--text); font-weight: 700; font-size: 16px; padding: 8px 16px; border: 2px solid var(--text); }
.custom-add span { color: var(--text); font-weight: 700; font-size: 16px; }
.seat-custom { margin: 10px 0 2px; flex-wrap: wrap; }
.seat-custom span { font-size: 14px; }

/* 场景卡片（新议题页） */
.scene-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 640px; margin: 18px auto 0; }
.scene-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); cursor: pointer; font: inherit; text-align: center; }
.scene-card:hover { border-color: var(--accent); }
.scene-card.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.scene-card .ic { font-size: 22px; line-height: 1; }
.scene-card strong { font-size: 14px; }
.scene-card .d { font-size: 12px; color: var(--muted); line-height: 1.4; }
.scene-hint { font-size: 13px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.scene-tag { color: var(--accent); font-weight: 600; white-space: nowrap; }
@media (max-width: 600px) { .scene-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.scene-ask { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; margin: 6px 0; }
.scene-ask label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.scene-ask input { font-size: 13px; padding: 5px 8px; }
.linklist { margin: 6px 0; padding-left: 18px; font-size: 13px; word-break: break-all; color: var(--muted); }
@media (max-width: 600px) { .scene-ask { grid-template-columns: 1fr; } }
.composer.paused { border-color: var(--accent); }
.pause-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pause-qs { background: var(--accent-soft); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; font-size: 14px; }
.pause-qs .lbl { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pause-q { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 2px 0; }
.stance-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--side); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.stance-tag.changed { color: var(--accent); border-color: var(--accent); }
.settled { font-size: 13px; background: var(--accent-soft); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.vote-tip { margin: -2px 0 6px; font-size: 12px; }
.vote-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0 8px; }
.vote-btn { font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); cursor: pointer; }
.vote-btn.on.agree { color: var(--ok); border-color: var(--ok); }
.vote-btn.on.disagree { color: var(--fail); border-color: var(--fail); }
.vote-btn.on.maybe { color: var(--accent); border-color: var(--accent); }
.vote-note { flex: 1 1 160px; min-width: 120px; font-size: 12px !important; padding: 3px 8px !important; }
.scene-ask-wrap { margin: 4px 0 2px; }
.scene-ask-wrap summary { font-size: 13px; color: var(--accent); cursor: pointer; }

/* 新议题页：输入框在“看示例报告”下面两行处，随页面滚动；底部的输入区这时是空的 */
.new-composer { margin-top: 3.2em; text-align: left; }
.new-composer:empty { display: none; }
.composer-wrap:empty { padding: 0; }

/* 手机：输入框至少 16px，iOS 才不会在点进去时自动放大页面 */
@media (max-width: 600px) {
  input, textarea, select, .scene-ask input, .vote-note { font-size: 16px !important; }
}
/* 键盘弹出时，页面高度 = 键盘上方的可见高度（app.js 的 keyboardUpdate 设置 --vvh） */
html:has(body.kb-open), body.kb-open { height: var(--vvh, 100%); }
/* 新议题页打字时（手机）：只留输入框 */
body.typing .topbar, body.typing .mid-head { display: none; }
body.typing .hero { padding-top: 8px; }
body.typing .hero > :not(.new-composer) { display: none; }
body.typing .new-composer { margin-top: 0; }
body.typing .mid-body { padding-top: 8px; padding-bottom: 8px; }
/* 手机打字状态顶上的“返回主页 + 模式名”，平时不显示 */
.typing-bar { display: none; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
body.typing .typing-bar { display: flex; }
body.typing .composer .scene-hint .scene-tag { display: none; }

/* 宽屏：右栏左边缘可拖动调宽 */
.right-grip { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 5; }
.right-grip:hover, body.resizing .right-grip { background: var(--accent-soft); }
body.resizing { cursor: col-resize; user-select: none; }
@media (max-width: 880px) { .right-grip { display: none; } }
/* 手机：右栏（综合报告、参会者）铺满整屏，左上角“← 返回” */
@media (max-width: 600px) {
  .right { width: 100vw; box-shadow: none; }
  .model-row { flex-wrap: nowrap; gap: 6px; padding: 0 12px; }
  .model-chip { padding: 4px; border-radius: 8px; }
  .model-chip .picon { width: 20px; height: 20px; }
  .hero h1 { font-size: 20px; }
}
/* 键盘弹出时，弹窗（反馈、留言板、登录等）只占键盘上方的可见区域，输入框滚到中间不被挡住 */
body.kb-open .modal { bottom: auto; height: var(--vvh, 100%); place-items: start center; padding: 8px; }
body.kb-open .modal-card { max-height: calc(var(--vvh, 100vh) - 16px); padding: 12px 14px; }
body.kb-open .board-list, body.kb-open .board .board-list { max-height: 30vh; }
.inst-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
