:root {
  color-scheme: light;
  --ink: #172b4d;
  --muted: #718096;
  --line: #dce6f2;
  --soft: #f5f8fc;
  --blue: #2463d4;
  --blue-dark: #17479f;
  --blue-soft: #ebf3ff;
  font-family: "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { height: 100vh; margin: 0; min-width: 320px; overflow: hidden; color: var(--ink); background: #fff; }
button, textarea, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { width: min(940px, calc(100% - 36px)); min-height: 72px; display: flex; align-items: center; gap: 12px; margin: 0 auto; padding: 13px 0; border-bottom: 1px solid var(--line); }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; background: var(--blue); }
.brand-eye { position: relative; display: block; width: 21px; height: 13px; border: 2px solid #fff; border-radius: 70% 22%; transform: rotate(-12deg); }
.brand-eye span { position: absolute; top: 50%; left: 50%; width: 5px; height: 5px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); }
.brand-copy h1, h2, h3, p { margin-top: 0; }
.brand-copy h1 { margin-bottom: 0; font-size: 17px; line-height: 1.25; }
.brand-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.2; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.35px; }
.eyebrow.blue { color: var(--blue); }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.connection { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.connection.ok { border-color: #b7cdf4; color: var(--blue-dark); background: var(--blue-soft); }
.icon-button, .text-button, .close-button { border: 0; color: var(--blue-dark); background: transparent; font-size: 12px; }
.icon-button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.icon-button:hover, .text-button:hover, .close-button:hover { color: var(--blue); }
.chat-shell { width: min(940px, calc(100% - 36px)); height: calc(100vh - 72px); min-height: 0; display: flex; margin: 0 auto; padding: 38px 0 24px; }
.conversation { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.conversation-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 0 3px 20px; }
h2 { margin-bottom: 0; font-size: clamp(22px, 3vw, 29px); line-height: 1.3; }
.chat-log { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 2px 9px 20px 3px; scrollbar-width: thin; scrollbar-color: #c2d2e7 transparent; }
.chat-log { scrollbar-width: none; }
.chat-log::-webkit-scrollbar { display: none; width: 0; height: 0; }
.message { display: flex; margin: 15px 0; }
.message.user { justify-content: flex-end; }
.message > div { min-width: 0; max-width: 88%; }
.bubble { width: fit-content; max-width: 100%; padding: 12px 15px; border: 1px solid var(--line); border-radius: 9px; white-space: pre-wrap; line-height: 1.72; font-size: 14px; }
.message.assistant .bubble { background: var(--soft); }
.message.user .bubble { color: #fff; border-color: var(--blue); background: var(--blue); }
.message-meta { margin-top: 5px; color: var(--muted); font-size: 10px; }
.artifact-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.artifact-links a { display: inline-block; padding: 6px 9px; border: 1px solid #b9cbe3; border-radius: 6px; color: var(--blue-dark); background: var(--blue-soft); font-size: 11px; text-decoration: none; }
.artifact-links a:hover { border-color: var(--blue); }
.composer { padding: 13px 15px 11px; border: 1px solid #b9cbe3; border-radius: 9px; box-shadow: 0 6px 22px rgba(32, 74, 137, .07); }
.composer textarea { width: 100%; min-height: 78px; border: 0; outline: 0; resize: vertical; color: var(--ink); line-height: 1.6; }
textarea::placeholder, input::placeholder { color: #99a8ba; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 9px; border-top: 1px solid var(--line); }
.attachment-name { overflow: hidden; flex: 1; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.attach-button { position: relative; padding: 8px 0; color: var(--blue-dark); font-size: 12px; cursor: pointer; }
.attach-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.quiet, .panel-copy { color: var(--muted); font-size: 11px; }
.primary-button, .secondary-button { padding: 10px 16px; border-radius: 7px; border: 1px solid transparent; font-size: 13px; font-weight: 700; }
.primary-button { color: #fff; background: var(--blue); }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { width: 100%; color: var(--blue-dark); background: var(--blue-soft); border-color: #c6dbfa; }
.secondary-button:hover { background: #dceaff; }
.scrim { position: fixed; inset: 0; z-index: 4; background: rgba(16, 36, 65, .2); }
.settings-drawer { position: fixed; z-index: 5; top: 0; right: 0; width: min(390px, 100%); height: 100vh; overflow-y: auto; padding: 24px 22px 40px; background: #fff; box-shadow: -10px 0 34px rgba(20, 55, 110, .13); transform: translateX(100%); transition: transform .2s ease; }
.settings-drawer.open { transform: translateX(0); }
.drawer-heading, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.drawer-heading { padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.drawer-heading h2 { font-size: 23px; }
.close-button { padding: 8px 0; }
.settings-section { padding: 21px 0; border-bottom: 1px solid var(--line); }
.settings-section h3 { margin-bottom: 9px; font-size: 15px; }
.panel-copy { margin: 0 0 13px; line-height: 1.6; }
.settings-section label { display: block; margin-top: 10px; color: var(--muted); font-size: 11px; }
.settings-section input, .settings-section select { display: block; width: 100%; margin-top: 5px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; outline: 0; color: var(--ink); background: #fff; font-size: 12px; }
.model-note { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.settings-section input:focus, .settings-section select:focus, .settings-section textarea:focus { border-color: #8eb2ea; }
.status-line { min-height: 17px; margin: 10px 0 0; color: var(--blue-dark); font-size: 11px; line-height: 1.5; }
.model-tests { display: flex; gap: 14px; margin-top: 8px; }
.count { min-width: 23px; padding: 3px 7px; border-radius: 999px; color: var(--blue-dark); background: var(--blue-soft); text-align: center; font-size: 11px; }
.dropzone { display: block; padding: 15px 11px; border: 1px dashed #a7c3e8; border-radius: 7px; text-align: center; color: var(--blue-dark); background: #fbfdff; cursor: pointer; }
.dropzone:hover { border-color: var(--blue); background: var(--blue-soft); }
.dropzone span, .dropzone small { display: block; }
.dropzone span { font-size: 12px; font-weight: 700; }
.dropzone small { margin-top: 4px; color: var(--muted); font-size: 10px; }
#fileInput { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.settings-section .secondary-button { margin-top: 10px; }
.material-list { margin-top: 13px; border-top: 1px solid var(--line); }
.material-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.material-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.material-size { flex: 0 0 auto; color: var(--muted); font-size: 10px; }
.memory-list { margin-top: 10px; }
.memory-item { padding: 10px 0; border-top: 1px solid var(--line); }
.memory-content { color: var(--ink); font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.memory-content small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.memory-actions { display: flex; gap: 12px; margin-top: 6px; }
.skill-list { margin-top: 10px; }
.skill-toolbar { display: flex; align-items: center; gap: 8px; }
.skill-toolbar select { padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: var(--soft); font-size: 10px; }
.skill-item { padding: 11px 0; border-top: 1px solid var(--line); }
.skill-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.skill-status { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; color: var(--muted); background: var(--soft); font-size: 10px; }
.skill-status.active { color: #17623c; background: #e7f7ee; }
.skill-status.testing { color: #7b5600; background: #fff6d8; }
.skill-description { margin: 6px 0 4px; color: var(--ink); font-size: 11px; line-height: 1.5; }
.skill-meta, .skill-summary { display: block; color: var(--muted); font-size: 10px; line-height: 1.45; }
.skill-summary { margin-top: 3px; color: var(--blue-dark); }
.skill-actions { display: flex; gap: 12px; margin-top: 7px; }
.settings-section textarea { display: block; width: 100%; margin-top: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; outline: 0; color: var(--ink); line-height: 1.5; resize: vertical; font-size: 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; }
@media (max-width: 600px) { .chat-shell { width: calc(100% - 24px); height: calc(100vh - 72px); padding-top: 25px; } .topbar { width: calc(100% - 24px); } .connection { max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .chat-log { padding-right: 5px; } .hint { max-width: 58%; } }

body.dark { --ink: #e8eef8; --muted: #9eacc0; --line: #2d3d55; --soft: #172236; --blue-soft: #1b3968; color: var(--ink); background: #0d1522; }
body.dark .topbar, body.dark .composer { border-color: var(--line); }
body.dark .composer, body.dark .settings-drawer { background: #101b2c; }
body.dark .message.assistant .bubble { background: var(--soft); }
body.dark .settings-section input, body.dark .settings-section select, body.dark .settings-section textarea { border-color: var(--line); color: var(--ink); background: #142239; }
body.dark .dropzone { border-color: #486b9d; color: #c8dcfb; background: #12223a; }
body.dark .dropzone:hover { background: #1a355d; }
body.dark .scrim { background: rgba(0, 0, 0, .52); }
body.dark .connection.ok { border-color: #486b9d; color: #c8dcfb; }
body.dark .skill-status.active { color: #a9efc5; background: #183c2b; }
body.dark .skill-status.testing { color: #f1d78f; background: #493c1c; }
.login-gate { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: #fff; }
.login-gate[hidden] { display: none; }
.login-card { width: min(360px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 36px rgba(32, 74, 137, .1); }
.login-card .brand-mark { margin-bottom: 16px; }
.login-card h1 { margin: 0 0 6px; font-size: 24px; }
.login-card p { color: var(--muted); font-size: 12px; }
.login-card label { display: block; margin: 14px 0; color: var(--muted); font-size: 11px; }
.login-card input { display: block; width: 100%; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; outline: 0; }
.login-card .primary-button { width: 100%; margin-top: 6px; }
