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

:root {
    /* 主色调 - 深蓝紫渐变 */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-bg: #eef2ff;
    
    /* 辅助色 */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    
    /* 中性色 */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==================== 应用容器 ==================== */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== 顶部导航 ==================== */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

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

.logo-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.nav-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-color);
    padding: 4px;
    border-radius: var(--radius-md);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-tab i {
    font-size: 14px;
}

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

.nav-tab.active {
    background: var(--card-bg);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* ==================== 主内容区 ==================== */
.main-content {
    flex: 1;
    padding: 24px;
}

.panel {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.panel.active {
    display: block;
}

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

.panel-header {
    margin-bottom: 24px;
}

.panel-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.panel-desc {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==================== 智能优化面板 ==================== */
.optimize-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 快速开始 */
.quick-start {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.quick-start h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-start h3 i {
    color: var(--warning-color);
}

.quick-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: var(--bg-color);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 100px;
}

.quick-option:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.quick-option.active {
    border-color: var(--primary-color);
    background: var(--primary-bg);
}

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

.quick-option span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* 输入区域 */
.input-section,
.result-section,
.thinking-section,
.suggestions-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

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

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

.section-header h3 i {
    color: var(--primary-color);
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px 20px;
    border: none;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary);
    background: transparent;
}

textarea:focus {
    outline: none;
}

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

.input-footer,
.result-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-color);
}

.char-count,
.token-estimate {
    font-size: 12px;
    color: var(--text-muted);
}

/* 优化选项 */
.optimize-options {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.option-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.platform-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 13px;
    color: var(--text-secondary);
}

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

.platform-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-bg);
    color: var(--primary-color);
}

.direction-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.direction-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-color);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 12px;
    color: var(--text-secondary);
}

.direction-tag:hover {
    background: var(--primary-bg);
    color: var(--primary-color);
}

.direction-tag input {
    display: none;
}

.direction-tag.active {
    background: var(--primary-color);
    color: white;
}

/* 生成按钮区域 */
.generate-section {
    display: flex;
    gap: 12px;
    justify-content: center;
}

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

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

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

.btn-generate.loading {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-generate i {
    font-size: 18px;
}

.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bg-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

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

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

/* 思考过程 */
.thinking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.thinking-status {
    font-size: 12px;
    color: var(--warning-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.thinking-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--warning-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.thinking-content {
    padding: 20px;
}

.thinking-step {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.thinking-step:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.step-number {
    width: 28px;
    height: 28px;
    background: var(--primary-bg);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 结果展示 */
.result-content {
    min-height: 160px;
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    color: var(--text-muted);
}

.placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.placeholder p {
    font-size: 14px;
}

/* 优化建议 */
.suggestions-section {
    padding: 20px;
}

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

.suggestions-section h3 i {
    color: var(--warning-color);
}

.suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}

.suggestion-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.suggestion-content h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.suggestion-content p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ==================== 思考框架面板 ==================== */
.frameworks-container {
    padding: 0;
}

.frameworks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.framework-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.framework-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.framework-card-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary-bg), var(--card-bg));
    border-bottom: 1px solid var(--border-light);
}

.framework-card-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.framework-badge {
    display: inline-block;
    font-size: 11px;
    color: var(--primary-color);
    background: var(--primary-bg);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.framework-card-body {
    padding: 16px 20px;
}

.framework-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.framework-elements {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.element-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-color);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.framework-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-color);
    display: flex;
    justify-content: flex-end;
}

/* ==================== 行业模板面板 ==================== */
.templates-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.industry-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--card-bg);
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.industry-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: var(--bg-color);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-xl);
    transition: all var(--transition-fast);
}

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

.industry-tab.active {
    background: var(--primary-color);
    color: white;
}

.search-box {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    background: transparent;
}

.search-box input:focus {
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.template-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.template-card-header {
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--primary-bg), var(--card-bg));
    border-bottom: 1px solid var(--border-light);
}

.template-card-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.template-card-body {
    padding: 14px 18px;
}

.template-preview-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.template-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-color);
}

.template-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.template-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--card-bg);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.template-use-btn {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.template-use-btn:hover {
    background: var(--primary-dark);
}

/* ==================== 版本对比面板 ==================== */
.compare-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.compare-toolbar {
    display: flex;
    gap: 12px;
}

.compare-content {
    min-height: 400px;
}

.compare-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--text-muted);
}

.compare-placeholder i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.compare-placeholder p {
    font-size: 16px;
    margin-bottom: 8px;
}

.compare-placeholder .hint {
    font-size: 13px;
    color: var(--text-muted);
}

.version-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 16px;
}

.version-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--primary-bg), var(--card-bg));
    border-bottom: 1px solid var(--border-light);
}

.version-card-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.version-card-body {
    padding: 18px;
    max-height: 300px;
    overflow-y: auto;
}

.version-card-body pre {
    font-family: inherit;
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-primary);
}

.version-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-color);
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== API配置面板 ==================== */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.api-providers {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.api-providers h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.provider-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.provider-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-color);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.provider-card:hover {
    border-color: var(--primary-light);
    background: var(--primary-bg);
}

.provider-card.active {
    border-color: var(--primary-color);
    background: var(--primary-bg);
}

.provider-card.configured {
    border-color: var(--success-color);
}

.provider-icon {
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--primary-color);
}

.provider-info {
    flex: 1;
}

.provider-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.provider-info p {
    font-size: 11px;
    color: var(--text-muted);
}

.provider-status {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.provider-status i {
    font-size: 8px;
}

.provider-status.configured {
    color: var(--success-color);
}

.provider-status.configured i {
    color: var(--success-color);
}

/* API配置表单 */
.api-config-form {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.api-config-form h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 40px;
}

.input-with-icon .btn-icon {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

/* 已配置API列表 */
.configured-apis {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.configured-apis h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.api-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.api-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
}

.api-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.api-item-icon {
    width: 36px;
    height: 36px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.api-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.api-item-model {
    font-size: 12px;
    color: var(--text-muted);
}

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

/* ==================== 弹窗 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--transition-fast);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp var(--transition-normal);
}

.modal-content.modal-lg {
    max-width: 700px;
}

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

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
}

.framework-preview,
.framework-structure,
.framework-example {
    margin-bottom: 20px;
}

.framework-preview h4,
.framework-structure h4,
.framework-example h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.framework-preview p {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

.framework-structure ul {
    list-style: none;
    padding: 0;
}

.framework-structure li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.framework-structure li:last-child {
    border-bottom: none;
}

.framework-structure li .element-name {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 80px;
}

.framework-structure li .element-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.framework-example pre,
.template-content pre {
    background: var(--bg-color);
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text-primary);
    max-height: 300px;
    overflow-y: auto;
}

.template-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.template-category {
    font-size: 12px;
    color: var(--primary-color);
    background: var(--primary-bg);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast i {
    color: var(--primary-light);
}

/* ==================== 底部 ==================== */
.footer {
    text-align: center;
    padding: 16px;
    color: var(--text-muted);
    font-size: 12px;
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

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

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

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

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

/* ==================== 加载动画 ==================== */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .nav-tabs {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .nav-tab {
        padding: 6px 12px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .nav-tab span {
        display: none;
    }
    
    .nav-tab i {
        font-size: 16px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .quick-options {
        justify-content: center;
    }
    
    .quick-option {
        min-width: 80px;
        padding: 12px 16px;
    }
    
    .platform-selector {
        justify-content: center;
    }
    
    .generate-section {
        flex-direction: column;
    }
    
    .btn-generate {
        width: 100%;
    }
    
    .frameworks-grid,
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .provider-cards {
        grid-template-columns: 1fr;
    }
    
    .industry-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .industry-tab {
        white-space: nowrap;
    }
}
