* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #5B8DEE;
    --bg-light: #F8F9FB;
    --text-dark: #2C3E50;
    --text-light: #7F8C9B;
    --border-color: #E5E9F0;
    --card-bg: #FFFFFF;
    --sidebar-bg: #FAFBFC;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
}

.container {
    display: flex;
    height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    transition: width 0.25s ease, padding 0.25s ease;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 0;
    padding: 0;
    border-right: none;
}

.logo-section {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    height: 36px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: -0.3px;
}

.logo-nutri {
    background: linear-gradient(90deg, #6a2a51, #b37239, #de9623);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-master {
    color: #2b5329;
}

.history-section {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.history-section h3 {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-loading {
    color: var(--text-light);
    font-size: 13px;
    text-align: center;
    padding: 10px;
}

.history-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.history-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(91, 141, 238, 0.1);
}

.history-item.active {
    background: var(--primary-color);
    color: white;
}

.history-item.active .history-msg-count {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.history-msg-count {
    display: inline-block;
    background: rgba(91, 141, 238, 0.1);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
}

.knowledge-base {
    padding: 15px 20px;
    margin: 0 15px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.knowledge-base:hover {
    border-color: var(--primary-color);
}

.kb-icon {
    font-size: 20px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
}

/* 内容包装器 */
.content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
}

.new-chat-btn {
    padding: 8px 16px;
    border: 1px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.new-chat-btn:hover {
    background: var(--primary-color);
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-btn {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.lang-btn:hover {
    border-color: var(--primary-color);
}

/* 欢迎标语区域 */
.welcome-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 30px 20px;
    transition: all 0.3s ease-out;
    flex: 1;
    background:
        radial-gradient(circle at top, rgba(118, 171, 127, 0.10), transparent 42%),
        linear-gradient(180deg, #f8fbf8 0%, #ffffff 100%);
}

.welcome-section.hidden {
    max-height: 0;
    padding: 0;
    opacity: 0;
    display: none;
}

.welcome-slogan {
    max-width: 720px;
    font-size: 42px;
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.15;
    background: linear-gradient(135deg, #356b43 0%, #5a8f72 38%, #6d79c8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    text-wrap: balance;
}

/* 场景介绍 */
.scene-intro {
    position: relative;
    padding: 16px 30px 28px;
    color: white;
    transition: all 0.3s ease-out;
    overflow: hidden;
    flex-shrink: 0;
    background:
        radial-gradient(circle at 12% 18%, rgba(153, 214, 170, 0.28), transparent 24%),
        radial-gradient(circle at 85% 20%, rgba(152, 188, 255, 0.22), transparent 28%),
        linear-gradient(135deg, #6e9f78 0%, #5e90a6 42%, #6a67b7 100%);
}

.scene-intro::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.10) 0%, transparent 36%),
        radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.08), transparent 32%);
    pointer-events: none;
}

.scene-intro.hidden {
    max-height: 0;
    padding: 0 30px;
    opacity: 0;
    display: none;
}

.scene-cards {
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.scene-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 220px;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.10));
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.scene-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.32);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.12));
}

.scene-card-icon {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.20);
    box-shadow: 0 10px 30px rgba(36, 62, 52, 0.12);
}

.scene-card-icon svg {
    width: 24px;
    height: 24px;
    stroke: #f5fff7;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.scene-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scene-card-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.scene-card-desc {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(243, 249, 246, 0.88);
}

.scene-card-retrieval .scene-card-icon {
    background: linear-gradient(135deg, rgba(240, 255, 246, 0.22), rgba(160, 223, 182, 0.20));
}

.scene-card-deep .scene-card-icon {
    background: linear-gradient(135deg, rgba(236, 246, 255, 0.22), rgba(149, 193, 255, 0.18));
}

.scene-card-library .scene-card-icon {
    background: linear-gradient(135deg, rgba(245, 240, 255, 0.22), rgba(190, 171, 255, 0.18));
}

/* 聊天容器 */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 30px 30px;
    min-height: 0;
}

.chat-container:empty {
    padding: 0;
}

.message {
    margin-bottom: 25px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-user .message-content {
    background: var(--primary-color);
    color: white;
    padding: 12px 18px;
    border-radius: 18px 18px 4px 18px;
    max-width: 70%;
}

.message-assistant {
    display: flex;
    gap: 12px;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.message-body {
    flex: 1;
}

.message-content {
    background: var(--bg-light);
    padding: 15px 18px;
    border-radius: 4px 18px 18px 18px;
    line-height: 1.6;
    font-size: 14px;
    overflow-x: auto;
    min-width: 0;
}

.message-content p {
    margin-bottom: 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* 来源标签 */
.source-tag {
    display: inline-block;
    background: rgba(91, 141, 238, 0.1);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin: 0 3px;
    font-weight: 500;
}

/* ===== Markdown 渲染样式 ===== */
.markdown-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-dark);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    overflow-x: auto;
}

.markdown-body > *:first-child {
    margin-top: 0;
}

.markdown-body > *:last-child {
    margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-dark);
}

.markdown-body h1 { font-size: 1.4em; }
.markdown-body h2 { font-size: 1.25em; }
.markdown-body h3 { font-size: 1.1em; }
.markdown-body h4 { font-size: 1em; }

.markdown-body h2 {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.markdown-body p {
    margin-bottom: 12px;
}

.markdown-body strong {
    font-weight: 600;
    color: #1a2a3a;
}

.markdown-body em {
    font-style: italic;
}

.markdown-body ul,
.markdown-body ol {
    margin-bottom: 12px;
    padding-left: 24px;
}

.markdown-body li {
    margin-bottom: 4px;
}

.markdown-body li > p {
    margin-bottom: 4px;
}

.markdown-body li > ul,
.markdown-body li > ol {
    margin-top: 4px;
    margin-bottom: 4px;
}

.markdown-body code {
    background: rgba(91, 141, 238, 0.08);
    color: #c7254e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.markdown-body pre {
    background: #f6f8fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
    overflow-x: auto;
}

.markdown-body pre code {
    background: none;
    color: var(--text-dark);
    padding: 0;
    border-radius: 0;
    font-size: 13px;
    line-height: 1.5;
}

.markdown-body blockquote {
    margin: 0 0 12px 0;
    padding: 8px 16px;
    border-left: 4px solid var(--primary-color);
    background: rgba(91, 141, 238, 0.04);
    color: var(--text-light);
    border-radius: 0 6px 6px 0;
}

.markdown-body blockquote p {
    margin-bottom: 0;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 12px;
    font-size: 13px;
    display: block;
    overflow-x: auto;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}

.markdown-body th {
    background: #f6f8fa;
    font-weight: 600;
    color: var(--text-dark);
}

.markdown-body tr:nth-child(even) {
    background: #fafbfc;
}

.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

.markdown-body a {
    color: var(--primary-color);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body .citation-link {
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
}

.markdown-body .citation-link:hover {
    text-decoration: underline;
}

.markdown-body img {
    max-width: 100%;
    border-radius: 6px;
}

.sources-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.sources-title {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.sources-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.source-item {
    font-size: 12px;
    color: var(--text-light);
    padding: 8px 12px;
    background: rgba(91, 141, 238, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.source-item strong {
    color: var(--text-dark);
}

/* 参考文献区域 */
.references-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.references-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.references-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ref-item {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.6;
    padding: 2px 0;
    scroll-margin-top: 80px;
    border-radius: 4px;
}

.ref-item:target {
    background: rgba(91, 141, 238, 0.12);
    color: var(--text-dark);
}

.ref-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.ref-item a:hover {
    text-decoration: underline;
}

.feedback-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-light);
}

.feedback-btn {
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    color: var(--text-dark);
}

.feedback-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.feedback-thanks {
    color: var(--primary-color);
}

.feedback-error {
    color: #D64545;
}

.ref-gene {
    font-weight: 600;
    color: var(--text-dark);
    font-style: italic;
}

/* 输入区域 */
.input-section {
    padding: 24px 30px 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfa 100%);
    flex-shrink: 0;
}

.input-container {
    max-width: 1080px;
    margin: 0 auto;
    background: var(--bg-light);
    border: 1px solid rgba(93, 130, 110, 0.16);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.2s;
    box-shadow: 0 18px 45px rgba(88, 109, 95, 0.08);
}

.input-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 141, 238, 0.1);
}

#query-input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 120px;
    line-height: 1.5;
}

.input-actions {
    display: flex;
    align-items: center;
    margin-top: 12px;
    gap: 8px;
}

.action-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.attach-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    margin-left: auto;
    margin-right: 10px;
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: auto;
}

.send-btn:hover {
    background: #4A7DD7;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

/* 停止生成按钮样式 */
.send-btn.stop-mode {
    background: #e74c3c;
    font-size: 14px;
    animation: stop-pulse 1.5s ease-in-out infinite;
}

.send-btn.stop-mode:hover {
    background: #c0392b;
    transform: scale(1.05);
}

@keyframes stop-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
}

/* "已停止生成"提示 */
.generation-stopped {
    color: var(--text-light, #999);
    font-size: 12px;
    margin-top: 10px;
    padding: 4px 0;
    border-top: 1px dashed var(--border-color, #e0e0e0);
    opacity: 0.8;
}

/* "回到底部"悬浮按钮 */
.scroll-to-bottom-btn {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color, #e0e0e0);
    background: var(--bg-color, #fff);
    color: var(--text-color, #333);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 10;
}

.scroll-to-bottom-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.scroll-to-bottom-btn:hover {
    background: var(--primary-color, #5B8DEF);
    color: #fff;
    border-color: var(--primary-color, #5B8DEF);
}

/* 加载动画 */
.loading-dots {
    display: inline-block;
}

.loading-dots span {
    animation: blink 1.4s infinite both;
    font-size: 20px;
    margin: 0 2px;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}
/* Cache buster: 1774754390 */

/* ===== 知识库模态窗口 ===== */
.kb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
}

.kb-modal {
    background: white;
    border-radius: 16px;
    width: 520px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.2s ease-out;
}

.kb-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.kb-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.kb-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-light);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.kb-modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.kb-modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.kb-upload-area {
    margin-bottom: 20px;
}

.kb-upload-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.kb-upload-btn:hover {
    background: #4A7DD7;
}

.kb-upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.kb-upload-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.3s;
}

.kb-upload-status {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
}

.kb-empty {
    text-align: center;
    color: var(--text-light);
    font-size: 13px;
    padding: 30px 0;
}

.kb-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.kb-file-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(91, 141, 238, 0.08);
}

.kb-file-info {
    flex: 1;
    min-width: 0;
}

.kb-file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kb-file-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 3px;
}

.kb-file-actions {
    display: flex;
    gap: 4px;
    margin-left: 10px;
    flex-shrink: 0;
}

.kb-action-btn {
    background: none;
    border: none;
    font-size: 15px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.kb-action-btn:hover {
    background: var(--bg-light);
}

.kb-badge {
    background: var(--primary-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: auto;
}

/* ===== 搜索进度指示器 ===== */
.search-progress {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
}

.search-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: deep-spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* ===== 工具调用摘要 ===== */
.tool-calls-summary {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

/* 实时状态（streaming 阶段） */
.tool-calls-live .tool-call-line {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--bg-secondary, #F0F4F8);
    color: var(--text-light);
}

.tool-badge-skill {
    background: #EDE9FE;
    color: #7C3AED;
}

.tool-badge-active {
    background: #EEF2FF;
    color: var(--primary-color);
}

.tool-badge-active .search-spinner {
    width: 10px;
    height: 10px;
    border-width: 1.5px;
}

/* 完成后的可折叠摘要 */
.tool-calls-header {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--bg-secondary, #F0F4F8);
    user-select: none;
    transition: background 0.15s;
}

.tool-calls-header:hover {
    background: var(--border-color, #E5E9F0);
}

.tool-calls-header-text {
    flex: 1;
    font-size: 12px;
    color: var(--text-light);
}

.tool-calls-toggle {
    font-size: 10px;
    color: var(--text-light);
    transition: transform 0.2s;
}

.tool-calls-summary.expanded .tool-calls-toggle {
    transform: rotate(90deg);
}

.tool-calls-detail {
    display: none;
    padding: 6px 8px 4px;
    font-size: 11px;
    color: var(--text-light);
}

.tool-calls-summary.expanded .tool-calls-detail {
    display: block;
}

.tool-call-item {
    padding: 2px 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.tool-call-name {
    font-weight: 600;
    color: var(--primary-color);
}

.tool-call-args {
    font-family: monospace;
    font-size: 10px;
    color: #94A3B8;
    word-break: break-all;
}

.tool-call-result {
    width: 100%;
    margin-top: 6px;
}

/* ===== 思考过程 ===== */
.thinking-container {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: #FEFCE8;
    overflow: hidden;
}

.thinking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
    background: #FEF9C3;
    transition: background 0.2s;
}

.thinking-header:hover {
    background: #FEF08A;
}

.thinking-header-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: #854D0E;
}

.thinking-toggle {
    font-size: 10px;
    color: #A16207;
    transition: transform 0.2s;
}

.thinking-container.expanded .thinking-toggle {
    transform: rotate(90deg);
}

.thinking-content {
    display: none;
    padding: 8px 10px;
    font-size: 11px;
    color: #713F12;
    background: #FFFBEB;
    max-height: 300px;
    overflow-y: auto;
}

.thinking-container.expanded .thinking-content {
    display: block;
}

.thinking-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.5;
}

.tool-call-result summary {
    cursor: pointer;
    color: var(--primary-color);
    font-size: 11px;
    user-select: none;
}

.tool-call-result pre {
    margin-top: 6px;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f6f8fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    color: var(--text-dark);
    font-size: 11px;
    line-height: 1.5;
}

/* ===== 来源类型标签 ===== */
.source-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
}

.badge-gene {
    background: rgba(91, 141, 238, 0.12);
    color: #4A7DD7;
}

.badge-pubmed {
    background: rgba(46, 204, 113, 0.12);
    color: #27AE60;
}

.badge-web {
    background: rgba(243, 156, 18, 0.12);
    color: #E67E22;
}

.badge-personal {
    background: rgba(155, 89, 182, 0.12);
    color: #8E44AD;
}

/* ===== 登录/注册覆盖层样式（新增） ===== */

/* 全屏遮罩 */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* 双栏分割布局 */
.auth-split {
    display: flex;
    width: 760px;
    max-width: 95vw;
    min-height: 480px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.25s ease-out;
}

/* 左侧欢迎面板 */
.auth-welcome {
    flex: 1;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 36px;
}

.auth-welcome-inner {
    max-width: 280px;
}

.auth-logo-large {
    margin-bottom: 24px;
}

.auth-logo-large .auth-logo-icon {
    height: 48px;
}

.auth-logo-large .auth-logo-text {
    font-size: 24px;
}

.auth-logo-large .logo-nutri {
    background: linear-gradient(90deg, #fff, #f0d0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo-large .logo-master {
    color: #e0f0e0;
}

.auth-tagline {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 28px;
    line-height: 1.5;
}

.auth-features {
    list-style: none;
    padding: 0;
}

.auth-features li {
    font-size: 14px;
    opacity: 0.85;
    padding: 6px 0;
    padding-left: 22px;
    position: relative;
}

.auth-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    font-weight: 700;
    opacity: 0.7;
}

/* 右侧表单面板 */
.auth-form-side {
    flex: 1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 36px;
}

.auth-form-side .auth-card {
    width: 100%;
    max-width: 320px;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

/* 登录卡片 */
.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Logo */
.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
}

.auth-logo-icon {
    height: 52px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.auth-logo-text {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* Tab 切换 */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 10px 0;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-tab:hover {
    color: var(--primary-color);
}

/* 错误提示 */
.auth-error {
    background: #FFF3F3;
    color: #E74C3C;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    border: 1px solid #FDDEDE;
}

/* 表单 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form input {
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 141, 238, 0.1);
}

/* 提交按钮 */
.auth-submit-btn {
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}

.auth-submit-btn:hover {
    background: #4A7DD7;
}

.auth-submit-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

/* 验证码表单 */
.verify-info {
    text-align: center;
    margin-bottom: 4px;
}

.verify-info p {
    color: var(--text-light);
    font-size: 14px;
    margin: 0;
}

.verify-info .verify-email {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
    margin-top: 4px;
    word-break: break-all;
}

#verify-code-input {
    text-align: center;
    font-size: 24px !important;
    letter-spacing: 8px;
    font-family: 'Courier New', monospace !important;
    padding: 14px 16px !important;
}

.verify-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 4px;
}

.verify-link-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
}

.verify-link-btn:hover {
    text-decoration: underline;
}

.verify-link-btn:disabled {
    color: var(--text-light);
    cursor: not-allowed;
    text-decoration: none;
}

/* 用户信息弹出框 */
.user-popover {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    min-width: 240px;
    z-index: 999;
}

.popover-email {
    font-size: 13px;
    color: var(--text-dark);
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    word-break: break-all;
}

.popover-logout-btn {
    width: 100%;
    padding: 8px 0;
    background: none;
    border: 1px solid #E74C3C;
    color: #E74C3C;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.popover-logout-btn:hover {
    background: #E74C3C;
    color: white;
}

/* ===== 用户弹窗 - 资料编辑区域 ===== */
.popover-profile-section {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.popover-avatar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.popover-avatar-preview {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}

.popover-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.popover-avatar-change {
    font-size: 12px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 4px 10px;
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    transition: all 0.2s;
}

.popover-avatar-change:hover {
    background: var(--primary-color);
    color: white;
}

.popover-nickname-row {
    margin-bottom: 10px;
}

.popover-nickname-row input {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.popover-nickname-row input:focus {
    border-color: var(--primary-color);
}

.popover-save-btn {
    width: 100%;
    padding: 7px 0;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.popover-save-btn:hover {
    background: #4A7DD7;
}

.popover-save-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.popover-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popover-delete-btn {
    width: 100%;
    padding: 8px 0;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.popover-delete-btn:hover {
    border-color: #E74C3C;
    color: #E74C3C;
}

/* 深度搜索 - 按钮激活态（也用于个人库按钮） */
.action-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.action-btn.active:hover {
    background: #4A7DD7;
    border-color: #4A7DD7;
    color: white;
}

/* 深度搜索加载指示器 */
.deep-search-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
}

.deep-search-indicator::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: deep-spin 0.8s linear infinite;
}

@keyframes deep-spin {
    to { transform: rotate(360deg); }
}

/* ===== 头部用户区域 ===== */
.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 12px 4px 4px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.2s;
}

.user-area:hover {
    border-color: var(--primary-color);
    background: rgba(91, 141, 238, 0.04);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    line-height: 1;
}

.user-nickname {
    font-size: 13px;
    color: var(--text-dark);
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 管理后台按钮 ===== */
.admin-btn {
    padding: 8px 15px;
    border: 1px solid #E67E22;
    background: white;
    color: #E67E22;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.admin-btn:hover {
    background: #E67E22;
    color: white;
}

/* ===== 管理后台 iframe 覆盖层 ===== */
.admin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 950;
    display: flex;
    flex-direction: column;
}

.admin-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--sidebar-bg);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    flex-shrink: 0;
}

.admin-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.admin-close-btn:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.admin-iframe {
    flex: 1;
    width: 100%;
    border: none;
}

/* ===== 注册头像选择器 ===== */
.avatar-picker {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar-preview {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview-placeholder {
    font-size: 12px;
    color: var(--text-light);
}

.avatar-upload-label {
    font-size: 13px;
    color: var(--primary-color);
    cursor: pointer;
    padding: 6px 14px;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    transition: all 0.2s;
}

.avatar-upload-label:hover {
    background: var(--primary-color);
    color: white;
}

/* ===== 头部头像支持图片模式 ===== */
.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ===== 响应式：窄屏登录页转单列 ===== */
@media (max-width: 680px) {
    .auth-split {
        flex-direction: column;
        min-height: auto;
    }
    .auth-welcome {
        padding: 32px 24px 24px;
    }
    .auth-features {
        display: none;
    }
}

/* ===== CRISPR 实验方案生成 ===== */

/* 生成实验方案按钮 */
.experiment-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.experiment-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.experiment-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 进度步骤容器 */
.experiment-progress {
    margin-top: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.experiment-progress-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

/* 单个步骤 */
.experiment-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-light);
    transition: color 0.2s;
}

.experiment-step.active {
    color: var(--primary-color);
    font-weight: 500;
}

.experiment-step.done {
    color: #27AE60;
}

.experiment-step.error {
    color: #E74C3C;
}

/* 步骤图标 */
.step-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
    color: var(--text-light);
    background: white;
    transition: all 0.2s;
}

.experiment-step.active .step-icon {
    border-color: var(--primary-color);
    color: var(--primary-color);
    animation: deep-spin 0.8s linear infinite;
}

.experiment-step.done .step-icon {
    border-color: #27AE60;
    background: #27AE60;
    color: white;
    animation: none;
}

.experiment-step.error .step-icon {
    border-color: #E74C3C;
    background: #E74C3C;
    color: white;
    animation: none;
}

/* SOP 文档展示区域 */
.experiment-sop {
    margin-top: 16px;
    border-left: 4px solid #2563eb;
    background: #f8fafc;
    border-radius: 0 10px 10px 0;
    overflow: hidden;
}

.experiment-sop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(124, 58, 237, 0.08));
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.experiment-sop-header:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(124, 58, 237, 0.12));
}

.experiment-sop-title {
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
}

.experiment-sop-toggle {
    font-size: 12px;
    color: var(--text-light);
    transition: transform 0.2s;
}

.experiment-sop-header.expanded .experiment-sop-toggle {
    transform: rotate(180deg);
}

.experiment-sop-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.experiment-sop-body.expanded {
    /* SOP 内容可能很长（500+ 行），需要足够大的 max-height 避免截断 */
    max-height: 50000px;
    overflow-y: auto;
}

.experiment-sop-content {
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-dark);
    white-space: normal;
    font-family: inherit;
    overflow-x: auto;
    max-width: 100%;
}

.experiment-sop-content.markdown-body h2,
.experiment-sop-content.markdown-body h3,
.experiment-sop-content.markdown-body h4 {
    margin-top: 12px;
    margin-bottom: 4px;
}

.experiment-sop-content.markdown-body h2 {
    margin-top: 16px;
}

.experiment-sop-content.markdown-body p {
    margin-bottom: 6px;
}

.experiment-sop-content.markdown-body ul,
.experiment-sop-content.markdown-body ol {
    margin-bottom: 6px;
}

.experiment-sop-content.markdown-body li {
    margin-bottom: 2px;
}

.experiment-sop-content.markdown-body pre {
    margin-bottom: 8px;
    padding: 10px 14px;
}

.experiment-sop-content.markdown-body blockquote {
    margin: 4px 0 8px 0;
    padding: 6px 12px;
}

.experiment-sop-content.markdown-body table {
    margin-bottom: 8px;
}

.experiment-sop-content.markdown-body hr {
    margin: 10px 0;
}


/* ===== 基因编辑器（Gene Editor） ===== */
/* 用户可在此区域查看/添加/删除基因，然后点击 SOP 按钮生成实验方案 */

/* 触发区域容器（包裹基因编辑器 + SOP 按钮） */
.experiment-trigger-area {
    margin-top: 16px;
}

/* 基因编辑器外层容器 */
.gene-editor {
    margin-bottom: 12px;
    padding: 12px 16px;
    background: #f0f7ff;
    border-radius: 8px;
    border: 1px solid #d0e3ff;
}

/* "检测到以下可编辑基因：" 标签文字 */
.gene-editor-label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
    font-weight: 500;
}

/* 基因芯片容器（flex 布局，允许换行） */
.gene-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* 单个基因芯片（药丸形状） */
.gene-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: white;
    border: 1px solid #b8d4ff;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    color: #1e40af;
    transition: all 0.15s;
}

.gene-chip:hover {
    border-color: #7c3aed;
    background: #f5f0ff;
}

/* 基因名文字 */
.gene-chip-name {
    font-family: 'Menlo', 'Consolas', monospace;
    letter-spacing: 0.3px;
}

/* "×" 删除按钮 */
.gene-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    margin-left: 2px;
    background: none;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1;
}

.gene-chip-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* "+ 添加基因" 按钮 */
.gene-add-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: none;
    border: 1px dashed #b8d4ff;
    border-radius: 16px;
    font-size: 13px;
    color: #2563eb;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.gene-add-btn:hover {
    background: #eff6ff;
    border-color: #2563eb;
}

/* 添加基因输入框的包裹层 */
.gene-add-wrapper {
    display: inline-flex;
    align-items: center;
}

/* 基因名输入框 */
.gene-add-input {
    width: 120px;
    padding: 4px 10px;
    border: 1px solid #2563eb;
    border-radius: 16px;
    font-size: 13px;
    font-family: 'Menlo', 'Consolas', monospace;
    outline: none;
    color: #1e40af;
    background: white;
}

.gene-add-input:focus {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.gene-add-input::placeholder {
    color: #94a3b8;
    font-family: inherit;
}

/* ===== SOP 下载按钮 ===== */
.sop-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: none;
    border: 1px solid #2563eb;
    border-radius: 5px;
    font-size: 12px;
    color: #2563eb;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.sop-download-btn:hover {
    background: #2563eb;
    color: white;
}

/* ===== 响应式：欢迎页与场景卡片 ===== */
@media (max-width: 1024px) {
    .welcome-slogan {
        font-size: 36px;
        max-width: 640px;
    }

    .scene-cards {
        grid-template-columns: 1fr;
    }

    .scene-card {
        min-height: 0;
    }
}

@media (max-width: 768px) {
    .welcome-section {
        padding: 30px 20px 16px;
    }

    .welcome-slogan {
        font-size: 30px;
    }

    .input-section {
        padding: 20px 20px 10px;
    }

    .scene-intro {
        padding: 12px 20px 20px;
    }

    .scene-card-desc {
        font-size: 13px;
    }
}

/* ===== Skills 管理侧边栏按钮间距 ===== */
.skill-base {
    margin-top: 8px;
}

/* ===== Skills 管理模态窗口 ===== */
.skill-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
}

.skill-modal {
    background: white;
    border-radius: 16px;
    width: 800px;
    max-width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.2s ease-out;
}

.skill-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.skill-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.skill-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* 左侧 Skill 列表面板 */
.skill-list-panel {
    width: 260px;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 16px;
    flex-shrink: 0;
}

.skill-item {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.skill-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(91, 141, 238, 0.08);
}

.skill-item.active {
    border-color: var(--primary-color);
    background: rgba(91, 141, 238, 0.04);
}

.skill-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.skill-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Menlo', 'Consolas', monospace;
}

.skill-item-desc {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.skill-item-controls {
    display: flex;
    align-items: center;
}

.skill-mode-select {
    padding: 3px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-dark);
    background: white;
    cursor: pointer;
    outline: none;
}

.skill-mode-select:focus {
    border-color: var(--primary-color);
}

.skill-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 10px;
}

.skill-badge-shared {
    background: rgba(46, 204, 113, 0.12);
    color: #27AE60;
}

.skill-badge-private {
    background: rgba(155, 89, 182, 0.12);
    color: #8E44AD;
}

.skill-create-btn {
    width: 100%;
    padding: 10px;
    background: none;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.skill-create-btn:hover {
    border-color: var(--primary-color);
    background: rgba(91, 141, 238, 0.04);
}

/* 右侧 Skill 编辑器面板 */
.skill-editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
    min-width: 0;
}

.skill-editor-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.skill-editor-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Menlo', 'Consolas', monospace;
    outline: none;
    transition: border-color 0.2s;
}

.skill-editor-name-input:focus {
    border-color: var(--primary-color);
}

.skill-editor-name-input:disabled {
    background: var(--bg-light);
    color: var(--text-light);
}

.skill-editor-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 10px;
    white-space: nowrap;
}

.skill-editor-textarea {
    flex: 1;
    min-height: 200px;
    padding: 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.skill-editor-textarea:focus {
    border-color: var(--primary-color);
}

.skill-editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.skill-save-btn {
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.skill-save-btn:hover {
    background: #4A7DD7;
}

.skill-delete-btn {
    padding: 8px 20px;
    background: none;
    border: 1px solid #E74C3C;
    color: #E74C3C;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.skill-delete-btn:hover {
    background: #E74C3C;
    color: white;
}

/* Tools 列表区域 */
.skill-tools-section {
    padding: 12px 24px 16px;
    border-top: 1px solid var(--border-color);
}

.skill-tools-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.skill-tools-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tool-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 12px;
}

.skill-tool-name {
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Menlo', 'Consolas', monospace;
}

.skill-tool-desc {
    color: var(--text-light);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 模型选择下拉框 ===== */
.model-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-dark);
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
    max-width: 180px;
}

.model-select:hover {
    border-color: var(--primary-color);
}

.model-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(91, 141, 238, 0.1);
}

/* ===== NCBI 验证结果 ===== */
.ncbi-verify-section {
    margin-top: 16px;
    padding: 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
}

.ncbi-verify-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.ncbi-verify-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 12px;
}

.ncbi-verify-table th,
.ncbi-verify-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #d1fae5;
}

.ncbi-verify-table th {
    font-weight: 600;
    color: var(--text-dark);
    background: rgba(34, 197, 94, 0.06);
}

.ncbi-verify-table .ncbi-found td {
    color: var(--text-dark);
}

.ncbi-verify-table .ncbi-not-found td {
    color: #dc2626;
}

.ncbi-status-icon {
    font-weight: 700;
    margin-right: 4px;
}

.ncbi-verify-actions {
    display: flex;
    gap: 10px;
}

.ncbi-confirm-btn {
    padding: 8px 20px;
    background: #16a34a;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.ncbi-confirm-btn:hover {
    background: #15803d;
}

.ncbi-cancel-btn {
    padding: 8px 20px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.ncbi-cancel-btn:hover {
    border-color: #dc2626;
    color: #dc2626;
}

/* ===== SOP 提取进度 ===== */
.sop-extract-progress {
    margin-top: 12px;
}

/* ===== Skill 编辑器：描述输入框 ===== */
.skill-editor-desc-input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 12px;
}

.skill-editor-desc-input:focus {
    border-color: var(--primary-color);
}

.skill-editor-desc-input:disabled {
    background: var(--bg-light);
    color: var(--text-light);
}

/* ===== Skill 编辑器：Tools 勾选区 ===== */
.skill-editor-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.skill-editor-tools-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-right: 4px;
}

.skill-editor-tool-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    font-size: 12px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.skill-editor-tool-item:hover {
    border-color: var(--primary-color);
}

.skill-editor-tool-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.skill-editor-tool-item input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.skill-editor-tool-item span {
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 12px;
}
