:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 15px;
  color: #1d1d1b;
  background: #fff;
  --surface: #fff;
  --rail: #f7f7f6;
  --shade: #efefee;
  --border: #e7e7e5;
  --muted: #62625f;
  --ink: #1d1d1b;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid #595958; outline-offset: 3px; }
a { color: inherit; }

.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); height: 100dvh; min-height: 360px; }
.shell.closed { grid-template-columns: minmax(0, 1fr); }
.shell.closed .rail { display: none; }
.rail { display: flex; flex-direction: column; gap: 20px; min-height: 0; padding: 15px 12px 14px; background: var(--rail); border-right: 1px solid #eeeeed; }
.rail-head, .topbar, .composer-controls, .admin-actions { display: flex; align-items: center; gap: 10px; }
.rail-head { min-height: 37px; justify-content: space-between; padding-left: 7px; }
.brand { font-weight: 670; letter-spacing: -.025em; white-space: nowrap; }
.plain, .rail-button, .history-button, .icon { border: 0; background: transparent; color: var(--ink); border-radius: 8px; }
.plain { padding: 8px 10px; font-size: .87rem; }
.plain:hover, .rail-button:hover, .history-button:hover, .icon:hover, .history-button.current { background: var(--shade); }
.icon { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; flex: 0 0 auto; font-size: 18px; }
.panel-icon { width: 15px; height: 13px; border: 1.45px solid currentColor; border-radius: 3px; position: relative; }
.panel-icon::after { content: ''; position: absolute; inset: 0 auto 0 4px; border-left: 1.45px solid currentColor; }
.rail-button, .history-button { display: flex; align-items: center; text-align: start; padding: 9px 8px; gap: 8px; width: 100%; }
.rail-button { font-weight: 550; }
.plus { font-size: 17px; line-height: 1; width: 16px; text-align: center; }
.rail-middle { min-height: 0; overflow: auto; flex: 1; }
.history-label { padding: 1px 8px 7px; color: var(--muted); font-size: .77rem; font-weight: 610; }
.history-button { overflow: hidden; display: block; white-space: nowrap; text-overflow: ellipsis; font-size: .88rem; font-weight: 400; }
.rail-foot { border-top: 1px solid var(--border); padding-top: 8px; }
.rail-foot .rail-button { font-size: .87rem; }
.veil { display: none; }

.main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.topbar { min-height: 63px; padding: 0 25px; justify-content: space-between; }
.topbar-group { display: flex; align-items: center; gap: 7px; }
.section-name { font-weight: 610; color: #373735; font-size: .94rem; }
.topbar .language { color: #4c4c49; }
.outline-button, .dark-button { border-radius: 9px; padding: 9px 13px; font-size: .87rem; font-weight: 580; }
.outline-button { background: var(--surface); color: var(--ink); border: 1px solid #d9d9d6; }
.outline-button:hover { background: #f7f7f6; }
.dark-button { color: white; background: var(--ink); border: 1px solid var(--ink); }
.dark-button:hover { background: #373734; }
.dark-button:disabled { opacity: .56; }
.view { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-body { width: 100%; flex: 1 1 auto; overflow: auto; min-height: 0; }
.empty .chat-body { display: none; }
.compose-space { padding: 0 22px max(13px, env(safe-area-inset-bottom)); flex: 0 0 auto; }
.empty .compose-space { flex: 1 1 auto; display: grid; align-content: center; padding-bottom: max(42px, env(safe-area-inset-bottom)); }
.lab { width: min(100%, 668px); margin-inline: auto; }
.intro { text-align: center; margin: 0 0 30px; }
.intro h1 { font-size: clamp(1.85rem, 3vw, 2.55rem); line-height: 1.2; margin: 0; font-weight: 570; letter-spacing: -.042em; }
html[lang='zh-CN'] .intro h1 { letter-spacing: -.055em; }
.composer { border: 1px solid #dcdcd8; border-radius: 23px; background: white; padding: 13px 13px 9px 16px; box-shadow: 0 2px 9px #00000007; }
.composer:focus-within { border-color: #a9a9a5; }
.composer textarea { display: block; width: 100%; border: 0; outline: none; background: transparent; resize: none; min-height: 30px; max-height: 145px; line-height: 1.55; color: var(--ink); padding: 2px 0; }
.composer textarea:focus-visible { outline: none; }
.composer textarea::placeholder { color: #6e6e6b; }
.composer-controls { justify-content: space-between; min-height: 37px; }
.mode { border: 1px solid transparent; background: transparent; border-radius: 6px; color: #4a4a47; padding: 5px 1px; font-size: .83rem; max-width: 68%; }
.send { display: grid; place-items: center; width: 35px; height: 35px; background: var(--ink); border: 0; color: white; border-radius: 50%; font-size: 20px; line-height: 1; }
.send:hover { background: #3d3d3b; }
.send:disabled { background: #eaeae8; color: #5b5b58; }
.status { text-align: center; margin: 12px 0 0; min-height: 1.35em; font-size: .76rem; color: var(--muted); line-height: 1.5; }
.examples { display: flex; justify-content: center; gap: 7px 12px; flex-wrap: wrap; margin: 12px 0 0; }
.examples .plain { color: #52524f; font-size: .82rem; padding: 5px 8px; }
.messages { padding: 20px 22px 24px; width: min(100%, 712px); margin: auto; display: flex; flex-direction: column; gap: 25px; }
.message { width: fit-content; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.68; max-width: 100%; }
.message.user { align-self: flex-end; background: #f2f2f1; border-radius: 16px; padding: 9px 14px; max-width: 88%; }
.message.assistant { width: 100%; }
.message.assistant code { background: var(--rail); padding: 1px 4px; border-radius: 4px; font-size: .91em; }
.message.pending, .message.note { color: var(--muted); }
.chat-actions { margin-left: auto; }

.sheet { max-width: 790px; margin: 3vh auto 0; width: 100%; padding: 3px 24px 36px; overflow: auto; }
.sheet h1 { font-size: 1.85rem; font-weight: 620; letter-spacing: -.035em; }
.sheet h2 { font-size: 1.1rem; margin: 0 0 15px; }
.sheet section { border-top: 1px solid var(--border); margin: 26px 0 0; padding: 20px 0 0; }
.sheet .notice { color: var(--muted); line-height: 1.5; }
.sheet form, .dialog-form { display: grid; gap: 11px; }
.sheet form { max-width: 490px; }
.field { display: grid; gap: 5px; }
.field > span { font-size: .87rem; font-weight: 560; }
.field input { min-width: 0; border: 1px solid #d7d7d4; border-radius: 8px; padding: 10px; }
.check { display: flex; align-items: flex-start; gap: 7px; font-size: .86rem; line-height: 1.45; }
.sheet .dark-button { justify-self: start; }
.summary { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0; }
.summary b { display: block; font-size: 1.35rem; margin-bottom: 2px; }
.summary small { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.admin-table th, .admin-table td { padding: 10px 7px; border-bottom: 1px solid var(--border); text-align: start; }
.admin-table input { width: 60px; border: 1px solid var(--border); border-radius: 6px; padding: 5px; }
.admin-actions { white-space: nowrap; gap: 4px; }
.invite-result { margin-top: 12px; width: 100%; overflow-wrap: anywhere; }
.invite-result code { user-select: all; }
.external { text-underline-offset: 3px; }
dialog { border: 1px solid var(--border); border-radius: 18px; padding: 23px; width: min(405px, calc(100% - 30px)); color: var(--ink); box-shadow: 0 10px 55px #00000012; }
dialog::backdrop { background: #0005; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dialog-top h2 { font-size: 1.22rem; margin: 0; }
.dialog-form { margin: 17px 0 0; }
.dialog-form p { margin: 0; color: var(--muted); font-size: .86rem; }
.dialog-form .error { color: #272727; min-height: 1.15em; }

@media (max-width: 760px) {
  .shell { display: block; }
  .main { height: 100%; }
  .rail { position: fixed; z-index: 4; inset: 0 auto 0 0; width: min(265px, 78vw); }
  .veil { position: fixed; inset: 0; z-index: 3; background: #0004; border: 0; display: block; }
  .shell.closed .veil { display: none; }
  .topbar { padding: 0 14px; min-height: 57px; }
  .compose-space { padding-inline: 14px; }
  .empty .compose-space { padding-bottom: 36px; }
  .intro { margin-bottom: 25px; }
  .messages { padding-inline: 16px; }
  .sheet { padding-inline: 17px; }
}
