/* ============================================================
   SynBio Agent — Apple-Aesthetic Design System
   Visual: frosted glass, luminous depth, SF Pro precision
   ============================================================ */

/* --- Design Tokens --- */
:root {
    --color-bg: #000000;
    --color-surface: rgba(255, 255, 255, 0.06);
    --color-surface-elevated: rgba(255, 255, 255, 0.1);
    --color-glass: rgba(255, 255, 255, 0.08);
    --color-glass-border: rgba(255, 255, 255, 0.12);
    --color-text-primary: #f5f5f7;
    --color-text-secondary: rgba(255, 255, 255, 0.7);
    --color-text-tertiary: rgba(255, 255, 255, 0.4);
    --color-accent: #0071e3;
    --color-accent-hover: #0077ed;
    --color-error: #ff3b30;
    --color-success: #34c759;

    /* Chat-specific (light mode workspace) */
    --chat-bg: #fafbfc;
    --chat-surface: #ffffff;
    --chat-border: rgba(0, 0, 0, 0.06);
    --chat-text: #1d1d1f;
    --chat-text-secondary: #86868b;
    --chat-sidebar-bg: #fafafa;
    --chat-input-bg: #f5f5f7;
    --chat-accent: #2b6cb0;
    --chat-accent-light: rgba(0, 113, 227, 0.08);
    --chat-user-bubble: linear-gradient(45deg, #2c5282, #2b6cb0);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 0.2s;
    --duration-normal: 0.35s;
    --duration-slow: 0.5s;
}

/* --- Reset --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    /* display: flex; */
    /* align-items: center; */
    /* justify-content: center; */
    background: var(--color-bg);
    color: var(--color-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    width: 100vw;
    min-height: 100vh;
    background: url('background.jpeg') center/cover no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 1.5rem 8rem 1.5rem;
    position: relative;
    overflow-x: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(0, 113, 227, 0.15) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(88, 86, 214, 0.15) 0%, transparent 40%),
        rgba(0, 0, 0, 0.2);
    z-index: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.login-page>* {
    position: relative;
    z-index: 1;
}

.login-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--color-text-primary);
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: var(--color-glass);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-glass-border);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 8px 32px rgba(0, 0, 0, 0.4);
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-content {
    background: rgba(15, 25, 50, 0.55);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.3),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.1);
    padding: 3rem 2.5rem 2.5rem 2.5rem;
    max-width: 400px;
    margin: 0 auto;
    animation: fadeUp 0.6s var(--ease-out) both;
    animation-delay: 0.1s;
}

.login-form {
    width: 100%;
    text-align: center;
}

.login-form h2 {
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 2rem;
    font-weight: 500;
    font-size: 1.25rem;
}

.login-message {
    color: var(--color-success);
    margin-bottom: 1rem;
    padding: 10px 14px;
    background: rgba(48, 209, 88, 0.1);
    border: 1px solid rgba(48, 209, 88, 0.2);
    border-radius: var(--radius-md);
    display: none;
    font-size: 0.875rem;
}

.login-form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.login-form-group input {
    width: 100%;
    height: 52px;
    padding: 0 18px;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-family: inherit;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    outline: none;
    box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.1);
}

.login-form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.login-form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 3px rgba(100, 160, 255, 0.3);
}

.login-btn {
    width: 100%;
    height: 52px;
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.75);
}

.login-btn:active {
    transform: scale(0.98);
}

.secondary-action {
    margin-top: 1.25rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.55);
}

.secondary-action a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--duration-fast);
}

.secondary-action a:hover {
    color: var(--color-accent-hover);
}

.login-error-message {
    color: var(--color-error);
    margin-top: 1rem;
    padding: 10px 14px;
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.2);
    border-radius: var(--radius-md);
    display: none;
    font-size: 0.875rem;
}

/* --- Trust Bar --- */
.trust-bar {
    text-align: center;
    width: 100%;
    padding: 0;
}

.trust-bar-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.trust-bar-label::before,
.trust-bar-label::after {
    content: '';
    flex: 1;
    max-width: 80px;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.trust-bar-label span {
    font-size: 0.7rem;
    color: var(--color-text-tertiary);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.trust-bar-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.trust-bar-logos img {
    height: 22px;
    width: auto;
    opacity: 0.55;
    filter: brightness(0) invert(1);
    transition: opacity var(--duration-normal) var(--ease-out);
}

.trust-bar-logos img:hover {
    opacity: 0.7;
}

.login-page .page-footer,
.register-page .page-footer {
    position: fixed;
    left: 50%;
    bottom: 0.5rem;
    transform: translateX(-50%);
    width: min(100%, 1100px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    padding: 0 2rem;
    z-index: 2;
}

.disclaimer {
    position: static;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    line-height: 1.7;
    padding: 0;
    max-width: 100%;
    white-space: nowrap;
}

/* ============================================================
   REGISTER PAGE
   ============================================================ */
.register-page {
    display: none;
    width: 100vw;
    min-height: 100vh;
    background: url('background.jpeg') center/cover no-repeat;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 1.5rem 8rem 1.5rem;
    position: relative;
    overflow-x: hidden;
}

.register-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(0, 113, 227, 0.15) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(88, 86, 214, 0.15) 0%, transparent 40%),
        rgba(0, 0, 0, 0.2);
    z-index: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.register-page>* {
    position: relative;
    z-index: 1;
}

.register-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.register-header {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--color-text-primary);
}

.register-header h1 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.register-logo {
    width: 64px;
    height: 64px;
    background: var(--color-glass);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-glass-border);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 8px 32px rgba(0, 0, 0, 0.4);
}

.register-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.register-content {
    background: rgba(15, 25, 50, 0.55);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.3),
        inset 0 0.5px 0 rgba(255, 255, 255, 0.1);
    padding: 3rem 2.5rem 2.5rem 2.5rem;
    max-width: 400px;
    margin: 0 auto;
    animation: fadeUp 0.6s var(--ease-out) both;
    animation-delay: 0.1s;
}

.register-form {
    width: 100%;
    text-align: center;
}

.register-form h2 {
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 2rem;
    font-weight: 500;
    font-size: 1.25rem;
}

.register-form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.register-form-group input {
    width: 100%;
    height: 52px;
    padding: 0 18px;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-family: inherit;
    transition: all 0.25s ease;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #ffffff;
    outline: none;
    box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.1);
}

.register-form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.register-form-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 0 0 3px rgba(100, 160, 255, 0.3);
}

.register-btn {
    width: 100%;
    height: 52px;
    margin-top: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
    border: none;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.register-btn:hover {
    background: rgba(255, 255, 255, 0.75);
}

.register-btn:active {
    transform: scale(0.98);
}

.register-error-message {
    color: var(--color-error);
    margin-top: 1rem;
    padding: 10px 14px;
    background: rgba(255, 69, 58, 0.1);
    border: 1px solid rgba(255, 69, 58, 0.2);
    border-radius: var(--radius-md);
    display: none;
    font-size: 0.875rem;
}

/* ============================================================
   CHAT PAGE — Light workspace (Linear-style restraint)
   ============================================================ */
.chat-container {
    display: none;
    width: 100vw;
    height: 100vh;
    background: var(--chat-bg);
}

.chat-layout {
    display: flex;
    height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 300px !important;
    /* 强制恢复宽度 */
    background-color: #f8f9fa !important;
    /* 恢复图2的浅灰色背景 */
    border-right: 1px solid #e9ecef !important;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar.collapsed {
    width: 0;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
}

.sidebar-title {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #333 !important;
    /* 强制深色文字 */
    text-transform: none !important;
    /* 取消全大写 */
    letter-spacing: normal !important;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--chat-text-secondary);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
    line-height: 1;
}

.sidebar-toggle:hover {
    background: var(--chat-border);
    color: var(--chat-text);
}

.new-chat-btn {
    margin: 15px !important;
    padding: 12px 15px !important;
    background-color: #3370b5 !important;
    /* 还原图2的蓝色 */
    color: white !important;
    border-radius: 8px !important;
    /* 还原图2的圆角，不是全圆 */
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.new-chat-btn:hover {
    background: #0077ed;
    transform: scale(1.02);
}

.new-chat-btn:active {
    transform: scale(0.97);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 6px 10px;
}

.chat-history::-webkit-scrollbar {
    width: 4px;
}

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

.history-item {
    padding: 15px 20px !important;
    /* 增加间距 */
    margin: 4px 10px !important;
    border-radius: 10px !important;
    background: transparent;
    transition: all 0.2s ease;
}

/* 鼠标悬停变浅灰 */
.history-item:hover {
    background-color: #e9ecef !important;
}

/* 激活状态（图2中的蓝色选中项） */
.history-item.active {
    background-color: #3370b5 !important;
    /* 强制蓝色背景 */
    color: #ffffff !important;
    /* 强制白色文字 */
}

.history-title {
    font-size: 0.95rem !important;
    color: inherit !important;
    /* 跟随父级颜色 */
    font-weight: 500 !important;
    margin-bottom: 0 !important;
}

.history-preview {
    display: none !important;
    /* 图2看起来只显示了标题 */
}

.history-item.active .history-preview {
    color: rgba(255, 255, 255, 0.75);
}

/* --- Bottom nav (user info / logout) --- */
.nav-bottom {
    border-top: 1px solid var(--chat-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--chat-surface);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 30px;
    height: 30px;
    background: var(--chat-accent);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 0.8rem;
    overflow: hidden;
}

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

#username-display {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--chat-text);
}

.logout-btn {
    padding: 5px 12px;
    background: transparent;
    color: var(--chat-text-secondary);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-fast);
    font-size: 0.75rem;
    font-family: inherit;
}

.logout-btn:hover {
    background: var(--chat-bg);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--chat-text);
}

/* --- Chat content wrapper --- */
.chat-content-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* --- Main chat area --- */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    background: var(--chat-bg);
}

/* --- Top nav --- */
.top-nav {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--chat-border);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 48px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-toggle-main {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--chat-text-secondary);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
    line-height: 1;
}

.sidebar-toggle-main:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--chat-text);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- Chat messages --- */
.chat-messages {
    flex: 1;
    padding: 24px 20px;
    overflow-y: auto;
    background: var(--chat-bg);
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.08);
    border-radius: 5px;
}

.message {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    animation: fadeUp 0.3s var(--ease-out) both;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.message.user .message-avatar {
    background: var(--chat-accent);
    color: white;
}

.message.bot .message-avatar {
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    line-height: 1.55;
    word-wrap: break-word;
    font-size: 0.9375rem;
}

.message.user .message-content {
    background: var(--chat-user-bubble);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.user .message-content em {
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.message.bot .message-content {
    background: var(--chat-surface);
    border: 1px solid var(--chat-border);
    border-bottom-left-radius: 4px;
    color: var(--chat-text);
}

/* --- Typing indicator --- */
.typing-indicator {
    display: none;
    padding: 12px 20px;
    color: var(--chat-text-secondary);
    font-size: 0.875rem;
}

/* --- Input area --- */
.chat-input {
    padding: 16px 20px 20px;
    background: var(--chat-surface);
    border-top: 1px solid var(--chat-border);
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
}

.message-input {
    flex: 1;
    padding: 11px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-full);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all var(--duration-fast) var(--ease-out);
    resize: none;
    max-height: 120px;
    background: var(--chat-input-bg);
    color: var(--chat-text);
    line-height: 1.4;
}

.message-input::placeholder {
    color: var(--chat-text-secondary);
}

.message-input:focus {
    border-color: var(--chat-accent);
    background: var(--chat-surface);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.send-btn {
    width: 40px;
    height: 40px;
    background: var(--chat-accent);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: #0077ed;
    transform: scale(1.06);
}

.send-btn:active:not(:disabled) {
    transform: scale(0.94);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================================
   MOLECULAR PANEL
   ============================================================ */
.molecular-panel {
    width: 400px;
    background: var(--chat-surface);
    border-left: 1px solid var(--chat-border);
    flex-direction: column;
    transition: width var(--duration-normal) var(--ease-out);
}

.molecular-panel.collapsed {
    width: 0;
    overflow: hidden;
}

.molecular-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--chat-surface);
    min-height: 56px;
}

.molecular-panel-header h3 {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--chat-text-secondary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.close-molecular-panel {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--chat-text-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast);
    line-height: 1;
}

.close-molecular-panel:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--chat-text);
}

.molecular-panel-content {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.molecular-info {
    background: var(--chat-bg);
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--chat-border);
}

.molecular-info h4 {
    margin: 0 0 8px 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--chat-text);
}

.molecular-info p {
    margin: 4px 0;
    font-size: 0.8125rem;
    color: var(--chat-text-secondary);
}

/* --- Resize handle --- */
.resize-handle {
    width: 1px;
    background: var(--chat-border);
    cursor: col-resize;
    position: relative;
    transition: background var(--duration-fast);
}

.resize-handle:hover {
    background: var(--chat-accent);
}

.resize-handle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 40px;
    background: transparent;
}

/* --- Molecular controls --- */
.molecular-controls {
    padding: 12px 16px;
    border-top: 1px solid var(--chat-border);
    display: flex;
    gap: 8px;
    background: var(--chat-surface);
}

.control-btn {
    padding: 6px 12px;
    border: 1px solid var(--chat-border);
    background: var(--chat-surface);
    color: var(--chat-text-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.control-btn:hover {
    background: var(--chat-bg);
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--chat-text);
}

/* ============================================================
   MARKDOWN CONTENT STYLES
   ============================================================ */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 10px 0 4px 0;
    font-weight: 600;
}

.message-content h1 {
    font-size: 1.25em;
}

.message-content h2 {
    font-size: 1.15em;
}

.message-content h3 {
    font-size: 1.05em;
}

.message-content h4 {
    font-size: 1em;
}

.message-content strong {
    font-weight: 600;
    color: inherit;
}

.message-content em {
    font-style: italic;
}

.message-content ul,
.message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 3px 0;
}

.message-content p {
    margin: 6px 0;
}

.message-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 5px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85em;
}

.message-content pre {
    background: #1d1d1f;
    color: #f5f5f7;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 10px 0;
    font-size: 0.85em;
}

.message-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.message-content blockquote {
    border-left: 3px solid var(--chat-accent);
    margin: 8px 0;
    padding-left: 14px;
    color: var(--chat-text-secondary);
    font-style: italic;
}

.message.user .message-content code {
    background: rgba(255, 255, 255, 0.15);
}

.message.user .message-content pre {
    background: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.95);
}

.message.user .message-content blockquote {
    border-left-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.75);
}

.message-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 8px 0;
    font-size: 0.875em;
}

.message-content th,
.message-content td {
    border: 1px solid var(--chat-border);
    padding: 6px 10px;
    text-align: left;
}

.message-content th {
    background: var(--chat-bg);
    font-weight: 600;
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.scheduled {
    background: rgba(255, 214, 10, 0.15);
    color: #b8860b;
}

.status-badge.completed {
    background: rgba(48, 209, 88, 0.12);
    color: #248a3d;
}

.status-badge.cancelled {
    background: rgba(255, 69, 58, 0.12);
    color: #d70015;
}

/* ============================================================
   UTILITY STATES
   ============================================================ */
.loading {
    text-align: center;
    padding: 24px;
    color: var(--chat-text-secondary);
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--chat-text-secondary);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.35;
}

/* --- Streaming cursor --- */
.streaming-cursor {
    animation: blink 1s infinite;
    color: gray;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.message.streaming .message-content {
    border-bottom: 2px solid rgba(0, 113, 227, 0.2);
    transition: all 0.1s;
}

/* --- File list --- */
.file-list {
    margin: 10px 0;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--chat-bg);
    border-radius: var(--radius-sm);
    margin: 4px 10px;
    font-size: 0.8125rem;
    border: 1px solid var(--chat-border);
}

.remove-file {
    background: var(--color-error);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    width: 20px;
    height: 20px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--duration-fast);
}

.remove-file:hover {
    opacity: 0.8;
}

.controls {
    display: flex;
    gap: 6px;
    margin: 10px 0;
}

.controls .control-btn {
    flex: 1;
    padding: 4px 8px;
    font-size: 0.8125rem;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeUp 0.35s var(--ease-out) both;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .molecular-panel {
        width: 340px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: absolute;
        z-index: 1000;
        height: 100%;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    }

    .user-info span {
        display: none;
    }

    .chat-messages {
        padding: 16px;
    }

    .message-content {
        max-width: 85%;
    }

    .molecular-panel {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 100vw;
        max-width: 100vw;
        z-index: 1001;
        border-left: none;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    }

    .resize-handle {
        display: none !important;
    }

    .chat-area {
        min-width: auto;
    }

    .login-container,
    .register-container {
        padding: 0 20px;
    }

    .login-content,
    .register-content {
        padding: 2rem 1.5rem;
    }

    .trust-bar-logos {
        gap: 1.25rem;
    }

    .trust-bar-logos img {
        height: 18px;
    }

    .page-footer {
        width: 100%;
        padding: 0 1rem;
    }

    .disclaimer {
        white-space: normal;
        line-height: 1.5;
    }

}

/* --- Panel state --- */
.chat-content-wrapper.panel-open .chat-area {
    /* Adjusted by JS when panel opens */
}

/* --- Chat area transition --- */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    transition: all var(--duration-normal) var(--ease-out);
}

/* ============================================================
   CHAT PAGE — 还原第一版美感 & 宽度填满
   ============================================================ */

/* --- 1. 整体布局填充 --- */
.chat-container {
    display: none;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
}

/* --- 2. 侧边栏：还原第一版清爽风格 --- */
.sidebar {
    width: 300px !important;
    background: #f8f9fa !important;
    border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-title {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #444 !important;
    letter-spacing: 0.02em;
}

/* 新建对话按钮：还原深蓝色圆角矩形 */
.new-chat-btn {
    margin: 15px 20px !important;
    padding: 12px !important;
    background: #2b6cb0 !important;
    color: #fff !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    border: none !important;
    cursor: pointer;
    transition: opacity 0.2s;
}

.new-chat-btn:hover {
    opacity: 0.9;
}

/* 历史列表：去掉生硬的白色方块，还原透明质感 */
.history-item {
    padding: 12px 18px !important;
    margin: 4px 12px !important;
    border-radius: 10px !important;
    background: transparent !important;
    /* 默认透明 */
    border: none !important;
    /* 去掉边框 */
    transition: background 0.2s;
}

.history-item:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    /* 悬停时淡淡的灰色 */
}

/* 选中项：还原第一版的蓝色背景 */
.history-item.active {
    background: #2b6cb0 !important;
    color: #ffffff !important;
}

.history-title {
    font-size: 0.9rem !important;
    color: inherit !important;
    font-weight: 500 !important;
}

.history-preview {
    display: none;
}

/* --- 3. 输入区域：还原全宽填满 --- */
.chat-input {
    padding: 20px !important;
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: center;
    max-width: none !important;
    /* 【关键】去掉 800px 限制 */
    width: 100% !important;
    /* 【关键】强制填满 */
    margin: 0 !important;
}

.message-input {
    flex: 1;
    padding: 12px 18px !important;
    background: #f3f4f6 !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    font-size: 15px;
    outline: none;
    resize: none;
    color: #1d1d1f;
}

.message-input:focus {
    background: #ffffff !important;
    border-color: #2b6cb0 !important;
    box-shadow: 0 0 0 4px rgba(43, 108, 176, 0.1);
}

/* --- 4. 聊天消息区：确保气泡美观 --- */
.chat-messages {
    background: #fafbfc !important;
}

.message-content {
    max-width: 75% !important;
    padding: 12px 18px !important;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* 用户气泡：还原蓝色渐变 */
.message.user .message-content {
    background: linear-gradient(135deg, #2c5282, #2b6cb0) !important;
    color: #ffffff !important;
    border-radius: 18px 18px 4px 18px !important;
}

/* AI气泡：干净白底 */
.message.bot .message-content {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    color: #1d1d1f !important;
    border-radius: 18px 18px 18px 4px !important;
}

/* --- 5. 底部栏还原 --- */
.nav-bottom {
    background: #ffffff !important;
    border-top: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 16px 20px !important;
}

.logout-btn {
    border: 1px solid #e0e0e0 !important;
    background: #fff !important;
    color: #666 !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
}

/* --- 6. 右侧 3D 面板 --- */
.molecular-panel {
    width: 400px !important;
    background: #ffffff !important;
    border-left: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* ============================================================
   强制修复方案：还原图2高对比度侧边栏
   ============================================================ */

/* 1. 强制侧边栏背景为浅灰白色（防止透明看不清） */
#sidebar.sidebar {
    width: 300px !important;
    background-color: #f8f9fa !important;
    border-right: 1px solid #e0e0e0 !important;
    opacity: 1 !important;
    display: flex !important;
    visibility: visible !important;
}

/* 2. 侧边栏标题颜色加深 */
.sidebar-title {
    color: #1a1a1a !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-transform: none !important;
    opacity: 1 !important;
}

/* 3. 还原“+ 新建对话”按钮颜色 */
.new-chat-btn {
    background-color: #3370b5 !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    margin: 15px !important;
    padding: 10px !important;
    height: auto !important;
    opacity: 1 !important;
}

/* 4. 历史列表项：让文字变黑，背景变白 */
.history-item {
    background-color: #ffffff !important;
    /* 非选中的列表项背景 */
    margin: 5px 10px !important;
    padding: 12px 15px !important;
    border: 1px solid #eee !important;
    border-radius: 8px !important;
    transition: none !important;
}

/* 5. 重点：历史对话的标题文字（彻底解决看不清） */
.history-title {
    color: #333333 !important;
    /* 强制深黑色文字 */
    font-size: 14px !important;
    font-weight: 500 !important;
    opacity: 1 !important;
}

/* 6. 激活/选中的对话项（还原图2的深蓝色块） */
.history-item.active {
    background-color: #3370b5 !important;
    border-color: #285a94 !important;
}

.history-item.active .history-title {
    color: #ffffff !important;
    /* 选中的时候文字变白 */
}

/* 7. 底部用户信息和注销按钮（图2样式） */
.nav-bottom {
    background: #ffffff !important;
    border-top: 1px solid #ddd !important;
    color: #333 !important;
}

#username-display {
    color: #333 !important;
    font-weight: 600 !important;
}

.logout-btn {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #666 !important;
    border-radius: 20px !important;
    padding: 5px 15px !important;
}

/* 8. 强制显示滚动条（防止列表太长滑不动） */
.chat-history::-webkit-scrollbar {
    width: 6px !important;
    display: block !important;
}

.chat-history::-webkit-scrollbar-thumb {
    background: #ccc !important;
    border-radius: 10px !important;
}

/* ============================================================
   布局对齐：强制顶栏与底栏线条水平对齐
   ============================================================ */

/* 1. 统一所有顶栏高度与边框 */
.sidebar-header,
.top-nav,
.molecular-panel-header {
    height: 56px !important;
    min-height: 56px !important;
    padding: 0 20px !important;
    display: flex !important;
    align-items: center !important;
    background: #ffffff !important;
    /* 顶栏统一为纯白 */
    border-bottom: 1px solid #e9ecef !important;
    /* 线条颜色一致 */
    box-shadow: none !important;
}

/* 2. 统一底栏线条对齐 */
.nav-bottom,
.chat-input,
.molecular-controls {
    border-top: 1px solid #e9ecef !important;
    background: #ffffff !important;
}

/* ============================================================
   侧边栏样式：完全还原图 2
   ============================================================ */

.sidebar {
    width: 300px !important;
    background: #f8f9fa !important;
    border-right: 1px solid #e9ecef !important;
}

/* 侧边栏标题样式 */
.sidebar-title {
    font-size: 1rem !important;
    font-weight: 500 !important;
    color: #333 !important;
    text-transform: none !important;
}

/* + 新建对话按钮还原 */
.new-chat-btn {
    margin: 15px 12px !important;
    padding: 10px !important;
    background: #3370b5 !important;
    /* 图2的深蓝色 */
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    /* 稍微方一点的圆角 */
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    cursor: pointer;
    text-align: center;
}

/* 历史项目列表还原 */
.chat-history {
    padding: 0 5px !important;
}

.history-item {
    padding: 12px 15px !important;
    margin: 2px 8px !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: #444 !important;
    border: none !important;
    transition: background 0.2s ease;
}

/* 鼠标悬停样式 */
.history-item:hover {
    background: #eceef1 !important;
    /* 图2中悬停的浅灰色 */
}

/* 选中项（Active）样式 - 完全还原图2蓝色 */
.history-item.active {
    background: #3370b5 !important;
    color: #ffffff !important;
}

.history-title {
    font-size: 0.95rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 隐藏不必要的预览文字 */
.history-preview {
    display: none !important;
}

/* 侧边栏底部用户信息还原 */
.nav-bottom {
    padding: 12px 15px !important;
    height: 60px !important;
}

.user-info {
    gap: 12px !important;
}

#username-display {
    color: #333 !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
}

/* 注销按钮还原为图2的小胶囊样式 */
.logout-btn {
    padding: 4px 12px !important;
    border: 1px solid #ddd !important;
    background: white !important;
    color: #666 !important;
    border-radius: 15px !important;
    font-size: 0.85rem !important;
}

/* ============================================================
   输入区域：保持全宽填满
   ============================================================ */
.input-container {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 10px !important;
}

.message-input {
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 12px 18px !important;
}

/* 消息气泡还原 */
.message.user .message-content {
    background: #3370b5 !important;
    border-radius: 18px 18px 4px 18px !important;
}

.message.bot .message-content {
    background: #ffffff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 18px 18px 18px 4px !important;
}

/* ============================================================
   强制底部对齐修正方案
   ============================================================ */

/* 1. 统一所有底部容器：强制高度一致、线条一致 */
.nav-bottom,
.chat-input,
.molecular-controls {
    height: 82px !important;
    /* 设定固定高度，确保线条在同一水平线上 */
    min-height: 82px !important;
    max-height: 82px !important;
    padding: 0 20px !important;
    /* 统一内边距 */
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    /* 内部元素垂直居中 */
    border-top: 1px solid #e9ecef !important;
    /* 统一线条颜色 */
    background-color: #ffffff !important;
    box-sizing: border-box !important;
}

/* 2. 修正父容器，确保各列底部锚点一致 */
.sidebar,
.main-chat,
.molecular-panel {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    /* 确保每一列都是全屏高度 */
}

/* 3. 让中间的消息区域自动填充剩余空间，把输入框压到最底下 */
.chat-messages,
.chat-history,
.molecular-panel-content {
    flex: 1 !important;
    overflow-y: auto !important;
}

/* ============================================================
   历史对话项目样式（精确匹配图 2）
   ============================================================ */

.chat-history {
    padding: 10px 8px !important;
}

.history-item {
    padding: 12px 16px !important;
    margin-bottom: 2px !important;
    /* 紧凑排列 */
    border-radius: 8px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    display: block !important;
    transition: background 0.2s ease;
}

/* 图 2 悬停效果：浅灰色 */
.history-item:hover {
    background: #f0f2f5 !important;
}

/* 图 2 选中效果：深蓝色背景，白色文字 */
.history-item.active {
    background: #3370b5 !important;
    color: #ffffff !important;
}

.history-title {
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    color: inherit !important;
    /* 激活时随父级变白 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 隐藏 Apple 风格多余的预览文字 */
.history-preview {
    display: none !important;
}

/* 4. 输入框容器内部微调 */
.input-container {
    width: 100% !important;
    max-width: none !important;
    display: flex !important;
    align-items: center !important;
}

.message-input {
    flex: 1;
    margin: 0 10px;
}

/* ============================================================
   右侧分子面板文字显影修复
   ============================================================ */

/* 1. 强制分子面板内的所有标题和段落颜色为深色 */
.molecular-panel-content h4,
.molecular-info h4 {
    color: #1d1d1f !important;
    /* 强制深黑色 */
    font-weight: 600 !important;
    opacity: 1 !important;
    margin-bottom: 8px !important;
}

.molecular-info p {
    color: #444 !important;
    opacity: 1 !important;
}

/* 2. 修复文件列表 (file-list) 中文件名的显示 */
.file-item {
    background: #f0f2f5 !important;
    /* 给每个文件项一个浅灰底色 */
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    margin-bottom: 6px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #1d1d1f !important;
    /* 强制文字颜色 */
}

/* 3. 重点：强制 label 标签（文件名文字）可见 */
.file-item label {
    color: #1d1d1f !important;
    /* 确保文件名是黑色的 */
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    opacity: 1 !important;
    /* 防止透明 */
    cursor: pointer !important;
    flex: 1 !important;
}

/* 4. 修复复选框样式，确保它可见 */
.file-item input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    cursor: pointer !important;
    accent-color: #3370b5 !important;
    /* 复选框颜色与主题一致 */
}

/* 5. 提示文字（如“使用鼠标拖拽旋转”） */
.molecular-panel-content {
    color: #86868b !important;
    font-size: 0.75rem !important;
}

/* ============================================================
   登录/注册页品牌栏最终修正：图标在左，文字居中对齐并放大
   ============================================================ */

/* 1. 外层容器：图标与文字组横向排列 */
.brand-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    /* 图标与文字组整体垂直居中 */
    justify-content: center !important;
    gap: 25px !important;
    /* 增加图标和文字之间的间距 */
}

/* 2. 文字包装层：纵向排列，且内部中英文水平居中对齐 */
.brand-text-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    /* 【关键】让中英文在同一条垂直中轴线上 */
    text-align: center !important;
}

/* 3. 图标容器：放大并保持透明 */
.login-logo,
.register-logo {
    width: 90px !important;
    /* 【放大】从 64px 放大到 90px */
    height: 90px !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    display: flex !important;
}

/* 4. 英文标题样式 (第一行) */
.login-header h1,
.register-header h1 {
    font-family: "Times New Roman", Times, serif !important;
    font-size: 2.6rem !important;
    /* 稍微放大英文以保持比例 */
    color: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.1 !important;
    background: none !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 600 !important;
}

/* 5. 中文副标题样式 (第二行) */
.brand-subtitle {
    font-family: "Times New Roman", Times, serif !important;
    font-size: 2.1rem !important;
    /* 【放大】从 1.4rem 显著放大到 2.1rem */
    color: #ffffff !important;
    margin: 5px 0 0 0 !important;
    /* 增加一点间距 */
    padding: 0 !important;
    opacity: 1 !important;
    /* 确保颜色完全不透明 */
    white-space: nowrap !important;
    letter-spacing: 2px !important;
    /* 增加中文字距，更有设计感 */
}

/* ============================================================
   修复侧边栏缩回功能
   ============================================================ */

/* 1. 正常的侧边栏状态（保持之前的样式） */
.sidebar {
    width: 300px !important;
    transition: width 0.3s var(--ease-out) !important;
    /* 增加平滑过渡动画 */
    overflow: hidden !important;
    /* 确保缩回时内容隐藏 */
}

/* 2. 关键修复：当侧边栏有关闭类名时，强制宽度为 0 */
.sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    border-right: none !important;
    /* 缩回时去掉边线 */
    padding: 0 !important;
    /* 缩回时去掉内边距 */
    margin: 0 !important;
}

/* 3. 确保侧边栏内的内容在缩回时不溢出 */
.sidebar.collapsed * {
    display: none !important;
}