:root {
  --ink: #1a292a;
  --muted: #6f817f;
  --line: #dce6e2;
  --blue: #0b6b63;
  --soft: #f5f8f6;
  --card: #fff;
  --shadow: 0 14px 36px rgba(22, 56, 51, .055);
}
body { color: var(--ink); background: var(--soft); font-family: "Segoe UI", "Microsoft YaHei", sans-serif; }
.app { background: var(--soft); }
.sidebar { width:254px; padding:28px 16px 20px; background:linear-gradient(170deg,#15352f,#0f2525 68%,#102a2a); }
.sidebar:before { background:#4eb69e; opacity:.14; }
.brand { padding:0 10px 30px; }
.brand-mark { width:42px; height:42px; border-radius:13px; background:linear-gradient(135deg,#65d7bf,#2f9f92); box-shadow:0 8px 20px rgba(27,165,135,.2); color:#10372d; }
.brand-name { font-size:17px; letter-spacing:.01em; }
.brand-caption { margin-top:4px; letter-spacing:.2em; color:#8eb7ad; }
.new-btn { height:46px; border:1px solid rgba(172,235,220,.25); background:#e8faf4; color:#135b4b; box-shadow:none; font-size:13px; }
.new-btn:hover { background:#fff; filter:none; }
.section-label,.history-heading { color:#7fa79e; font-size:11px; letter-spacing:.12em; }
.section-label { margin-top:32px; }
.side-link { min-height:43px; font-size:13px; color:#b8d1cb; }
.side-link svg { color:#89c8b8; }
.side-link:hover,.side-link.active { background:rgba(187,238,225,.11); color:#fff; }
.search-wrap { height:39px; background:rgba(255,255,255,.06); border-color:rgba(210,244,234,.12); }
.search-wrap input { font-size:12px; }
.conv-item { min-height:43px; }
.conv-item .title { font-size:12px; }
.conv-item.active { background:#315b54; }
.side-bottom { border-color:rgba(227,247,240,.13); }
.local-state { color:#c5e3d9; }
.local-state span:last-child { color:#92b9ac; }
.sidebar-foot { color:#89aaa3; font-size:11px; }
.pulse.offline,.system-dot.offline { background:#d6a47d; box-shadow:0 0 0 4px rgba(214,164,125,.15); }
.main { background:radial-gradient(circle at 55% 0,#eef8f4,transparent 32%),#f7f9f8; }
.main-header { min-height:72px; background:rgba(255,255,255,.89); padding:0 27px; }
.breadcrumb { font-size:12px; color:#91a09e; }
.breadcrumb strong { color:#28423e; font-size:13px; }
.header-right { gap:10px; }
.header-chip { height:32px; border-color:#d9ebe5; background:#eff8f4; color:#326f61; font-size:11px; }
.header-chip svg { color:#278a72; }
.header-action,.logout-btn { border:1px solid #dbe8e2; background:#fff; color:#46625d; border-radius:9px; padding:8px 11px; font-size:11px; white-space:nowrap; }
.header-action:hover,.logout-btn:hover { background:#eef8f4; border-color:#b5d8cc; }
#libraryBtn { display:none; }
.account-name { padding:0 4px; color:#45625c; font-weight:650; }
.messages { gap:24px; padding:37px max(36px,calc((100% - 880px)/2)) 44px; }
.welcome { max-width:880px; margin:auto; padding:7px 0 28px; }
.welcome-topline { color:#348575; font-size:11px; letter-spacing:.16em; }
.welcome h1 { font-size:clamp(36px,4vw,51px); line-height:1.22; margin:18px 0 14px; color:#172e2b; letter-spacing:-.045em; }
.welcome h1 em { color:#19836e; }
.welcome-sub { max-width:620px; color:#6e837d; font-size:14px; line-height:1.85; margin-bottom:28px; }
.hero-card { min-height:190px; padding:27px 31px; border-radius:18px; background:linear-gradient(112deg,#17473f,#216b5c); box-shadow:0 18px 36px rgba(29,104,83,.13); }
.hero-card:before { right:-88px; top:-130px; border-color:rgba(255,255,255,.13); }
.hero-card:after { background:#6be2b1; opacity:.28; }
.hero-graphic { display:none; }
.hero-copy { max-width:100%; }
.hero-tag { color:#e2f9ee; border-color:rgba(255,255,255,.2); }
.hero-card h2 { font-size:22px; margin:16px 0 8px; }
.hero-card p { color:#c9e8dd; font-size:12px; margin-bottom:14px; }
.hero-btn { color:#1b6652; font-size:12px; }
.content-heading { margin-top:31px; margin-bottom:15px; }
.content-heading h3 { color:#25443d; font-size:15px; }
.content-heading span { font-size:11px; }
.quick-grid { gap:12px; }
.quick-card { min-height:145px; padding:17px; border-color:#e1ebe6; box-shadow:var(--shadow); }
.quick-card:hover { border-color:#98cbbb; box-shadow:0 18px 32px rgba(35,101,78,.1); }
.quick-card strong { color:#26453d; font-size:13px; }
.quick-card small { color:#80928b; font-size:11px; line-height:1.55; }
.quick-icon { width:31px; height:31px; margin-bottom:18px; }
.quick-card:nth-child(1) .quick-icon,.quick-card:nth-child(2) .quick-icon,.quick-card:nth-child(3) .quick-icon,.quick-card:nth-child(4) .quick-icon { background:#e9f5ef; color:#20866d; }
.insight-strip { margin-top:23px; padding:14px 17px; border-color:#e1ebe6; color:#6e817b; background:#fff; font-size:11px; }
.insight-strip svg { color:#309576; }
.insight-strip strong { color:#28584a; }
.chat-row { max-width:860px; }
.msg-avatar { background:#dff1e8; color:#168368; box-shadow:none; }
.chat-row.user .msg-avatar { background:#e6ece9; color:#5b7d72; }
.msg-body { max-width:min(82%,750px); }
.msg-label { color:#81948c; font-size:11px; }
.msg { padding:15px 18px; border:1px solid #e1eae5; border-radius:4px 14px 14px 14px; color:#263f38; font-size:14px; line-height:1.85; box-shadow:0 8px 24px rgba(30,74,55,.035); }
.chat-row.user .msg { background:#2f7966; border:0; color:#fff; }
.message-actions { margin:6px 2px 0; }
.message-actions button { border:0; background:none; padding:4px 5px; color:#738d83; font-size:11px; }
.message-actions button:hover { color:#0b6b63; }
.source-list { margin:7px 0 0; border:1px solid #dce9e2; border-radius:10px; background:#fbfdfb; color:#355c4e; font-size:11px; }
.source-list summary { cursor:pointer; padding:10px 12px; font-weight:700; }
.source-card { border-top:1px solid #e5eee8; padding:10px 12px; }
.source-card strong { display:block; font-size:11px; overflow-wrap:anywhere; }
.source-card p { margin:5px 0 0; color:#647c70; line-height:1.6; white-space:pre-wrap; }
.composer-zone { padding:13px max(35px,calc((100% - 880px)/2)) 18px; border-top:1px solid #e5eee8; background:rgba(248,250,249,.96); }
.composer-heading { display:flex; justify-content:space-between; color:#536d62; font-size:11px; font-weight:700; padding:0 3px 9px; }
.composer-heading span:last-child { color:#258165; }
.composer { border-color:#d6e5db; box-shadow:0 8px 25px rgba(22,66,48,.06); }
.composer:focus-within { border-color:#6eb79c; }
.composer textarea { min-height:42px; height:42px; overflow-y:hidden; color:#2b443b; font-size:13px; }
.send-btn { background:#197a61; box-shadow:none; }
.send-btn:hover { background:#12684f; }
.composer-foot { color:#86978d; }
.library-panel { flex:none; width:292px; overflow-y:auto; padding:29px 19px 22px; background:#fff; border-left:1px solid #e0e9e3; }
.library-head { display:flex; align-items:flex-start; justify-content:space-between; }
.eyebrow { display:block; color:#329477; font-size:10px; font-weight:800; letter-spacing:.16em; }
.library-head h2,.settings-top h2 { margin:6px 0 0; color:#204035; font-size:19px; }
.panel-close { display:none; border:0; background:none; color:#6b8578; font-size:25px; line-height:1; }
.library-intro { margin:17px 0 21px; color:#788d82; font-size:12px; line-height:1.75; }
.system-card { padding:16px; border:1px solid #d6eadf; border-radius:13px; background:#f2faf5; }
.system-card-top { display:flex; align-items:center; gap:9px; color:#2b6652; font-size:12px; }
.system-dot { width:8px; height:8px; border-radius:50%; background:#28ad7c; box-shadow:0 0 0 4px rgba(40,173,124,.13); }
.system-card>span { display:block; margin-top:9px; color:#6f897c; font-size:11px; }
.library-section-title { display:flex; justify-content:space-between; align-items:center; margin:29px 0 12px; color:#29493d; font-size:12px; }
.library-section-title span { color:#94a69c; font-size:11px; }
.document-list { display:flex; flex-direction:column; gap:8px; max-height:260px; overflow:auto; }
.document-empty { border:1px dashed #cfded4; border-radius:10px; padding:15px; color:#80958a; font-size:11px; line-height:1.7; }
.document-item { display:flex; align-items:center; gap:8px; padding:10px 11px; border:1px solid #e4ece7; border-radius:10px; }
.document-info { flex:1; min-width:0; }
.document-info strong { display:block; color:#355449; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.document-info small { display:block; margin-top:3px; color:#98a79d; font-size:10px; }
.document-item button { border:0; background:none; color:#a36b62; font-size:10px; }
.upload-btn { width:100%; margin-top:13px; padding:11px; border:1px solid #8dc5aa; border-radius:9px; background:#eff9f2; color:#276d51; font-size:12px; font-weight:750; }
.upload-btn:hover { background:#e4f5e9; }
.upload-btn:disabled { opacity:.6; cursor:wait; }
.upload-note { min-height:36px; margin:9px 1px 0; color:#86988d; font-size:10px; line-height:1.6; }
.library-tip { margin-top:28px; padding:16px; border-radius:12px; background:#f8f9f5; color:#426251; }
.library-tip strong { font-size:11px; }
.library-tip p { margin:7px 0 0; color:#849489; font-size:11px; line-height:1.7; }
.settings-dialog { width:min(440px,calc(100vw - 30px)); max-height:calc(100vh - 30px); padding:27px; border:1px solid #dbe8df; border-radius:17px; box-shadow:0 30px 80px rgba(17,57,39,.18); color:#244337; }
.settings-dialog::backdrop { background:rgba(10,33,26,.5); }
.settings-top { display:flex; justify-content:space-between; }
.settings-top button { border:0; background:none; color:#6d8779; font-size:25px; }
.settings-dialog p { color:#788e80; font-size:12px; line-height:1.7; }
.settings-dialog label { display:block; margin:19px 0 7px; font-size:12px; font-weight:700; }
.settings-dialog input,.settings-dialog select { width:100%; height:42px; padding:0 11px; border:1px solid #d8e5dc; border-radius:8px; background:#fff; color:#294739; font:inherit; font-size:12px; }
.settings-error { min-height:20px; margin-top:9px; color:#b44545; font-size:11px; }
.save-settings { width:100%; margin-top:8px; padding:11px; border:0; border-radius:8px; background:#17775f; color:#fff; font-weight:700; }
.auth-screen { background:radial-gradient(circle at 50% 0,#e5f4e9,#f7f9f7 58%); }
.auth-card { border-color:#dcebe1; box-shadow:0 30px 65px rgba(25,70,46,.1); }
.auth-card h1 { color:#1e4737; }
.auth-card input { border-color:#d7e6dc; }
.auth-submit { background:#197a61; }
.auth-switch { color:#17775f; }
@media(max-width:1180px) {
  #libraryBtn { display:inline-block; }
  .library-panel { position:fixed; right:0; top:0; bottom:0; z-index:35; width:min(340px,92vw); box-shadow:-24px 0 55px rgba(20,49,38,.13); transform:translateX(105%); transition:transform .25s; }
  .library-panel.open { transform:translateX(0); }
  .panel-close { display:block; }
}
@media(max-width:700px) {
  .main-header { padding:0 13px; }
  .header-right { gap:6px; }
  .header-action,.logout-btn { padding:7px; font-size:10px; }
  #settingsBtn { display:none; }
  .account-name { max-width:70px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
  .messages { padding:25px 17px; }
  .welcome h1 { font-size:35px; }
  .welcome-sub { font-size:13px; }
  .quick-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .quick-card { min-height:130px; }
  .composer-zone { padding:11px 15px 12px; }
  .msg-body { max-width:86%; }
}
@media(max-width:430px) {
  .breadcrumb span,.breadcrumb svg { display:none; }
  .header-right .account-name { display:none; }
  .quick-grid { grid-template-columns:1fr 1fr; }
  .quick-card { min-height:125px; padding:13px; }
  .quick-card strong { font-size:12px; }
  .quick-card small { font-size:10px; }
  .hero-card { padding:22px; }
  .hero-card h2 { font-size:19px; }
}

/* 学院视觉与专业工作台 */
:root { --ink:#172d48; --muted:#647891; --line:#dce6f1; --blue:#185b9f; --soft:#f4f7fb; --shadow:0 12px 34px rgba(24,58,104,.07); }
body { color:var(--ink); background:var(--soft); }
.institution-bar { height:92px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:8px 28px; background:#fff; border-bottom:1px solid #d9e5f2; box-shadow:0 3px 16px rgba(31,75,128,.045); }
.institution-bar img { display:block; width:auto; height:76px; max-width:min(68vw,650px); object-fit:contain; object-position:left center; }
.institution-product { display:flex; flex-direction:column; gap:4px; padding-left:18px; border-left:3px solid #cf453b; white-space:nowrap; }
.institution-product strong { color:#155492; font-size:19px; letter-spacing:.07em; }
.institution-product span { color:#75859a; font-size:11px; letter-spacing:.13em; }
.app { height:calc(100dvh - 92px); min-height:470px; }
.auth-screen { min-height:calc(100dvh - 92px); background:radial-gradient(circle at 50% 0,#e6f0fa,#f4f7fb 62%); }
.auth-card { border-color:#d8e5f2; }
.auth-card h1 { color:#174a7e; }
.auth-card input { border-color:#d7e3ef; }
.auth-submit,.save-settings { background:#1c609e; }
.auth-switch { color:#1c609e; }
.sidebar { width:258px; background:linear-gradient(165deg,#103b67,#0d2746 70%,#102e4e); }
.sidebar:before { background:#428fcb; }
.brand-mark { background:linear-gradient(135deg,#dbefff,#79b1dd); color:#16477b; box-shadow:none; }
.brand-caption { color:#9dbbd9; }
.new-btn { background:#f3f8fc; color:#144e81; border-color:#c5dceb; }
.new-btn:hover { background:#fff; }
.section-label,.history-heading { color:#91aecb; }
.side-link { color:#c0d5e8; }
.side-link svg { color:#a7c9e8; }
.side-link:hover,.side-link.active { background:rgba(181,217,247,.15); }
.conv-item.active { background:#285882; }
.sidebar-foot,.local-state span:last-child { color:#a0b8d0; }
.main { background:radial-gradient(circle at 70% 2%,#e4effb,transparent 33%),#f5f8fc; }
.main-header { min-height:68px; background:rgba(255,255,255,.92); border-bottom-color:#dbe6f1; }
.breadcrumb,.breadcrumb strong { color:#2b587f; }
.header-chip { color:#27658b; background:#edf6fc; border-color:#d7e8f4; }
.model-picker-trigger { font:inherit; font-size:11px; cursor:pointer; white-space:nowrap; }
.model-picker-trigger:hover { background:#dceefa; }
.header-chip svg { color:#1e74ad; }
.header-action,.logout-btn { color:#365d7c; border-color:#dce6ef; }
.header-action:hover,.logout-btn:hover { color:#144e81; background:#eef6fc; border-color:#bdd8ee; }
.header-action:disabled { opacity:.48; cursor:not-allowed; background:#f4f6f8; }
.account-name { color:#395d79; }
.messages { padding-top:28px; }
.welcome { max-width:920px; }
.welcome-topline,.eyebrow { color:#2b709f; }
.welcome h1 { color:#183b60; }
.welcome h1 em { color:#1e6ca8; }
.welcome-sub { color:#688097; }
.hero-card { background:linear-gradient(112deg,#174671,#1d6196 62%,#2c78a9); box-shadow:0 18px 38px rgba(28,85,139,.17); }
.hero-card:after { background:#9ed3f3; }
.hero-btn { color:#164f82; }
.content-heading h3 { color:#264e73; }
.quick-card { border-color:#dfe8f2; }
.quick-card:hover { border-color:#94bfdf; box-shadow:0 16px 30px rgba(32,90,146,.12); }
.quick-card strong { color:#244b70; }
.quick-card:nth-child(1) .quick-icon,.quick-card:nth-child(2) .quick-icon,.quick-card:nth-child(3) .quick-icon,.quick-card:nth-child(4) .quick-icon { background:#e9f2fa; color:#226ca5; }
.insight-strip { border-color:#e0e9f2; }
.insight-strip svg { color:#c94e42; }
.insight-strip strong { color:#315c80; }
.msg-avatar { background:#e2f0fa; color:#216c9f; }
.chat-row.user .msg { background:#21699f; }
.msg { border-color:#dee8f2; color:#294a69; }
.msg .katex-display { max-width:100%; margin:.7em 0; overflow-x:auto; overflow-y:hidden; }
.message-actions { display:flex; flex-wrap:wrap; gap:7px; }
.message-actions button { padding:5px 9px; border:1px solid #d7e5f0; border-radius:7px; background:#fff; color:#3a6e95; }
.message-actions button:hover { background:#edf6fc; color:#165c90; }
.source-list { border-color:#d9e7f1; background:#f8fbfe; }
.source-list summary,.source-card { color:#285477; }
.composer-zone { border-top-color:#dae6f0; background:rgba(247,250,253,.96); }
.composer-heading { color:#3d617e; align-items:center; }
.composer-heading>div { display:flex; align-items:center; gap:12px; }
.composer-heading span:last-child { color:#2e709e; }
.builder-trigger { border:0; border-radius:6px; background:#e5f0f9; color:#155b91; padding:5px 8px; font-size:11px; font-weight:700; }
.builder-trigger:hover { background:#d5e9f7; }
.composer { border-color:#cedfeb; }
.composer:focus-within { border-color:#79b2dc; }
.send-btn { background:#1d679f; }
.send-btn:hover { background:#165481; }
.composer-foot { color:#70849a; }
.composer-foot .draft-active { color:#186aa0; font-weight:700; }
.library-backdrop { display:none; position:fixed; inset:92px 0 0; z-index:30; background:rgba(9,29,53,.38); }
.library-backdrop.show { display:block; }
.library-panel { position:fixed; right:0; top:92px; bottom:0; z-index:35; width:min(380px,96vw); padding:30px 24px; border-left:1px solid #dbe7f1; box-shadow:-22px 0 50px rgba(19,47,78,.12); transform:translateX(105%); transition:transform .25s; }
.library-panel.open { transform:translateX(0); }
.panel-close { display:block; }
.library-head h2,.settings-top h2 { color:#234d6c; }
.system-card { background:#edf7fb; border-color:#d7e9f2; }
.system-card-top,.library-section-title,.library-tip { color:#245a78; }
.system-card>span,.library-intro,.library-tip p { color:#68849a; }
.upload-btn { color:#1d628d; border-color:#9cc8df; background:#edf7fb; }
.upload-btn:hover { background:#dff0f9; }
.library-tip { background:#f1f6fa; }
.settings-dialog,.builder-dialog { border:1px solid #d8e5f0; border-radius:17px; color:#274d6e; box-shadow:0 32px 90px rgba(13,46,77,.22); }
.settings-dialog::backdrop,.builder-dialog::backdrop { background:rgba(9,32,57,.5); }
.builder-dialog { width:min(580px,calc(100vw - 28px)); max-height:min(740px,calc(100dvh - 30px)); padding:27px; overflow:auto; }
.builder-top { display:flex; justify-content:space-between; align-items:flex-start; }
.builder-top h2 { margin:6px 0 0; color:#214e74; font-size:21px; }
.builder-top button { border:0; background:none; color:#6b8297; font-size:25px; cursor:pointer; }
.builder-intro { margin:13px 0 16px; color:#6a8094; font-size:12px; line-height:1.7; }
.builder-dialog label { display:block; margin:13px 0 6px; font-size:12px; font-weight:700; }
.builder-dialog input,.builder-dialog select,.builder-dialog textarea { width:100%; padding:10px 11px; border:1px solid #d6e3ef; border-radius:8px; background:#fff; color:#294a67; font:inherit; font-size:12px; }
.builder-dialog textarea { resize:vertical; min-height:66px; }
.builder-dialog .save-settings { margin-top:18px; }
@media(max-width:1180px) { .library-panel { top:92px; } }
@media(max-width:700px) {
  .institution-bar { height:69px; padding:6px 14px; }
  .institution-bar img { height:55px; max-width:70vw; }
  .institution-product { padding-left:9px; }
  .institution-product strong { font-size:13px; }
  .institution-product span { display:none; }
  .app { height:calc(100dvh - 69px); min-height:0; }
  .auth-screen { min-height:calc(100dvh - 69px); }
  .library-panel { top:69px; }
  .library-backdrop { top:69px; }
  #settingsBtn { display:inline-block; }
  .header-chip,.account-name { display:none; }
  .main-header { min-height:58px; }
  .header-right { gap:5px; }
  .header-action,.logout-btn { padding:6px; font-size:10px; }
  .breadcrumb span,.breadcrumb svg { display:none; }
}
@media(max-width:430px) {
  .institution-product { display:none; }
  .institution-bar img { max-width:100%; }
  .header-right #exportBtn { max-width:44px; overflow:hidden; }
  .composer-heading>div { gap:7px; }
}
