/* 全局变量 */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #22d3ee;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 页面容器 */
.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* API Key 配置页面 */
.setup-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.setup-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 48px;
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.logo-section {
    margin-bottom: 48px;
    text-align: center;
}

.logo {
    width: 96px;
    height: 96px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 32px;
    color: white;
    font-size: 36px;
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.15), 0 10px 10px -5px rgba(99, 102, 241, 0.04);
    animation: logoFloat 4s ease-in-out infinite;
    position: relative;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 30px -5px rgba(99, 102, 241, 0.2), 0 15px 15px -5px rgba(99, 102, 241, 0.08);
}

.logo::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-color));
    border-radius: 24px;
    z-index: -1;
    opacity: 0;
    transition: var(--transition);
}

.logo:hover::before {
    opacity: 0.6;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(-2deg);
    }
    50% {
        transform: translateY(-12px) rotate(0deg);
    }
    75% {
        transform: translateY(-8px) rotate(2deg);
    }
}

.setup-card h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0px;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-color));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.setup-card h1 .brand {
    color: var(--primary-color);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.setup-card h1 .product {
    color: var(--text-primary);
    font-weight: 500;
    background: linear-gradient(135deg, var(--text-secondary), var(--text-primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    max-width: 280px;
    margin: 0 auto;
}

.setup-form {
    text-align: left;
}

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

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-group label i {
    color: var(--primary-color);
    font-size: 14px;
}

.form-group input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px;
    transition: var(--transition);
    background: var(--bg-primary);
}

.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.help-text {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

.help-text a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.help-text a:hover {
    text-decoration: underline;
}

.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.validation-result {
    margin-top: 16px;
    padding: 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    display: none;
}

.validation-result.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: block;
}

.validation-result.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: block;
}

/* 主应用布局 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 72px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(249, 250, 251, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(229, 231, 235, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    z-index: 1000;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.header:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: var(--radius-xl);
}

.header-brand:hover {
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
}

.brand-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2), 0 2px 4px -1px rgba(99, 102, 241, 0.06);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.brand-logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary-color));
    opacity: 0;
    transition: var(--transition);
}

.header-brand:hover .brand-logo {
    transform: rotate(3deg) scale(1.05);
    box-shadow: 0 8px 12px -1px rgba(99, 102, 241, 0.3), 0 4px 8px -1px rgba(99, 102, 241, 0.1);
}

.header-brand:hover .brand-logo::before {
    opacity: 0.3;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.header-btn {
    background: transparent;
    border: none;
    padding: 12px;
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.header-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.header-btn:hover::after {
    opacity: 1;
    bottom: -36px;
}

.header-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2);
}

.header-btn:active {
    transform: translateY(-1px);
}

.main-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 0;
    margin-top: 72px;
    height: calc(100vh - 72px);
}

.chat-section {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
}

.instruction-section {
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* 技术参数选择区域样式 */
.tech-params-section {
    margin-bottom: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02), rgba(129, 140, 248, 0.04));
    border-radius: var(--radius-xl);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.params-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.params-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.params-grid {
    display: grid;
    gap: 20px;
}

.param-group {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.param-group:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.2);
}

.param-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.param-label i {
    color: var(--primary-color);
    font-size: 14px;
}

.param-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option-item {
    flex: 1;
    min-width: 100px;
    max-width: 140px;
}

/* 设备支持选项特殊布局 */
.device-options .device-options-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    justify-content: stretch;
}

.device-options .option-item {
    min-width: 0;
    max-width: none;
    flex: 1;
}

.device-options .option-item label {
    width: 100%;
    min-height: 60px;
    justify-content: center;
}

.option-item input[type="radio"] {
    display: none;
}

.option-item label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: var(--radius-lg);
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    min-height: 60px;
    justify-content: center;
}

.option-item label:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--primary-color);
    transform: translateY(-1px);
    cursor: pointer;
}

.option-item input[type="radio"]:checked + label {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(129, 140, 248, 0.08));
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 技术详情样式 */
.tech-details {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.03));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-xl);
    padding: 16px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

.details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.details-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.close-details {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.close-details:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.details-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.tech-description {
    margin-bottom: 12px;
}

.tech-description h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tech-description p {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.pros, .cons {
    padding: 0;
    margin: 0;
    list-style: none;
}

.pros li, .cons li {
    margin-bottom: 6px;
    padding-left: 20px;
    position: relative;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
}

.pros li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: 600;
}

.cons li::before {
    content: "!";
    position: absolute;
    left: 0;
    color: var(--error-color);
    font-weight: 600;
}

.pros-cons h6 {
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--success-color);
}

.cons h6 {
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--error-color);
}

.option-icon {
    font-size: 20px;
    line-height: 1;
}

.option-text {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    word-break: break-word;
}

/* 需求描述区域样式 */
.requirement-section {
    margin-top: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.section-header h3 i {
    color: var(--primary-color);
    font-size: 16px;
}

.requirement-actions {
    display: flex;
    gap: 8px;
}

.primary-btn.small {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.primary-btn.small:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.primary-btn.small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.success-btn.small {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
}

.success-btn.small:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.requirement-input {
    margin-bottom: 16px;
}

#requirementInput {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
    background: var(--bg-primary);
    line-height: 1.5;
}

#requirementInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

#requirementInput::placeholder {
    color: var(--text-muted);
}

.requirement-tips {
    margin-top: 8px;
}

.requirement-tips p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.requirement-tips i {
    color: var(--warning-color);
    font-size: 12px;
}

/* 优化后的需求展示区域 */
.optimized-requirement {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(5, 150, 105, 0.03));
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-xl);
    padding: 16px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

.optimized-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.optimized-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--success-color);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.optimized-actions {
    display: flex;
    gap: 6px;
}

.optimized-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    border: 1px solid rgba(16, 185, 129, 0.1);
    white-space: pre-wrap;
    word-break: break-word;
}

.action-section {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* 对话区域样式 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
}

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

.chat-header h2 i {
    color: var(--primary-color);
    font-size: 18px;
}

.quick-actions .secondary-btn.small {
    padding: 6px 12px;
    font-size: 13px;
}

.secondary-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px 8px 12px;
    margin-bottom: 24px;
    max-height: calc(100vh - 340px);
    scroll-behavior: smooth;
    background: linear-gradient(180deg, rgba(249, 250, 251, 0.5) 0%, transparent 100%);
    border-radius: var(--radius-lg);
    position: relative;
}

.message {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    animation: messageSlide 0.4s ease-out;
}

.message:first-child {
    margin-top: 0;
}

.welcome-message {
    margin-bottom: 32px;
}

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

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

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

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--secondary-color), #06b6d4);
    color: white;
}

.message-content {
    flex: 1;
    max-width: calc(100% - 64px);
    min-width: 0;
}

.message-bubble {
    padding: 14px 18px;
    border-radius: var(--radius-xl);
    position: relative;
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.message-bubble:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.ai-message .message-bubble {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 6px;
    border: 1px solid var(--border-light);
}

.user-message .message-bubble {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border-bottom-right-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-text {
    font-size: 14px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 欢迎消息特殊样式 */
.welcome-message .message-text {
    font-size: 15px;
    line-height: 1.6;
}

.welcome-message .message-bubble {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(129, 140, 248, 0.06));
    border: 1px solid rgba(99, 102, 241, 0.2);
    position: relative;
}

.welcome-message .message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.welcome-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    position: relative;
    overflow: hidden;
}

.welcome-message .message-avatar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    text-align: right;
}

.user-message .message-time {
    text-align: left;
}

/* 输入区域 */
.input-container {
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
    margin-top: auto;
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#userInput {
    flex: 1;
    min-height: 48px;
    max-height: 140px;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    transition: var(--transition);
    background: var(--bg-primary);
    line-height: 1.5;
}

#userInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

#userInput::placeholder {
    color: var(--text-muted);
}

.input-actions-right {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-shrink: 0;
}

.enhance-btn {
    background: linear-gradient(135deg, var(--secondary-color), #06b6d4);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

.enhance-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: var(--transition);
}

.enhance-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.enhance-btn:hover:not(:disabled)::before {
    opacity: 1;
}

.enhance-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.95);
}

.enhance-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.enhance-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    z-index: 1000;
}

.enhance-btn:hover::after {
    opacity: 1;
    bottom: -40px;
}

.send-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: var(--transition);
}

.send-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.send-btn:hover:not(:disabled)::before {
    opacity: 1;
}

.send-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.generate-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.generate-btn {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    border: none;
    padding: 16px 36px;
    border-radius: var(--radius-xl);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    letter-spacing: 0.3px;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.generate-btn:active:not(:disabled) {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* 指令展示区域 */
.instruction-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 28px;
}

.instruction-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

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

.instruction-header h2 i {
    color: var(--primary-color);
    font-size: 18px;
}

.filter-select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    min-width: 140px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.instruction-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - 220px);
    scroll-behavior: smooth;
}

.empty-state {
    text-align: center;
    padding: 80px 32px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 56px;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 15px;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

.instruction-block {
    margin-bottom: 32px;
    animation: fadeInUp 0.4s ease-out;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.instruction-block:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.instruction-type {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.instruction-type i {
    font-size: 14px;
}

.instruction-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-lg);
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-x: auto;
    position: relative;
    border: 1px solid #334155;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.code-block:hover {
    border-color: #475569;
}

.code-block pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
}

.language-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.instruction-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.action-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    letter-spacing: 0.3px;
    min-width: 140px;
    flex: 0 0 auto;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

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

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

.modal-header h3 i {
    color: var(--primary-color);
    font-size: 16px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

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

.setting-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-with-action {
    display: flex;
    gap: 8px;
}

.input-with-action input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
}

.input-with-action button {
    flex-shrink: 0;
}

.help-section {
    margin-bottom: 24px;
}

.help-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-section h4 i {
    color: var(--primary-color);
    font-size: 14px;
}

.help-section ul,
.help-section ol {
    margin-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.help-section li {
    margin-bottom: 6px;
}

.help-section strong {
    color: var(--text-primary);
}

kbd {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    font-family: monospace;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* 加载提示 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.loading-overlay.show {
    display: flex;
    opacity: 1;
}

.loading-content {
    background: rgba(31, 41, 55, 0.95);
    border-radius: 16px;
    padding: 32px 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: loadingSlideUp 0.3s ease-out;
}

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

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.small {
    width: 24px;
    height: 24px;
    border-width: 2px;
    border-top-color: #6366f1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: white;
    margin: 0;
}

.loading-subtext {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin: 0;
}

/* 内联加载指示器 */
.inline-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
    color: var(--primary-color);
    font-size: 13px;
    font-weight: 500;
}

.inline-loading .loading-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-top-color: var(--primary-color);
}

/* 按钮加载状态 */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 状态指示器 */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
}

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-error {
    color: var(--error-color);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .chat-section {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: 50vh;
    }

    .instruction-section {
        height: 50vh;
    }

    .instruction-actions {
        gap: 10px;
        padding: 16px 12px;
    }

    .action-btn {
        min-width: 120px;
        padding: 10px 18px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    /* 设备支持选项响应式布局 */
    .device-options .device-options-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .device-options .option-item label {
        min-height: 50px;
        padding: 8px 6px;
        font-size: 11px;
    }

    .device-options .option-icon {
        font-size: 16px;
    }

    .header {
        padding: 0 20px;
        height: 64px;
    }

    .brand-tagline {
        display: none;
    }

    .brand-name {
        font-size: 18px;
    }

    .brand-logo {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .header-actions {
        gap: 4px;
        padding: 2px;
    }

    .header-btn {
        width: 40px;
        height: 40px;
        font-size: 15px;
        padding: 10px;
    }

    .header-btn::after {
        display: none;
    }

    .main-container {
        margin-top: 64px;
        height: calc(100vh - 64px);
    }

    .chat-container,
    .instruction-container {
        padding: 20px;
    }

    .chat-messages {
        max-height: calc(50vh - 200px);
        margin-bottom: 20px;
    }

    .instruction-content {
        max-height: calc(50vh - 180px);
        padding: 20px;
    }

    .message {
        margin-bottom: 20px;
        gap: 12px;
    }

    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .message-content {
        max-width: calc(100% - 56px);
    }

    .message-bubble {
        padding: 12px 16px;
    }

    .input-group {
        gap: 10px;
    }

    #userInput {
        min-height: 44px;
        padding: 12px 16px;
    }

    .input-actions-right {
        gap: 6px;
    }

    .enhance-btn {
        width: 44px;
        height: 44px;
        font-size: 15px;
    }

    .enhance-btn::after {
        display: none;
    }

    .send-btn {
        width: 44px;
        height: 44px;
        font-size: 15px;
    }

    .generate-btn {
        padding: 14px 28px;
        font-size: 15px;
    }

    .setup-card {
        padding: 32px 24px;
    }

    .modal-content {
        margin: 16px;
        width: calc(100% - 32px);
    }

    .instruction-actions {
        gap: 8px;
        padding: 12px 8px;
    }
}

@media (max-width: 480px) {
    /* 设备支持选项最小屏幕布局 */
    .device-options .device-options-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .device-options .option-item label {
        min-height: 45px;
        padding: 6px 4px;
        font-size: 10px;
    }

    .device-options .option-icon {
        font-size: 14px;
    }

    .header {
        padding: 0 16px;
        height: 60px;
    }

    .brand-name {
        font-size: 16px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .header-brand {
        gap: 12px;
        padding: 4px 8px;
    }

    .header-actions {
        gap: 2px;
        padding: 2px;
    }

    .header-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
        padding: 8px;
    }

    .main-container {
        margin-top: 60px;
        height: calc(100vh - 60px);
    }

    .chat-container,
    .instruction-container {
        padding: 16px;
    }

    .chat-header,
    .instruction-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .chat-header h2,
    .instruction-header h2 {
        font-size: 16px;
        gap: 8px;
    }

    .chat-header h2 i,
    .instruction-header h2 i {
        font-size: 16px;
    }

    .chat-messages {
        max-height: calc(50vh - 180px);
        margin-bottom: 16px;
        padding: 0 4px;
    }

    .instruction-content {
        max-height: calc(50vh - 160px);
        padding: 16px;
    }

    .message {
        margin-bottom: 16px;
        gap: 10px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .message-content {
        max-width: calc(100% - 48px);
    }

    .message-bubble {
        padding: 10px 14px;
        border-radius: var(--radius-lg);
    }

    .message-text {
        font-size: 13px;
        line-height: 1.6;
    }

    .input-container {
        padding-top: 16px;
    }

    .input-actions {
        margin-bottom: 12px;
    }

    .enhance-btn {
        padding: 8px 14px;
        font-size: 12px;
        gap: 6px;
    }

    .input-group {
        gap: 8px;
    }

    #userInput {
        min-height: 40px;
        padding: 10px 14px;
        font-size: 13px;
    }

    .input-actions-right {
        gap: 4px;
    }

    .enhance-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .enhance-btn::after {
        display: none;
    }

    .send-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .generate-section {
        margin-top: 16px;
        padding-top: 16px;
    }

    .generate-btn {
        padding: 12px 24px;
        font-size: 14px;
        gap: 8px;
    }

    .setup-card {
        padding: 24px 16px;
    }

    .logo-section {
        margin-bottom: 24px;
    }

    .logo {
        width: 64px;
        height: 64px;
        font-size: 28px;
        border-radius: 16px;
        margin-bottom: 24px;
    }

    .setup-card h1 {
        font-size: 24px;
        gap: 3px;
    }

    .setup-card h1 .brand {
        font-size: 24px;
    }

    .setup-card h1 .product {
        font-size: 22px;
    }

    .subtitle {
        font-size: 15px;
    }

    .setup-card h1 {
        font-size: 20px;
        gap: 2px;
        line-height: 1.4;
    }

    .setup-card h1 .brand {
        font-size: 20px;
    }

    .setup-card h1 .product {
        font-size: 18px;
    }

    .subtitle {
        font-size: 14px;
    }

    .logo {
        width: 56px;
        height: 56px;
        font-size: 22px;
        border-radius: 14px;
        margin-bottom: 20px;
    }

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

    .form-group input[type="password"] {
        padding: 12px 14px;
        font-size: 14px;
    }

    .primary-btn {
        padding: 14px 20px;
        font-size: 15px;
    }

    .instruction-block {
        padding: 16px;
        margin-bottom: 24px;
    }

    .instruction-title {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .code-block {
        padding: 16px;
        font-size: 12px;
    }

    .empty-state {
        padding: 60px 20px;
    }

    .empty-state i {
        font-size: 48px;
        margin-bottom: 16px;
    }

    .empty-state h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .empty-state p {
        font-size: 14px;
    }

    .modal-body {
        padding: 16px;
    }

    .filter-select {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 120px;
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
        --bg-primary: #1f2937;
        --bg-secondary: #111827;
        --bg-tertiary: #374151;
        --border-color: #4b5563;
        --border-light: #374151;
    }

    .setup-container {
        background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 100%);
    }

    .code-block {
        background: #1a202c;
        border-color: #2d3748;
    }

    .loading-overlay {
        background: rgba(17, 24, 39, 0.9);
    }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 选择文本样式 */
::selection {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

/* 焦点样式 */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 内联消息样式 */
.inline-message {
    padding: 8px 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
    border-left: 4px solid;
}

.inline-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border-left-color: #ef4444;
}

.inline-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border-left-color: #10b981;
}

.inline-message.info {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border-left-color: #3b82f6;
}

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

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

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

/* 打印样式 */
@media print {
    .header,
    .input-container,
    .instruction-actions,
    .header-btn {
        display: none !important;
    }

    .main-container {
        display: block !important;
        height: auto !important;
        margin-top: 0 !important;
    }

    .chat-section,
    .instruction-section {
        height: auto !important;
        break-inside: avoid;
    }

    .modal {
        display: none !important;
    }
}