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

:root {
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --bg-color: #f8fafc;
    --sidebar-bg: #ffffff;
    --chat-bg: #f1f5f9;
    --user-msg-bg: #2563eb;
    --ai-msg-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

.main-container {
    display: none;
    width: 100%;
    max-width: 100%;
    height: 100vh;
}

.main-container.active {
    display: block;
}

.main-container .container {
    display: flex;
    height: 100%;
}

.container {
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    border-radius: 0;
    box-shadow: none;
    display: flex;
    overflow: hidden;
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 12px 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 16px;
    cursor: pointer;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-subtitle {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.nav-section {
    margin-bottom: 12px;
}

.nav-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 12px;
    margin-bottom: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(59, 130, 246, 0.05));
    color: var(--primary-color);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item span {
    font-size: 14px;
}

.quick-questions {
    flex: 1;
    overflow-y: auto;
}

.quick-question {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-color);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: var(--text-secondary);
}

.quick-question:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

.quick-question i {
    font-size: 12px;
    color: var(--primary-color);
}

.quick-question:hover i {
    color: white;
}

/* 主聊天区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
}

.chat-header {
    padding: 12px 16px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.chat-title h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-title .badge {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

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

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.header-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
}

.header-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-top-left-radius: 12px;
    border-top-right-radius: 4px;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.message.ai .message-avatar {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 4px;
    box-shadow: var(--shadow);
    line-height: 1.6;
}

.message-text {
    font-size: 13px;
    color: var(--text-primary);
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-top-left-radius: 16px;
    border-top-right-radius: 4px;
}

.message-text {
    font-size: 14px;
    color: var(--text-primary);
}

.message.user .message-text {
    color: white;
}

.message-time {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.7);
    text-align: right;
}

/* 功能卡片 */
.function-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 8px;
}

.function-card {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.function-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    font-size: 14px;
}

.function-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.function-card-desc {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.function-card {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.function-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.function-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    font-size: 16px;
}

.function-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.function-card-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 订单状态卡片 */
.order-status-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.order-status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.order-id {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.order-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.order-status.producing {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.order-status.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.order-status.completed {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 12px 0;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--border-color);
    border-radius: 2px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    margin-bottom: 4px;
}

.progress-step.completed .step-icon {
    background: var(--success-color);
}

.progress-step.current .step-icon {
    background: var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
    }
}

.step-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-align: center;
}

.progress-step.completed .step-label,
.progress-step.current .step-label {
    color: var(--text-primary);
    font-weight: 500;
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.info-item {
    background: var(--bg-color);
    padding: 8px;
    border-radius: 6px;
}

.info-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 输入区域 */
.chat-input-area {
    padding: 12px 16px;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-color);
    border-radius: 12px;
    padding: 8px 12px;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    background: white;
}

.input-icon {
    color: var(--text-secondary);
    font-size: 16px;
    padding-bottom: 4px;
}

.attach-btn {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 4px 6px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

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

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-primary);
}

.message-file {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-color);
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 6px;
    font-size: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-color);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
}

.file-item i {
    color: var(--primary-color);
}

.file-item .remove-file {
    cursor: pointer;
    color: var(--text-secondary);
    margin-left: 4px;
}

.file-item .remove-file:hover {
    color: var(--error-color);
}

.message-file {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-color);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 13px;
}

.message-file i {
    color: var(--primary-color);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    resize: none;
    max-height: 100px;
    line-height: 1.5;
}

.chat-input:focus {
    outline: none;
}

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

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.send-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
    box-shadow: none;
}

/* 欢迎消息 */
.welcome-message {
    text-align: center;
    padding: 20px 10px;
}

.welcome-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(59, 130, 246, 0.05));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    color: var(--primary-color);
}

.welcome-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.welcome-desc {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto 16px;
    line-height: 1.6;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 600px;
    margin: 0 auto;
}

.feature-item {
    background: white;
    border-radius: 12px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.feature-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 8px;
}

.feature-item:nth-child(1) .feature-icon {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
}

.feature-item:nth-child(2) .feature-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: white;
}

.feature-item:nth-child(3) .feature-icon {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: white;
}

.feature-item:nth-child(4) .feature-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: white;
}

.feature-item:nth-child(5) .feature-icon {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
}

.feature-item:nth-child(6) .feature-icon {
    background: linear-gradient(135deg, #06b6d4, #22d3ee);
    color: white;
}

.feature-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.feature-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 4px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* 响应式 */
@media (max-width: 1200px) {
    .container {
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .message {
        max-width: 95%;
    }

    .function-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 加载动画 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

.ai-message-loading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    max-width: 85%;
}

.ai-message-loading .message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #34d399);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.ai-message-loading .message-content {
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    border-top-left-radius: 4px;
    box-shadow: var(--shadow);
}

/* 登录页面 */
.login-container {
    display: none;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.login-container.active {
    display: block;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    margin-bottom: 16px;
}

.login-logo-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-logo-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-color);
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

.form-input-wrapper {
    position: relative;
}

.form-input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 16px;
}

.form-input-wrapper .form-input {
    padding-left: 42px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    margin-top: 10px;
    font-family: inherit;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.forgot-password {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.forgot-password:hover {
    text-decoration: underline;
}

.social-login {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.social-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: inherit;
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

.forgot-password {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.forgot-password:hover {
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 16px;
}

.social-login {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.social-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.social-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.social-btn.wechat {
    color: #07c160;
}

.social-btn.qq {
    color: #12b7f5;
}

.social-btn.weibo {
    color: #e6162d;
}

/* 设置弹窗 */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.settings-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 560px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h2 i {
    color: var(--primary-color);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--error-color);
    color: white;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* 设置布局 - 左右分栏 */
.settings-layout {
    display: flex;
    height: 100%;
    min-height: 400px;
}

/* 左侧边栏 */
/* 设置弹窗尺寸 */
.settings-modal .modal-content {
    max-width: 900px;
    width: 95%;
    min-height: 500px;
}

.settings-modal .settings-sidebar {
    width: 180px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 16px 12px;
    flex-shrink: 0;
}

.settings-modal .sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.settings-modal .sidebar-item:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.settings-modal .sidebar-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.settings-modal .sidebar-item i {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

/* 右侧内容区 */
.settings-modal .settings-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* 用户列表 */
.settings-modal .user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.settings-modal .user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.settings-modal .user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-modal .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.settings-modal .user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.settings-modal .user-email {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 标签导航 */
.settings-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.tab-item {
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.tab-item:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.tab-item.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(59, 130, 246, 0.05));
    color: var(--primary-color);
    font-weight: 500;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* 设置组 */
.settings-group {
    background: var(--bg-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.settings-group h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-primary);
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 开关 */
.switch-label {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
}

.switch-label span {
    margin-bottom: 0 !important;
}

.switch {
    position: relative;
    width: 44px;
    height: 24px;
    display: inline-block;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch input:checked + .slider {
    background-color: var(--primary-color);
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

/* 关于 */
.about-info {
    text-align: center;
    padding: 20px;
}

.about-info .about-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    font-size: 28px;
}

.about-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.about-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.about-info .desc {
    margin-top: 12px;
}

/* 弹窗底部 */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s;
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

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

.modal-footer .btn-secondary {
    background: var(--bg-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.modal-footer .btn-secondary:hover {
    background: var(--border-color);
}

/* 应用列表 */
.app-list-container {
    margin-bottom: 16px;
}

.app-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.app-list-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-sm.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-sm.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.app-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.app-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.app-item:hover {
    border-color: var(--primary-light);
}

.app-item.active {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.app-item.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-color);
}

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

.app-icon-small {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.app-details {
    flex: 1;
}

.app-name-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.app-id-text {
    font-size: 11px;
    color: var(--text-secondary);
}

.app-actions {
    display: flex;
    gap: 4px;
}

.app-actions button {
    width: 28px;
    height: 28px;
    border: none;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.app-actions button:hover {
    background: var(--primary-color);
    color: white;
}

.app-actions button.delete:hover {
    background: var(--error-color);
}

.app-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* 应用表单 */
.app-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.app-form .form-actions,
.user-form .form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* 用户表单样式 */
.settings-modal .user-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}