@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Noto+Serif+SC:wght@400;500;600&family=Inter:wght@400;500;600&family=Fira+Code:wght@400;500&display=swap');

:root {
  color-scheme: light;
  --bg: #f7f3eb;
  --paper: rgba(255,253,248,.72);
  --paper-strong: rgba(255,253,248,.92);
  --paper-soft: rgba(255,255,255,.48);
  --ink: #29241f;
  --ink-2: #6f665d;
  --muted: #968b80;
  --line: rgba(54, 46, 38, .14);
  --line-soft: rgba(54, 46, 38, .08);
  --codex: #6f8fa7;
  --codex-dim: rgba(111,143,167,.13);
  --claude: #b97a63;
  --claude-dim: rgba(185,122,99,.14);
  --user: #776b61;
  --user-dim: rgba(92,80,68,.10);
  --guest: #5f7f6b;
  --guest-dim: rgba(95,127,107,.12);
  --summary: #9b8570;
  --summary-dim: rgba(155,133,112,.12);
  --danger: #b85e5e;
  --danger-dim: rgba(184,94,94,.10);
  --radius: 22px;
  --shadow: 0 22px 70px rgba(67, 52, 35, .10);
  --shadow-soft: 0 10px 36px rgba(67, 52, 35, .07);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: Inter, "Noto Serif SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.88), transparent 28%),
    radial-gradient(circle at 87% 18%, rgba(184,205,217,.22), transparent 32%),
    radial-gradient(circle at 78% 92%, rgba(191,141,118,.12), transparent 30%),
    linear-gradient(135deg,#fbf8f1,#efe7da 56%,#f8f5ef);
  -webkit-font-smoothing: antialiased;
}

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .62;
  background-image:
    linear-gradient(rgba(70,60,50,.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70,60,50,.022) 1px, transparent 1px);
  background-size: 42px 42px;
}

button, input, textarea { font: inherit; }
button, .button {
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink-2);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, background .12s ease, color .12s ease, border-color .12s ease;
}
button:hover, .button:hover { background: rgba(255,255,255,.72); color: var(--ink); transform: translateY(-1px); }
button:disabled { opacity: .5; cursor: default; transform: none; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0 12px; font-size: 12px; white-space: nowrap; }
.btn-claude { color: var(--claude); background: var(--claude-dim); border-color: rgba(185,122,99,.22); }
.btn-codex { color: var(--codex); background: var(--codex-dim); border-color: rgba(111,143,167,.22); }
.btn-danger { color: var(--danger); background: var(--danger-dim); border-color: rgba(184,94,94,.25); }
[hidden] { display: none !important; }

/* ---------- 登录 ---------- */
.login-screen { position: relative; z-index: 1; height: 100vh; height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); padding: 34px 32px 28px; border: 1px solid var(--line); border-radius: 32px;
  background: rgba(255,253,248,.72); backdrop-filter: blur(24px); box-shadow: var(--shadow); text-align: center;
}
.login-kicker { margin: 0 0 6px; font-size: 10px; letter-spacing: .22em; color: var(--muted); }
.login-card h1 { margin: 0; font-family: "Playfair Display", "Noto Serif SC", serif; font-size: 30px; }
.login-hint { margin: 18px 0 12px; color: var(--ink-2); }
.login-choices { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.login-choices button { min-height: 44px; padding: 0 20px; font-size: 15px; }
.login-choices button strong { font-weight: 500; }
.login-choices button small { display: block; font-size: 10px; color: var(--muted); letter-spacing: .08em; }
.login-error { min-height: 1.2em; margin: 14px 0 0; color: var(--danger); font-size: 13px; }
.login-fields { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; text-align: left; }
.login-fields input { width: 100%; min-height: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.7); color: var(--ink); outline: 0; }
.login-fields input:focus { border-color: var(--claude); }
.login-setup { display: flex; flex-direction: column; gap: 8px; }
.login-note { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.login-actions { display: flex; justify-content: space-between; gap: 8px; }
.login-actions .button { min-height: 40px; padding: 0 18px; font-size: 14px; }
.login-choices button.selected { background: var(--claude-dim); border-color: rgba(185,122,99,.35); color: var(--ink); }

/* ---------- 骨架 ---------- */
.app-shell {
  position: relative; z-index: 1; height: 100vh; height: 100dvh; min-height: 0; padding: 22px;
  display: grid; grid-template-columns: 74px 245px minmax(0, 1fr); gap: 16px; overflow: hidden;
}
.rail {
  height: calc(100dvh - 44px); min-height: 0; border: 1px solid var(--line); border-radius: 28px;
  background: rgba(255,253,248,.50); backdrop-filter: blur(24px); box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; align-items: center; padding: 14px 10px; gap: 10px;
}
.rail-logo { width: 44px; height: 44px; color: rgba(41,36,31,.72); display: grid; place-items: center; margin-bottom: 8px; }
.rail-logo svg { width: 44px; height: 44px; }
.rail-rooms { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.rail-btn {
  width: 48px; min-height: 48px; border-radius: 18px; border-color: transparent; background: transparent;
  display: grid; place-items: center; gap: 1px; color: var(--muted); padding: 4px 0; position: relative;
}
.rail-btn span { font-size: 18px; line-height: 1; }
.rail-btn small { font-size: 9px; line-height: 1; white-space: nowrap; }
.rail-btn.active { background: rgba(255,255,255,.72); border-color: var(--line); color: var(--ink); box-shadow: 0 8px 20px rgba(67,52,35,.06); }
.rail-btn.disabled { opacity: .38; }
.rail-btn .rail-badge { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--claude); }
.rail-btn .rail-badge.busy { background: var(--codex); animation: pulse-dot 1.4s ease-in-out infinite; }
.rail-spacer { flex: 1; }
.rail-me span { font-family: "Playfair Display", serif; font-size: 16px; }

.side-panel {
  height: calc(100dvh - 44px); min-height: 0; border: 1px solid var(--line); border-radius: 28px;
  background: rgba(255,253,248,.58); backdrop-filter: blur(24px); box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; overflow: hidden;
}
.side-head { padding: 22px 20px 16px; border-bottom: 1px solid var(--line-soft); }
.side-head h1 { margin: 0; font-family: "Noto Serif SC", "Playfair Display", serif; font-size: 22px; line-height: 1.2; letter-spacing: .04em; }
.side-head p { margin: 8px 0 0; color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.side-section { padding: 8px 10px 4px; }
.side-foot { margin-top: auto; padding-bottom: 14px; }
.section-label { padding: 12px 10px 8px; color: var(--muted); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
.side-note { margin: 0 10px; font-size: 11px; color: var(--muted); word-break: break-all; line-height: 1.4; }
.side-room-list { display: flex; flex-direction: column; gap: 2px; }
.room-item {
  width: 100%; min-height: 58px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  text-align: left; border: 0; border-radius: 18px; background: transparent; padding: 9px 10px;
}
.room-item.active, .room-item:hover { background: rgba(255,255,255,.62); transform: none; }
.room-item.disabled { opacity: .45; }
.room-icon { color: var(--muted); font-size: 16px; text-align: center; }
.room-item.active .room-icon { color: var(--claude); }
.room-item strong { display: block; color: var(--ink); font-size: 14px; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.room-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.room-item i.busy { background: var(--codex); animation: pulse-dot 1.4s ease-in-out infinite; }
.room-item i.unread { background: var(--claude); }

.main-card {
  min-width: 0; height: calc(100dvh - 44px); min-height: 0; border: 1px solid var(--line); border-radius: 32px;
  background: rgba(255,253,248,.54); backdrop-filter: blur(24px); box-shadow: var(--shadow);
  display: grid; grid-template-rows: 56px auto minmax(0, 1fr); position: relative; overflow: hidden;
}
/* 隐藏的元素不占格子，固定行号，免得后面的块错位 */
.main-card > .room-bar { grid-row: 1; }
.main-card > .error { grid-row: 2; }
.main-card > .room-body { grid-row: 3; }
.main-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 83% 10%, rgba(135,159,181,.13), transparent 26%), linear-gradient(180deg, rgba(255,255,255,.24), transparent 42%);
}
.room-bar { position: relative; z-index: 1; height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 20px; }
.room-bar h2 { margin: 0; font-family: "Noto Serif SC", serif; font-size: 18px; font-weight: 500; color: var(--ink-2); }
.room-bar-title p { margin: 0; font-size: 11px; color: var(--muted); }
.room-actions { display: flex; align-items: center; gap: 7px; }
.busy-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--codex); animation: pulse-dot 1.4s ease-in-out infinite; }
.error { position: relative; z-index: 2; margin: 0 20px 8px; padding: 8px 14px; border-radius: 14px; background: var(--danger-dim); color: var(--danger); font-size: 13px; }

.room-body { position: relative; z-index: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); }
.room-body > * { min-height: 0; max-height: 100%; }
.chat-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.chat-column > * { flex: 0 0 auto; }
.chat-column > .message-viewport { flex: 1 1 0; min-height: 120px; }
.chat-column > .office-board { flex-shrink: 1; min-height: 0; }

/* ---------- 在场 ---------- */
.presence-list { display: flex; flex-direction: column; gap: 2px; }
.presence-item { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 10px; border-radius: 12px; font-size: 13px; }
.presence-item i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); justify-self: center; }
.presence-item.online i { background: #6a9c5a; box-shadow: 0 0 0 3px rgba(106,156,90,.15); }
.presence-item strong { font-weight: 500; color: var(--ink); }
.presence-item small { display: block; color: var(--muted); font-size: 11px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.presence-item.offline strong { color: var(--muted); }
.room-presence { margin-left: 8px; color: var(--guest); }
.room-presence:empty { display: none; }

/* ---------- 投屏 ---------- */
.spotlight { margin: 0 20px 8px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 18px; border: 1px solid rgba(185,122,99,.35); background: var(--claude-dim); }
.spotlight img { height: 120px; max-width: 220px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,.6); cursor: zoom-in; }
.spotlight .spot-file { display: grid; place-items: center; height: 60px; padding: 0 14px; border-radius: 10px; background: rgba(255,255,255,.6); font-size: 13px; color: var(--ink); text-decoration: none; }
.spotlight .spot-meta { min-width: 0; font-size: 12px; color: var(--muted); }
.spotlight .spot-meta strong { display: block; color: var(--ink); font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spotlight .spot-meta small { color: var(--claude); font-size: 11px; letter-spacing: .06em; }
.att-wrap { position: relative; display: inline-block; max-width: 100%; }
.spot-btn { position: absolute; right: 8px; top: 8px; padding: 2px 9px; min-height: 22px; font-size: 11px; background: rgba(255,253,248,.92); opacity: 0; transition: opacity .15s; }
.att-wrap:hover .spot-btn { opacity: 1; }
@media (hover: none) { .spot-btn { opacity: .85; } }
.text .att-wrap img { max-width: 100%; max-height: 420px; border-radius: 14px; display: block; margin: 6px 0; cursor: zoom-in; border: 1px solid var(--line-soft); }
.presence-item small .viewing { color: var(--claude); }

/* ---------- 会议模式 ---------- */
.btn-mic { color: var(--guest); background: var(--guest-dim); border-color: rgba(95,127,107,.3); }
.btn-mic.live { color: #fff; background: var(--danger); border-color: var(--danger); animation: pulse-dot 1.6s ease-in-out infinite; }
.btn-meeting-on { color: var(--danger); border-color: rgba(184,94,94,.35); background: var(--danger-dim); }
.live-captions { margin: 0 clamp(16px, 3vw, 42px) 8px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.live-caption { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 4px 12px; border-radius: 14px; background: rgba(255,255,255,.45); border: 1px dashed var(--line-soft); }
.live-caption b { font-weight: 500; color: var(--guest); font-size: 12px; }
.live-caption b.me { color: var(--user); }
.live-caption span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.live-caption span.has-text { color: var(--ink); white-space: normal; }
.message .voice-tag { margin-left: 6px; font-size: 10px; color: var(--guest); letter-spacing: .04em; }

/* ---------- 看板 ---------- */
.office-board { margin: 0 20px 4px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding-bottom: 8px; align-items: stretch; border-bottom: 1px solid var(--line-soft); }
@media (max-width: 1200px) { .office-board { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); max-height: 34vh; overflow: auto; } }
.board-card { border: 1px solid var(--line-soft); border-radius: 18px; background: rgba(255,255,255,.5); padding: 12px 14px; font-size: 12.5px; min-width: 0; height: 200px; overflow: auto; scrollbar-width: thin; }
.board-card h4 { margin: 0 0 6px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.board-card ul { margin: 0; padding-left: 16px; }
.board-card li { margin: 2px 0; }
.board-card .md { font-size: 12.5px; }
.board-card .md p { margin: 0 0 4px; }
.board-card .md h1, .board-card .md h2, .board-card .md h3 { font-size: 13px; margin: 6px 0 2px; }
.board-room { display: flex; justify-content: space-between; gap: 8px; }
.board-room small { color: var(--muted); }
.board-file { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: baseline; cursor: pointer; padding: 2px 0; }
.board-file:hover { color: var(--claude); }
.board-file .file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-file .file-dir { display: block; font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-file small { color: var(--muted); white-space: nowrap; font-size: 10px; }

/* ---------- 状态条 ---------- */
.runtime-status { margin: 0 20px 6px; padding: 6px 14px; border-radius: 14px; background: rgba(255,255,255,.42); border: 1px solid var(--line-soft); color: var(--ink-2); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.runtime-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--codex); animation: pulse-dot 1.4s ease-in-out infinite; flex: 0 0 auto; }
@keyframes pulse-dot { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ---------- 消息 ---------- */
.message-viewport { position: relative; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); }
.messages { min-height: 0; overflow: auto; padding: 18px clamp(20px, 4vw, 64px) 20px; display: flex; flex-direction: column; gap: 14px; }
.load-earlier { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 4px 12px; font-size: 11px; background: var(--paper-strong); }
.empty-chat-hint { align-self: center; margin: auto; display: grid; gap: 6px; text-align: center; color: var(--muted); font-size: 13px; }
.empty-chat-hint strong { color: var(--ink-2); font-family: "Noto Serif SC", serif; font-size: 17px; }
.message { display: flex; align-items: flex-start; gap: 11px; max-width: min(760px, 88%); animation: msg-in 240ms cubic-bezier(.2,.6,.3,1); }
.message.mine { flex-direction: row-reverse; align-self: flex-end; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-family: "Fira Code", monospace; font-size: 11px; font-weight: 500; border: 1px solid currentColor; background: rgba(255,255,255,.42); }
.message.human .avatar { color: var(--user); }
.message.human.guest .avatar { color: var(--guest); }
.message.claude .avatar { color: var(--claude); }
.message.codex .avatar { color: var(--codex); }
.message.system .avatar { color: var(--summary); }
.bubble { min-width: 0; border: 1px solid var(--line-soft); border-radius: 22px; padding: 11px 15px 12px; background: rgba(255,255,255,.52); box-shadow: 0 8px 22px rgba(67,52,35,.045); }
.message.claude .bubble { background: var(--claude-dim); }
.message.codex .bubble { background: var(--codex-dim); }
.message.human .bubble { background: var(--user-dim); }
.message.human.guest .bubble { background: var(--guest-dim); }
.message.system .bubble { background: var(--summary-dim); font-size: 13px; }
.message.error .bubble { border-color: rgba(184,94,94,.4); }
.meta { display: flex; align-items: baseline; justify-content: space-between; gap: 22px; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.message.mine .meta { flex-direction: row-reverse; }
.name { font-weight: 600; letter-spacing: .04em; }
.message.claude .name { color: var(--claude); }
.message.codex .name { color: var(--codex); }
.message.human .name { color: var(--user); }
.message.human.guest .name { color: var(--guest); }
.message.system .name { color: var(--summary); }
.meta time { font-family: "Fira Code", monospace; font-size: 10px; }
.text { font-size: 14.5px; line-height: 1.7; overflow-wrap: anywhere; }
.text > :first-child { margin-top: 0; }
.text > :last-child { margin-bottom: 0; }
.text p { margin: 0 0 .6em; }
.text pre { margin: .5em 0; padding: 10px 12px; border-radius: 12px; background: rgba(41,36,31,.06); font-family: "Fira Code", monospace; font-size: 12.5px; overflow: auto; }
.text code { font-family: "Fira Code", monospace; font-size: .92em; background: rgba(41,36,31,.06); padding: 1px 5px; border-radius: 6px; }
.text pre code { background: none; padding: 0; }
.text img { max-width: 100%; max-height: 420px; border-radius: 14px; display: block; margin: 6px 0; cursor: zoom-in; border: 1px solid var(--line-soft); }
.text blockquote { margin: .4em 0; padding: 2px 12px; border-left: 2px solid var(--line); color: var(--ink-2); font-size: 13px; }
.text table { border-collapse: collapse; font-size: 13px; }
.text th, .text td { border: 1px solid var(--line-soft); padding: 4px 8px; }
.text h1, .text h2, .text h3 { font-size: 15px; margin: .8em 0 .3em; }
.text ul, .text ol { padding-left: 1.3em; margin: .3em 0; }
.pending-text::after { content: "▍"; color: var(--claude); animation: pulse-dot 1s ease-in-out infinite; }
.tool-trail { margin-top: 6px; font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tool-trail span::before { content: "· "; }
.usage-line { margin-top: 4px; font-size: 10px; color: var(--muted); font-family: "Fira Code", monospace; }

/* ---------- 审批 ---------- */
.approval-panel { margin: 0 20px 8px; display: flex; flex-direction: column; gap: 8px; }
.approval-card { border: 1px solid rgba(185,122,99,.35); background: var(--claude-dim); border-radius: 18px; padding: 10px 14px; font-size: 13px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.approval-card strong { color: var(--claude); font-size: 12px; letter-spacing: .06em; }
.approval-card pre { margin: 4px 0 0; white-space: pre-wrap; font-family: "Fira Code", monospace; font-size: 11.5px; max-height: 120px; overflow: auto; }
.approval-actions { display: flex; gap: 6px; }
.approval-wait { color: var(--muted); font-size: 12px; }

/* ---------- 输入 ---------- */
.interject { position: relative; z-index: 2; margin: 0 clamp(16px, 3vw, 42px) 18px; border: 1px solid var(--line); border-radius: 28px; background: rgba(255,253,248,.84); box-shadow: 0 20px 54px rgba(67,52,35,.12); padding: 10px; }
.interject-input-row { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: end; }
.attach-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); }
.attachment-tray { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 6px 8px; }
.attachment-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 4px 8px 4px 4px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255,255,255,.6); font-size: 12px; }
.attachment-chip img { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; }
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { width: 18px; height: 18px; padding: 0; font-size: 11px; line-height: 1; border-radius: 50%; }
.interject.dragover { border-color: var(--claude); box-shadow: 0 0 0 3px var(--claude-dim); }
.message-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.message-attachments img { max-width: min(320px, 100%); max-height: 260px; border-radius: 12px; border: 1px solid var(--line-soft); cursor: zoom-in; display: block; }
.message-attachments video { max-width: min(360px, 100%); border-radius: 12px; }
.message-attachments a.file-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(255,255,255,.5); font-size: 12.5px; color: var(--ink-2); text-decoration: none; }
#composerInput { width: 100%; min-height: 42px; max-height: 200px; border: 0; outline: 0; resize: none; background: transparent; padding: 9px 12px; color: var(--ink); line-height: 1.5; }
#composerInput::placeholder { color: var(--muted); }
.send-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--claude); background: var(--claude-dim); border-color: rgba(185,122,99,.25); }
.interject .button { min-height: 42px; border-radius: 21px; }

/* ---------- 文件抽屉 ---------- */
.files-drawer { width: min(380px, 40vw); min-width: 0; border-left: 1px solid var(--line-soft); background: rgba(255,255,255,.32); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-height: 0; overflow: hidden; }
.files-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.files-head strong { font-weight: 500; }
.files-path { flex: 1; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-crumbs { padding: 6px 14px 0; font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.files-crumbs button { border: 0; background: none; padding: 0 2px; font-size: 11px; color: var(--ink-2); }
.files-list { overflow: auto; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.file-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 12px; border: 0; background: transparent; text-align: left; font-size: 13px; }
.file-row:hover { background: rgba(255,255,255,.6); transform: none; }
.file-row .file-kind { color: var(--muted); font-size: 12px; text-align: center; }
.file-row .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row small { color: var(--muted); font-size: 10px; font-family: "Fira Code", monospace; }
.file-row.folder .file-name { color: var(--ink); font-weight: 500; }
.files-preview { max-height: 55%; overflow: auto; padding: 10px 14px 14px; border-top: 1px solid var(--line-soft); font-size: 13px; background: rgba(255,255,255,.4); }
.files-preview img { max-width: 100%; border-radius: 12px; }
.files-preview video { max-width: 100%; border-radius: 12px; }
.files-preview .md p { margin: 0 0 .5em; }
.files-preview .md h1, .files-preview .md h2, .files-preview .md h3 { font-size: 14px; margin: .6em 0 .3em; }
.files-preview pre { white-space: pre-wrap; font-family: "Fira Code", monospace; font-size: 12px; }
.files-preview .preview-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.files-preview .preview-head a { color: var(--claude); }

/* ---------- 灯箱 ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(20,16,12,.82); display: grid; place-items: center; cursor: zoom-out; padding: 24px; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }

/* ---------- 窄屏 ---------- */
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 64px minmax(0, 1fr); padding: 12px; gap: 10px; }
  .side-panel { display: none; }
  .rail, .main-card { height: calc(100dvh - 24px); }
  .files-drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(92vw, 420px); z-index: 6; background: rgba(255,253,248,.97); }
  .messages { padding: 14px 14px 16px; }
  .message { max-width: 94%; }
  .interject { margin: 0 10px 12px; }
  .office-board { margin: 0 12px 6px; }
}
@media (max-width: 560px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { order: 2; height: auto; flex-direction: row; justify-content: center; padding: 6px 8px; border-radius: 22px; }
  .rail-logo, .rail-spacer { display: none; }
  .rail-rooms { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .rail-btn { width: 54px; min-height: 44px; }
  .main-card { order: 1; height: auto; }
  .room-bar { padding: 0 12px; }
  .room-bar .button { padding: 0 9px; }
}
