:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #202d24;
  background: #f6f7f2;
  --ink: #202d24;
  --muted: #536259;
  --line: #dfe5dc;
  --forest: #174c38;
  --mint: #e2eee4;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 2px solid #3f7956; outline-offset: 3px; }
h1, h2, p { margin: 0; }
.topbar { min-height: 64px; padding: 12px clamp(16px, 5vw, 76px); display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 750; }
.brand-icon { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; color: #ebf8e5; background: var(--forest); border-radius: 11px; font-size: 20px; }
.wordmark { color: var(--muted); font-size: 12px; letter-spacing: .13em; }
.topbar #new-space { margin-left: auto; }
main { max-width: 1480px; margin: 0 auto; padding: clamp(12px, 3vw, 44px); }
.welcome { display: grid; grid-template-columns: 1fr minmax(290px, 390px); gap: clamp(20px, 5vw, 72px); align-items: center; max-width: 1000px; margin: clamp(30px, 11vh, 130px) auto; }
.hero-icon { width: 55px; height: 55px; font-size: 34px; border-radius: 17px; margin-bottom: 24px; }
.welcome h1 { margin-bottom: 16px; font-size: clamp(38px, 6vw, 68px); line-height: 1.08; letter-spacing: -.065em; }
.welcome p { max-width: 365px; line-height: 1.7; color: var(--muted); }
.space-form { display: grid; gap: 18px; padding: 26px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: 0 12px 35px #2038280b; }
.space-form label { display: grid; gap: 8px; font-size: 14px; font-weight: 700; }
.space-form input { width: 100%; padding: 12px; border: 1px solid #cdd8cf; border-radius: 10px; font-size: 16px; }
.primary, .quiet, .mention { min-height: 38px; padding: 8px 13px; border-radius: 9px; font-size: 14px; font-weight: 650; }
.primary { background: var(--forest); color: white; border: 1px solid var(--forest); }
.primary:hover { background: #206246; }
.quiet { color: var(--forest); background: transparent; border: 1px solid transparent; }
.quiet:hover { background: var(--mint); }
.mention { color: var(--forest); background: var(--mint); border: 1px solid transparent; }
.room { min-width: 0; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: white; }
.room-bar { min-height: 70px; padding: 12px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.room-title { min-width: 0; }
.room-title select { max-width: 100%; border: 0; color: var(--ink); font-size: 21px; font-weight: 750; background: #fff; cursor: pointer; }
.connection { margin: 4px 4px 0; color: var(--muted); font-size: 13px; }
.connection[data-connected="true"]::before { content: "●"; margin-right: 5px; color: #278247; }
.room-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(235px, 29%); min-height: 460px; height: calc(100dvh - 165px); }
.chat { display: flex; min-height: 0; flex-direction: column; }
.timeline { flex: 1; min-height: 0; overflow: auto; padding: 20px clamp(13px, 3vw, 36px); background: #fcfdfb; }
.empty { text-align: center; margin: min(14vh, 110px) auto 24px; color: var(--muted); }
.empty h2 { margin-top: 12px; color: var(--ink); font-size: 24px; }
.empty p { margin-top: 8px; }
.messages, .sidebar ul { margin: 0; padding: 0; list-style: none; }
.message { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 17px; }
.avatar { width: 34px; height: 34px; border-radius: 11px; background: #e8ede7; color: var(--forest); display: grid; place-items: center; font-weight: 750; flex: none; }
.agent .avatar { color: #f2f9ec; background: var(--forest); }
.message-content { min-width: 0; max-width: min(90%, 730px); }
.message-meta { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin: 0 0 5px; font-size: 14px; overflow-wrap: anywhere; }
.message-meta time, .message-actions small { color: var(--muted); font-size: 12px; }
.bubble { padding: 9px 13px; background: #eff2ed; border-radius: 2px 13px 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.own .bubble { background: #e3eee6; }
.agent .bubble { border: 1px solid #d0dfd3; background: #f4f8f2; }
.message-actions { display: flex; align-items: center; gap: 6px; }
.reply { min-height: 28px; padding: 3px 6px; }
.message-quote, .quote-bar { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-quote { border-left: 2px solid #a2b9a8; padding-left: 8px; margin: 0 0 5px; }
.composer { padding: 12px clamp(12px, 3vw, 26px); border-top: 1px solid var(--line); }
.composer textarea { display: block; width: 100%; padding: 9px 10px; resize: none; border: 1px solid #cdd8cf; border-radius: 10px; color: var(--ink); }
.composer-actions, .quote-bar { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.composer-actions { margin-top: 8px; }
.quote-bar span { overflow: hidden; text-overflow: ellipsis; }
.quote-bar button { flex: none; }
.error { color: #9a3529; font-size: 14px; }
.space-form .error { color: #9a3529; }
.sidebar { min-width: 0; overflow: auto; border-left: 1px solid var(--line); background: #f7f9f5; padding: 22px 18px; }
.sidebar h2 { font-size: 15px; }
.sidebar h2 span { font-weight: 500; color: var(--muted); margin-left: 4px; }
.sidebar ul { display: grid; gap: 10px; margin-top: 15px; }
.sidebar li { display: flex; align-items: center; gap: 8px; font-size: 14px; overflow-wrap: anywhere; }
.agent-panel { display: flex; gap: 8px; align-items: flex-start; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.agent-panel p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
@media (max-width: 720px) {
  .welcome { grid-template-columns: 1fr; margin: 20px auto; padding: 0 8px; }
  .hero-icon { margin-bottom: 15px; }
  .room-content { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 151px); min-height: 0; }
  .sidebar { display: none; }
  .room-bar { padding: 10px; }
  .room-title select { font-size: 17px; }
}
