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

:root {
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #27252e;
  background: #f6f6fa;
  font-synthesis: none;
  --bg: #f6f6fa;
  --panel: #fff;
  --text: #27252e;
  --muted: #8d8999;
  --line: #e9e7f0;
  --hover: #efedf5;
  --accent: #7567f8;
  --accent-soft: #efedff;
  --shadow: 0 12px 40px rgba(35, 28, 70, .12);
}
* { box-sizing: border-box; }
body { margin: 0; overflow: hidden; color: var(--text); background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { border: 0; color: inherit; background: none; cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hidden { display: none !important; }
.app-shell { height: 100vh; height: 100dvh; display: flex; }
.sidebar { width: 310px; min-width: 310px; background: var(--bg); display: flex; flex-direction: column; position: relative; z-index: 20; transition: width .25s, min-width .25s, transform .25s; }
.sidebar-top { height: 58px; display: flex; align-items: center; padding: 0 24px; gap: 15px; flex-shrink: 0; }
.icon-button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; color: var(--text); padding: 0; flex-shrink: 0; }
.icon-button:hover { background: var(--hover); }
.icon-button svg { width: 20px; height: 20px; }
.icon-button.small { width: 30px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 16px 26px 30px; font-size: 28px; font-weight: 700; text-align: left; flex-shrink: 0; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(135deg, #8b7cff, #6255e7); color: #fff; font-size: 20px; box-shadow: 0 5px 14px #7567f833; flex-shrink: 0; }
.brand-ai { font-size: 13px; letter-spacing: 1px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.main-nav { padding: 0 23px; flex-shrink: 0; }
.nav-item { height: 48px; width: 100%; display: flex; align-items: center; gap: 13px; text-align: left; font-size: 16px; padding: 0 7px; border-radius: 9px; white-space: nowrap; }
.nav-item:hover, .sub-nav button:hover { background: var(--hover); }
.nav-item svg { width: 21px; height: 21px; }
.sub-nav { margin: 1px 0 9px 17px; padding-left: 27px; border-left: 1px solid var(--line); overflow: hidden; max-height: 110px; transition: max-height .2s, margin .2s; }
.sub-nav.closed { max-height: 0; margin-top: 0; margin-bottom: 0; }
.sub-nav button { display: block; width: 100%; height: 43px; text-align: left; font-size: 15px; border-radius: 7px; padding-left: 10px; }
.tasks-section { border-top: 1px solid var(--line); margin: 18px 24px 0; min-height: 0; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.task-tabs { height: 58px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.tabs { height: 100%; display: flex; gap: 26px; }
.tab { font-size: 15px; color: var(--muted); position: relative; padding: 0 2px; }
.tab.active { color: var(--text); font-weight: 600; }
.tab.active::after { content: ""; position: absolute; height: 2px; background: var(--accent); bottom: 0; left: 0; right: 0; }
.task-content { font-size: 14px; color: var(--muted); }
.list-action { min-height: 41px; width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 4px; color: inherit; border-radius: 7px; }
.list-action:hover, .list-action.active { color: var(--accent); background: var(--hover); }
.list-action svg { width: 17px; height: 17px; }
.list-action.disclosure { gap: 5px; }
.list-action.disclosure svg { width: 14px; transition: transform .2s; }
.list-action.disclosure.closed svg { transform: rotate(-90deg); }
.nested-list { padding-left: 9px; max-height: 300px; overflow: hidden; transition: max-height .2s; }
.nested-list.closed { max-height: 0; }
.conversation-list { max-height: none; padding-bottom: 10px; }
.space-item, .conversation-row { display: flex; align-items: center; width: 100%; min-height: 36px; border-radius: 7px; position: relative; }
.space-item { padding: 0 7px; gap: 7px; font-size: 13px; }
.space-item svg { width: 15px; }
.space-item:hover, .space-item.active, .conversation-row:hover, .conversation-row.active { background: var(--hover); color: var(--text); }
.space-item.active { color: var(--accent); }
.space-item span, .conversation-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; text-align: left; }
.conversation-title { font-size: 13px; padding: 10px 4px 10px 7px; color: inherit; }
.row-action { width: 29px; height: 29px; opacity: 0; display: grid; place-items: center; border-radius: 6px; margin-right: 3px; }
.conversation-row:hover .row-action, .conversation-row.active .row-action, .row-action:focus-visible { opacity: 1; }
.row-action:hover { background: var(--panel); }
.row-action svg { width: 15px; }
.pin-indicator { width: 13px; color: var(--accent); margin-left: 4px; }
.empty-state { text-align: center; padding: 28px 8px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.account-bar { min-height: 90px; display: flex; align-items: center; gap: 12px; padding: 12px 24px; flex-shrink: 0; }
.avatar { width: 44px; height: 44px; border: 1px solid #e2dcff; background: #eeebff; border-radius: 50%; display: grid; place-items: center; color: #6759d8; font-size: 17px; flex-shrink: 0; }
.account-copy { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.account-copy strong { font-size: 15px; font-weight: 500; }
.account-copy span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar.collapsed { width: 76px; min-width: 76px; align-items: center; }
.sidebar.collapsed .sidebar-top { padding: 0; justify-content: center; }
.sidebar.collapsed .optional, .sidebar.collapsed .brand-name, .sidebar.collapsed .nav-item span, .sidebar.collapsed .sub-nav, .sidebar.collapsed .tasks-section, .sidebar.collapsed .account-copy, .sidebar.collapsed #settingsBtn { display: none; }
.sidebar.collapsed .brand { padding: 16px 0 30px; }
.sidebar.collapsed .main-nav { padding: 0; width: 100%; display: grid; place-items: center; }
.sidebar.collapsed .nav-item { width: 46px; justify-content: center; padding: 0; }
.sidebar.collapsed .account-bar { padding: 12px 0; justify-content: center; }

.main-panel { position: relative; flex: 1; min-width: 0; background: var(--panel); border-radius: 15px 0 0 0; overflow: hidden; }
.window-bar { height: 57px; display: flex; align-items: center; justify-content: flex-end; border-bottom: 1px solid var(--line); padding-right: 16px; gap: 4px; }
.feedback { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; padding: 8px 12px; border-radius: 7px; margin-right: 8px; }
.feedback:hover { background: var(--hover); color: var(--text); }
.feedback svg { width: 18px; }
.mobile-menu { display: none; margin-right: auto; margin-left: 14px; }
.workspace { height: calc(100% - 57px); display: flex; flex-direction: column; position: relative; }
.workspace.empty { justify-content: center; padding-bottom: 5vh; }
.welcome-view { width: min(1000px, calc(100% - 80px)); margin: 0 auto 34px; flex-shrink: 0; }
.mascot { width: 64px; height: 64px; margin-bottom: 16px; filter: drop-shadow(0 8px 14px #7567f825); }
.mascot svg { width: 100%; height: 100%; stroke: none; }
h1 { font-size: 32px; line-height: 1.55; letter-spacing: -.7px; margin: 0; font-weight: 700; }
.composer-column { width: min(1000px, calc(100% - 80px)); margin: 0 auto; flex-shrink: 0; padding-bottom: 16px; }
.composer-wrap { position: relative; border-radius: 24px; background: linear-gradient(180deg, var(--panel) 64%, var(--bg) 100%); box-shadow: 0 5px 25px rgba(50, 40, 90, .055); }
.composer { border: 1px solid var(--line); border-radius: 24px; min-height: 174px; padding: 21px 23px 13px; position: relative; z-index: 2; background: var(--panel); }
.composer:focus-within { border-color: #c7c0f5; box-shadow: 0 5px 25px #7567f80c; }
textarea { display: block; resize: none; border: 0; outline: 0; width: 100%; height: 62px; max-height: 180px; font-size: 16px; line-height: 1.7; color: var(--text); background: transparent; }
textarea::placeholder { color: #aaa6b4; }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 9px; }
.round-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; background: var(--panel); color: var(--muted); }
.round-button:hover { background: var(--hover); border-color: #d5d0e3; }
.round-button svg { width: 19px; }
.pill-button { height: 40px; border: 1px solid var(--line); border-radius: 22px; padding: 0 13px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; background: var(--panel); white-space: nowrap; }
.pill-button:hover { background: var(--hover); }
.pill-button svg { width: 17px; }
.pill-button .down, .model-button .down, .project-picker .down { width: 13px; height: 13px; margin-left: 2px; }
.toolbar-right { gap: 15px; }
.model-button { display: flex; align-items: center; color: var(--muted); font-size: 13px; padding: 8px 0; white-space: nowrap; }
.model-button:hover { color: var(--text); }
.model-button #modelLabel { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.component-button #componentLabel { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.component-menu { width: 390px; max-width: calc(100vw - 30px); }
.menu.component-menu, .menu.model-menu { top: auto; bottom: calc(100% + 8px); max-height: min(340px, 50vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-gutter: stable; }
.component-menu button, .model-menu button { white-space: normal; line-height: 1.5; }
.component-menu button.selected::after, .model-menu button.selected::after { content: "✓"; margin-left: auto; padding-left: 12px; }
.plain-icon { display: grid; place-items: center; color: var(--muted); padding: 7px; border-radius: 50%; }
.plain-icon:hover, .plain-icon.active { color: var(--accent); background: var(--accent-soft); }
.send-button { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; transition: .2s; }
.send-button:disabled { background: var(--hover); color: #bbb7c7; }
.send-button:not(:disabled):hover { transform: translateY(-1px); background: #6456e8; box-shadow: 0 3px 9px #d2ccf7; }
.project-picker { height: 49px; width: 100%; border-radius: 0 0 24px 24px; display: flex; align-items: center; padding: 0 25px; gap: 9px; color: var(--muted); font-size: 13px; }
.project-picker:hover { background: var(--hover); }
.project-picker > svg:first-child { width: 18px; }
.dropdown-anchor { position: relative; }
.menu { display: none; position: absolute; z-index: 30; left: 0; top: calc(100% + 8px); min-width: 145px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.menu.open { display: block; animation: menu-in .15s ease-out; }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; text-align: left; border-radius: 7px; font-size: 13px; white-space: nowrap; }
.menu button:hover, .menu button.selected { background: var(--hover); color: var(--accent); }
.menu.align-right { left: auto; right: 0; }
.project-menu { bottom: 42px; left: 18px; top: auto; min-width: 190px; }
.menu svg { width: 16px; }
.menu-separator { height: 1px; background: var(--line); margin: 5px; }
.attachment-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attachment { display: inline-flex; align-items: center; gap: 6px; max-width: 260px; font-size: 12px; background: var(--hover); padding: 6px 8px 6px 11px; border-radius: 9px; color: var(--muted); }
.attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment button { width: 20px; height: 20px; display: grid; place-items: center; padding: 0; }
.attachment svg { width: 13px; }
.composer-hint { text-align: center; color: var(--muted); font-size: 11px; margin-top: 10px; opacity: .8; }
.conversation { flex: 1; min-height: 0; display: flex; flex-direction: column; width: min(900px, calc(100% - 60px)); margin: 0 auto; }
.conversation-header { display: flex; align-items: center; justify-content: space-between; padding: 25px 0 16px; border-bottom: 1px solid var(--line); }
.conversation-header h2 { margin: 3px 0 0; font-size: 20px; font-weight: 600; max-width: 650px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eyebrow { color: var(--muted); font-size: 11px; }
.messages { flex: 1; overflow-y: auto; padding: 28px 4px; scrollbar-width: thin; }
.message { display: flex; margin-bottom: 25px; }
.message.user { justify-content: flex-end; }
.message-content { max-width: 80%; }
.message-bubble { padding: 13px 17px; border-radius: 18px; background: var(--bg); line-height: 1.8; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .message-bubble { background: var(--accent-soft); border-radius: 18px 18px 4px 18px; }
.message.assistant .message-bubble { background: var(--panel); border: 1px solid var(--line); border-radius: 4px 18px 18px 18px; }
.message-tools { display: flex; gap: 4px; margin-top: 5px; color: var(--muted); }
.message-tools button { padding: 4px 7px; display: flex; align-items: center; gap: 4px; font-size: 11px; border-radius: 5px; }
.message-tools button:hover { background: var(--hover); color: var(--accent); }
.message-tools svg { width: 13px; height: 13px; }
.message-files { font-size: 11px; color: var(--muted); margin-top: 7px; }
.typing { color: var(--muted); }
.workspace:not(.empty) .composer-column { width: min(900px, calc(100% - 60px)); }
.workspace:not(.empty) .composer { min-height: 132px; padding-top: 14px; }
.workspace:not(.empty) textarea { height: 42px; }
.workspace:not(.empty) .project-picker { height: 38px; }
.workspace:not(.empty) .composer-hint { margin-top: 5px; }

.search-overlay, .modal-overlay { position: fixed; inset: 0; background: rgba(25, 21, 40, .28); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.search-overlay { padding-top: 14vh; flex-direction: column; justify-content: flex-start; }
.search-box { width: min(600px, 92vw); height: 58px; background: var(--panel); border-radius: 13px; display: flex; align-items: center; padding: 0 14px; gap: 12px; box-shadow: var(--shadow); }
.search-box input { border: 0; outline: 0; flex: 1; font-size: 15px; min-width: 0; color: var(--text); background: transparent; }
.search-results { width: min(600px, 92vw); max-height: 360px; overflow-y: auto; background: var(--panel); margin-top: 8px; border-radius: 12px; padding: 8px; color: var(--muted); font-size: 14px; box-shadow: var(--shadow); }
.search-placeholder { padding: 20px 12px; text-align: center; }
.search-result { display: block; width: 100%; text-align: left; padding: 12px; border-radius: 8px; }
.search-result:hover { background: var(--hover); }
.search-result strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.search-result span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.modal { width: min(520px, 94vw); max-height: min(720px, 88vh); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); animation: modal-in .18s ease-out; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 14px; }
.modal-header h2 { margin: 0; font-size: 19px; }
.modal-body { padding: 6px 22px 22px; overflow-y: auto; }
.form-field { display: grid; gap: 7px; margin-bottom: 16px; }
.form-field label { font-size: 13px; color: var(--muted); }
.form-field input, .form-field textarea, .form-field select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); padding: 10px 12px; outline: 0; }
.form-field textarea { height: 105px; max-height: 180px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.primary-button, .secondary-button, .danger-button { border-radius: 9px; padding: 9px 16px; font-size: 13px; }
.primary-button { color: #fff; background: var(--accent); }
.primary-button:hover { background: #6456e8; }
.secondary-button { background: var(--hover); color: var(--text); }
.danger-button { background: #e85757; color: #fff; }
.action-list { display: grid; gap: 7px; }
.action-list button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border-radius: 9px; text-align: left; }
.action-list button:hover { background: var(--hover); }
.action-list button.danger { color: #d94b4b; }
.action-list svg { width: 18px; }
.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.template-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; text-align: left; }
.template-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.template-card strong { display: block; margin-bottom: 6px; font-size: 14px; }
.template-card span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.settings-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 12px 0; }
.toast { position: fixed; z-index: 150; bottom: 30px; left: 50%; transform: translate(-50%, 15px); background: #292631; color: #fff; border-radius: 9px; padding: 11px 18px; font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; max-width: 85vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sidebar-scrim { display: none; }
body[data-density="compact"] .nav-item { height: 41px; }
body[data-density="compact"] .account-bar { min-height: 72px; }
body[data-density="compact"] .conversation-title { padding-top: 7px; padding-bottom: 7px; }
body[data-theme="dark"] { --bg: #1d1c24; --panel: #25232d; --text: #eceaf3; --muted: #aaa5b8; --line: #3a3745; --hover: #34313f; --accent-soft: #37324f; color-scheme: dark; }
body[data-theme="dark"] .avatar { background: #37324f; border-color: #4a426a; color: #c6bfff; }
body[data-theme="dark"] .main-panel { background: var(--panel); }
body[data-theme="dark"] .toast { background: #e9e6f2; color: #27252e; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (min-width: 1700px) { .sidebar { width: 360px; min-width: 360px; } .welcome-view, .composer-column { width: min(1120px, calc(100% - 100px)); } h1 { font-size: 36px; } }
@media (max-width: 1100px) { .sidebar { width: 270px; min-width: 270px; } .pill-button { padding: 0 9px; } .toolbar-left, .toolbar-right { gap: 6px; } .welcome-view, .composer-column { width: calc(100% - 45px); } }
@media (max-width: 850px) { .sidebar, .sidebar.collapsed { position: fixed; inset: 0 auto 0 0; width: 290px; min-width: 290px; transform: translateX(-100%); align-items: stretch; box-shadow: 8px 0 30px #0001; } .sidebar.mobile-open { transform: translateX(0); } .sidebar.collapsed .optional, .sidebar.collapsed .brand-name, .sidebar.collapsed .nav-item span, .sidebar.collapsed .sub-nav, .sidebar.collapsed .tasks-section, .sidebar.collapsed .account-copy, .sidebar.collapsed #settingsBtn { display: initial; } .sidebar.collapsed .sidebar-top { padding: 0 24px; justify-content: flex-start; } .sidebar.collapsed .brand { padding: 16px 26px 30px; } .sidebar.collapsed .main-nav { padding: 0 23px; display: block; } .sidebar.collapsed .nav-item { width: 100%; justify-content: flex-start; padding: 0 7px; } .sidebar.collapsed .account-bar { padding: 12px 24px; justify-content: flex-start; } .sidebar-scrim.show { display: block; position: fixed; inset: 0; background: #0003; z-index: 15; } .mobile-menu { display: inline-flex; } .main-panel { border-radius: 0; } .workspace.empty { padding-bottom: 2vh; } .welcome-view { margin-bottom: 25px; } h1 { font-size: 27px; } .mascot { width: 56px; height: 56px; } .conversation, .workspace:not(.empty) .composer-column { width: calc(100% - 35px); } }
@media (max-width: 650px) { .window-bar { height: 50px; padding-right: 9px; } .workspace { height: calc(100% - 50px); } .feedback span { display: none; } .welcome-view, .composer-column { width: calc(100% - 28px); } .welcome-view { margin-bottom: 20px; } h1 { font-size: 23px; } .composer { min-height: 190px; padding: 16px 14px 11px; } .composer-toolbar { align-items: flex-end; gap: 5px; } .toolbar-left { flex-wrap: wrap; gap: 5px; } #toolsBtn { display: none; } .pill-button { height: 37px; font-size: 11px; padding: 0 8px; gap: 4px; } .pill-button > svg:first-child { display: none; } .toolbar-right { gap: 5px; } .toolbar-right .plain-icon { display: none; } .model-button { font-size: 11px; } .model-button span { max-width: 72px; overflow: hidden; text-overflow: ellipsis; } .round-button { width: 37px; height: 37px; } .send-button { width: 37px; height: 37px; } .project-picker { height: 42px; } .composer-hint { font-size: 10px; } .message-content { max-width: 92%; } .conversation-header { padding-top: 16px; } .conversation-header h2 { max-width: 270px; font-size: 17px; } .workspace.empty { justify-content: flex-start; padding-top: 7vh; overflow-y: auto; } .template-grid { grid-template-columns: 1fr; } }
