:root {
  font-family: "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: #25332e;
  background: #f4f6f4;
  --el-color-primary: #39735b;
  --el-color-primary-light-3: #6c9d87;
  --el-color-primary-light-5: #9ab9a9;
  --el-color-primary-light-7: #c1d5c8;
  --el-color-primary-light-8: #d4e2d8;
  --el-color-primary-light-9: #edf4ef;
  --el-color-primary-dark-2: #2c5c47;
  --el-border-radius-base: 5px;
  --el-font-family: "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.auth-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: #f4f6f4; }
.auth-content { width: min(100%, 360px); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; color: #263c33; font-size: 19px; }
.auth-brand img { width: 48px; height: 48px; object-fit: contain; }
.auth-brand small { color: #839387; font-size: 12px; font-weight: 400; }
.auth-content h1 { margin: 0 0 24px; font-size: 21px; }
.auth-notice { color: #65796b; font-size: 13px; line-height: 1.6; }
.auth-submit { width: 100%; }
.app-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.app-shell.nav-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
.navigation { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 22px 12px 14px; background: #263c33; color: #e7f0e9; }
.nav-brand { display: flex; align-items: center; gap: 10px; min-height: 38px; margin: 0 6px 38px; font-size: 17px; font-weight: 700; white-space: nowrap; }
.nav-brand small { color: #a9bcaf; font-size: 11px; font-weight: 400; }
.brand-mark { width: 36px; height: 36px; object-fit: contain; }
.nav-caption { margin: 0 12px 10px; color: #93a99a; font-size: 11px; }
.nav-links { display: grid; gap: 4px; }
.nav-links button { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; color: #c5d5c9; text-align: left; font-size: 13px; }
.nav-links button:hover { background: #365047; }
.nav-links button.active { background: #d8eab9; color: #233c2e; font-weight: 700; }
.ui-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 18px; font-size: 18px; }
.nav-bottom { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: auto; padding: 14px 5px 0; border-top: 1px solid #496054; }
.nav-local { color: #a7b8ad; font-size: 11px; white-space: nowrap; }
.nav-toggle { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #496054; border-radius: 5px; background: transparent; color: #d2dfd4; }
.nav-utility { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid #496054; border-radius: 5px; background: transparent; color: #d2dfd4; }
.nav-utility:hover, .nav-toggle:hover { background: #365047; }
.mobile-nav-trigger, .mobile-nav-close, .mobile-nav-backdrop { display: none; }
.nav-collapsed .nav-links button { justify-content: center; padding: 0; }
.workspace { min-width: 0; padding: 26px 32px; }
.workspace-view { max-width: 1500px; margin: 0 auto; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.toolbar-title { display: flex; align-items: center; gap: 9px; color: #27392f; font-size: 15px; font-weight: 700; white-space: nowrap; }
.toolbar-title span { padding: 2px 7px; border-radius: 4px; background: #e6eee6; color: #667e6b; font-size: 11px; }
.toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.toolbar-actions .el-button + .el-button { margin-left: 0; }
.search-input { width: 210px; }
.tag-filter { width: 140px; }
.role-tag-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 16px; }
.role-tag-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; max-width: 100%; padding: 4px 10px; border: 1px solid #dce6dd; border-radius: 5px; background: #fff; color: #526558; font-size: 12px; overflow-wrap: anywhere; }
.role-tag-filter:hover { border-color: #9ab9a9; }
.role-tag-filter.active { border-color: #39735b; background: #edf4ef; color: #2c5c47; }
.role-tag-filter:focus-visible { outline: 2px solid #39735b; outline-offset: 2px; }
.role-tag-count { flex-shrink: 0; color: #829187; font-size: 11px; }
.role-tag-filter.active .role-tag-count { color: #39735b; }
.el-button .ui-icon { margin-right: 5px; }
.workspace-table { width: 100%; border: 1px solid #e4ebe4; }
.workspace-table .el-table__header th { background: #f8faf8; color: #708074; font-weight: 600; }
.workspace-table .el-table__cell { padding: 10px 0; }
.workspace-table .el-button.is-link { max-width: 100%; white-space: normal; text-align: left; }
.mobile-records { display: none; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr)); gap: 14px; }
.role-card { display: flex; flex-direction: column; min-width: 0; min-height: 190px; padding: 16px; border: 1px solid #e2eae2; border-radius: 6px; background: #fff; }
.role-card-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.role-card-identity { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.role-card-name { display: -webkit-box; max-width: 100%; overflow: hidden; color: #293c31; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.role-card-tag { max-width: 100%; overflow: hidden; color: #718778; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.role-card-description { display: -webkit-box; flex: 1; min-height: 54px; margin: 14px 0; overflow: hidden; color: #738277; font-size: 12px; line-height: 18px; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.role-card-actions { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; border-top: 1px solid #eff3ef; }
.role-card-actions .el-button + .el-button { margin-left: 0; }
.pagination-bar { display: flex; justify-content: flex-end; margin-top: 16px; }
.error-alert { margin-bottom: 14px; }
.entity-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.entity-name strong { overflow-wrap: anywhere; }
.el-avatar { flex-shrink: 0; background: #edf2e9; color: #728c70; }
.el-dialog { max-width: calc(100vw - 32px); border-radius: 8px; }
.el-dialog__body { max-height: calc(100vh - 190px); overflow-y: auto; }
.el-form-item { margin-bottom: 17px; }
.el-form-item__label { font-weight: 600; }
.field-hint { margin: 6px 0; color: #8a988d; font-size: 12px; }
.el-form-item .field-hint { margin-left: 10px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; color: #34483a; font-size: 13px; }
.section-heading span { color: #8a988d; font-size: 12px; font-weight: 400; }
.detail-models { display: flex; flex-wrap: wrap; gap: 6px; }
.management-details .el-descriptions__label { white-space: nowrap; }
.management-details .el-descriptions__content { overflow-wrap: anywhere; }
.prompt-detail { white-space: pre-wrap; overflow-wrap: anywhere; }
.model-list { max-height: 260px; overflow-y: auto; border: 1px solid #e4ebe4; border-radius: 5px; }
.model-option { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #edf2ed; }
.model-option:last-child { border-bottom: 0; }
.model-name { flex: 1 1 180px; min-width: 0; overflow: hidden; }
.model-name .el-checkbox__label { overflow: hidden; text-overflow: ellipsis; }
.token-field { display: flex; align-items: center; gap: 5px; color: #728074; font-size: 11px; white-space: nowrap; }
.token-field .el-input { width: 92px; }
.model-empty { padding: 15px; color: #909d92; font-size: 12px; }
.add-model { display: flex; gap: 8px; }
.avatar-section { width: 100%; }
.avatar-editor { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.upload-button { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 12px; border: 1px solid #dcdfe6; border-radius: 4px; color: #606266; cursor: pointer; }
.upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-button.disabled { opacity: .5; cursor: not-allowed; }
.avatar-editor .ph-shuffle { margin-right: 5px; }
.participants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.participant-setup { min-width: 0; padding: 14px; border: 1px solid #e4ebe4; border-radius: 6px; }
.participant-setup .el-form-item:last-child { margin-bottom: 0; }
.participant-setup .el-select { width: 100%; }
.participant-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; font-size: 13px; }
.group-participants { margin-bottom: 16px; border-top: 1px solid #e9eeea; }
.group-participant-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 32px; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #e9eeea; }
.group-participant-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12px; white-space: nowrap; }
.group-participant-row .el-select { min-width: 0; width: 100%; }
.group-participant-row > .el-button:last-child { width: 32px; margin: 0; padding: 0; }
.group-participant-row > .el-button:last-child .ui-icon { margin-right: 0; }
.role-picker-trigger { width: 100%; justify-content: space-between; }
.role-picker-trigger span { overflow: hidden; text-overflow: ellipsis; }
.role-picker-filters { display: flex; gap: 8px; margin-bottom: 12px; }
.role-picker-filters .el-select { flex: 0 0 145px; }
.role-picker-list { max-height: min(480px, 50vh); overflow-y: auto; border-top: 1px solid #e9eeea; }
.role-option { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 4px; border: 0; border-bottom: 1px solid #edf1ec; background: #fff; color: #25332e; text-align: left; }
.role-option:disabled { opacity: .45; cursor: not-allowed; }
.role-option:not(:disabled):hover { background: #f3f7f2; }
.role-option-content { flex: 1; min-width: 0; }
.role-option-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.role-option-prompt { display: block; margin-top: 5px; color: #728074; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-workspace { display: flex; flex-direction: column; height: calc(100vh - 52px); min-height: 450px; }
.chat-top { padding-bottom: 10px; }
.conversation { display: flex; flex: 1; flex-direction: column; min-height: 0; background: #fff; border: 1px solid #e4ebe4; }
.conversation-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid #edf2ec; }
.conversation-header h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.session-topic { max-width: 700px; margin: 7px 0 0; color: #87968a; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.conversation-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.thinking { display: flex; align-items: center; gap: 10px; min-width: 0; color: #7d9080; font-size: 12px; overflow-wrap: anywhere; }
.thinking-dots { display: flex; gap: 4px; padding: 8px; border-radius: 5px; background: #f1f5ef; }
.thinking-dots i { width: 5px; height: 5px; border-radius: 50%; background: #8eaf80; animation: pulse 1s infinite alternate; }
.thinking-dots i:nth-child(2) { animation-delay: .2s; }
.thinking-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { to { opacity: .3; transform: translateY(-3px); } }
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 5%; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; color: #91a092; text-align: center; font-size: 13px; }
.empty-art { display: flex; align-items: center; gap: 8px; color: #8daa62; font-size: 30px; }
.empty h3 { margin: 15px 0 6px; color: #506455; font-size: 15px; }
.empty p { margin: 0; }
.message { display: flex; align-items: flex-start; gap: 12px; max-width: 850px; margin-bottom: 24px; }
.message-1 { flex-direction: row-reverse; margin-left: auto; }
.avatar { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; overflow: hidden; border-radius: 7px; background: #e6f1df; color: #648e47; }
.avatar-1 { background: #fae8df; color: #b16e58; }
.avatar-user { background: #e7edf9; color: #627ca5; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.message-body { min-width: 0; max-width: 85%; }
.message-meta { display: flex; gap: 10px; margin-bottom: 7px; font-size: 12px; }
.message-1 .message-meta { justify-content: flex-end; }
.message-meta span { color: #aab5aa; font-size: 10px; }
.bubble { padding: 14px 16px; border-radius: 5px; background: #f1f6ee; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.message-1 .bubble { background: #fff1eb; }
.message-user .bubble { background: #edf2fa; }
.pending-message { opacity: .72; }
.pending-content { white-space: pre-wrap; }
.message-composer { padding: 12px 24px; border-top: 1px solid #edf2ec; }
.composer-controls { display: flex; align-items: flex-end; gap: 10px; }
.system-settings { max-width: 640px; margin-left: 0; }
.truncated { color: #ad754e; }
.conversation-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 24px; border-top: 1px solid #edf2ec; color: #92a094; font-size: 11px; }
.message-count { flex-shrink: 0; }
.share-export { position: fixed; z-index: -1; top: 0; left: 0; width: 720px; padding: 42px 48px; background: #fff; color: #25332e; visibility: hidden; pointer-events: none; }
.share-brand { color: #39735b; font-size: 13px; font-weight: 700; }
.share-export h2 { margin: 18px 0 8px; font-size: 23px; line-height: 1.4; overflow-wrap: anywhere; }
.share-topic { margin: 0; color: #687d6f; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.share-participants { margin: 12px 0 24px; color: #8a988d; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.share-message { display: flex; align-items: flex-start; padding: 18px 0; border-top: 1px solid #edf2ec; }
.share-avatar { display: flex; align-items: center; justify-content: center; flex: 0 0 40px; width: 40px; height: 40px; overflow: hidden; border-radius: 6px; background: #edf2e9; color: #728c70; }
.share-avatar img { width: 100%; height: 100%; object-fit: cover; }
.share-message-body { flex: 1; min-width: 0; margin-left: 12px; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.share-message-meta { display: flex; align-items: baseline; margin-bottom: 7px; font-size: 13px; }
.share-message-meta span { margin-left: 10px; color: #a2aea5; font-size: 11px; }
.share-export .markdown pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.share-export .markdown pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
.share-export .markdown table { display: table; width: 100%; table-layout: fixed; }
.share-export .markdown th, .share-export .markdown td { overflow-wrap: anywhere; }
.share-footer { padding-top: 18px; border-top: 1px solid #edf2ec; color: #92a094; font-size: 12px; text-align: right; }
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown p, .markdown ul, .markdown ol, .markdown blockquote, .markdown pre { margin: 0 0 12px; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { margin: 14px 0 8px; font-size: 1.1em; line-height: 1.5; }
.markdown ul, .markdown ol { padding-left: 24px; }
.markdown blockquote { padding-left: 12px; border-left: 3px solid #abc67b; color: #66725e; }
.markdown code { padding: 2px 4px; border-radius: 3px; background: #e5ebdf; font-family: Consolas, monospace; font-size: .9em; }
.markdown pre { overflow-x: auto; padding: 12px; border-radius: 6px; background: #27332c; color: #f4f6f1; }
.markdown pre code { padding: 0; background: transparent; white-space: pre; }
.markdown a { color: #39735b; }
.markdown img { max-width: 100%; height: auto; }
.markdown table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.markdown th, .markdown td { padding: 5px 10px; border: 1px solid #cbd6c3; }
@media (max-width: 700px) {
  .app-shell, .app-shell.nav-collapsed { grid-template-columns: minmax(0, 1fr); }
  .navigation { position: fixed; z-index: 102; top: 0; left: 0; width: min(216px, 85vw); height: 100dvh; padding: 20px 12px 14px; visibility: hidden; transform: translateX(-100%); transition: transform .18s ease; }
  .mobile-nav-open .navigation { visibility: visible; transform: translateX(0); }
  .mobile-nav-trigger, .mobile-nav-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid #dce5dc; border-radius: 5px; background: #fff; color: #405248; }
  .mobile-nav-trigger { position: fixed; z-index: 99; top: 12px; left: 14px; }
  .mobile-nav-close { margin-left: auto; border-color: #496054; background: transparent; color: #d2dfd4; }
  .mobile-nav-backdrop { display: block; position: fixed; z-index: 101; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: #1d302580; }
  .nav-brand { margin: 0 4px 32px; }
  .nav-toggle { display: none; }
  .nav-collapsed .nav-links button { justify-content: flex-start; padding: 0 12px; }
  .workspace { padding: 60px 14px 18px; }
  .el-input__inner, .el-textarea__inner { font-size: 16px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { justify-content: flex-start; width: 100%; }
  .search-input { flex: 1 1 100%; width: auto; }
  .desktop-table { display: none; }
  .mobile-records { display: grid; gap: 10px; }
  .mobile-record { min-width: 0; padding: 14px; border: 1px solid #e2eae2; border-radius: 6px; background: #fff; }
  .mobile-record-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; font-size: 14px; }
  .mobile-record-heading strong { min-width: 0; overflow-wrap: anywhere; }
  .mobile-record-heading .el-tag { flex-shrink: 0; max-width: 50%; }
  .mobile-record-meta { margin-top: 8px; color: #728074; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
  .mobile-record-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eff3ef; }
  .mobile-record-actions .el-button + .el-button { margin-left: 0; }
  .el-dialog { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); margin: 16px auto !important; }
  .el-dialog__body { flex: 1; min-height: 0; max-height: none; overflow-y: auto; }
  .participants { grid-template-columns: 1fr; }
  .group-participants { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .group-participants::-webkit-scrollbar { height: 6px; }
  .group-participants::-webkit-scrollbar-thumb { border-radius: 3px; background: #aebfb2; }
  .group-participant-row { min-width: 642px; grid-template-columns: 110px 150px 150px 160px 32px; }
  .role-picker-filters { flex-wrap: wrap; }
  .role-picker-filters .el-select { flex: 1 1 100%; }
  .chat-workspace { height: calc(100dvh - 78px); min-height: 0; }
  .conversation-header { align-items: flex-start; flex-wrap: wrap; padding: 16px; }
  .conversation-footer { padding: 8px 16px; }
  .thread { padding: 22px 16px; }
}
