/* ========== 泽盛赋能 - 全局样式 ========== */

:root {
    --primary: #3b5998;
    --primary-hover: #2d4373;
    --primary-light: #e8edf5;
    --accent: #f5a623;
    --accent-hover: #e09000;
    --bg: #f8f9fb;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --success: #10b981;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-hover);
}

/* ========== 导航栏 ========== */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}
.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.navbar-brand:hover { color: var(--text); }
.brand-icon {
    width: 28px;
    height: 28px;
    color: var(--primary);
}
.navbar-links {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}
.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.nav-link-primary {
    background: var(--primary);
    color: #fff !important;
}
.nav-link-primary:hover {
    background: var(--primary-hover);
    color: #fff !important;
}

/* ========== 首页 Hero ========== */
.hero {
    text-align: center;
    padding: 100px 24px 80px;
    min-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}
.hero-badge svg { color: var(--accent); }
.hero h1 {
    font-size: 56px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 24px;
    letter-spacing: -1px;
}
.hero h1 .highlight {
    color: var(--primary);
}
.hero p {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.8;
}
.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
}
.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: var(--danger-hover);
    color: #fff;
}
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}
.btn-lg {
    padding: 16px 36px;
    font-size: 16px;
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}
.btn svg {
    width: 18px;
    height: 18px;
}

/* ========== 卡片 ========== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}
.card-header {
    margin-bottom: 24px;
}
.card-header h2 {
    font-size: 22px;
    font-weight: 600;
}
.card-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ========== 表单 ========== */
.form-group {
    margin-bottom: 24px;
}
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}
.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg-card);
    transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.1);
}
.form-textarea {
    min-height: 100px;
    resize: vertical;
}
.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 图片上传区 */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.upload-area.has-image {
    padding: 16px;
    border-style: solid;
}
.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.upload-text {
    font-size: 15px;
    color: var(--text-secondary);
}
.upload-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.upload-preview {
    max-width: 300px;
    max-height: 300px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

/* 品类选择 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.category-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}
.category-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.category-option.active {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.15);
}
.category-option .cat-icon {
    font-size: 28px;
}
.category-option .cat-name {
    font-size: 13px;
    font-weight: 500;
}

/* ========== 进度页面 ========== */
.progress-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 24px;
}
.progress-header {
    text-align: center;
    margin-bottom: 40px;
}
.progress-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}
.progress-bar-container {
    background: var(--border);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
    margin: 24px 0;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    transition: width 0.5s ease;
}
.progress-percent {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
}
.progress-step-text {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 8px;
}

/* 步骤列表 */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}
.step-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
}
.step-icon.pending {
    background: var(--border);
    color: var(--text-muted);
}
.step-icon.active {
    background: var(--primary);
    color: #fff;
    animation: pulse 1.5s infinite;
}
.step-icon.completed {
    background: var(--success);
    color: #fff;
}
.step-icon.failed {
    background: var(--danger);
    color: #fff;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 89, 152, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(59, 89, 152, 0); }
}
.step-info {
    flex: 1;
}
.step-title {
    font-weight: 600;
    font-size: 15px;
}
.step-desc {
    font-size: 13px;
    color: var(--text-muted);
}

/* 图片网格 */
.images-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 40px;
}
.image-cell {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
    background: var(--bg);
}
.image-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-cell .image-status {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 11px;
    border-radius: 4px;
    text-align: center;
}
.image-cell .image-status.generating {
    background: rgba(59, 89, 152, 0.85);
}
.image-cell .image-status.failed {
    background: rgba(239, 68, 68, 0.85);
}
.image-cell .image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
}

/* 下载区域 */
.download-section {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* ========== 历史记录 ========== */
.history-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 24px;
}
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.history-header h1 {
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.task-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.task-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}
.task-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    color: inherit;
}
.task-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
}
.task-info {
    flex: 1;
    min-width: 0;
}
.task-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.task-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}
.task-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* 状态标签 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.status-badge.completed { background: #d1fae5; color: #065f46; }
.status-badge.processing { background: #dbeafe; color: #1e40af; }
.status-badge.failed { background: #fee2e2; color: #991b1b; }
.status-badge.pending { background: #f3f4f6; color: #6b7280; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}
.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}
.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

/* ========== 页脚 ========== */
.footer {
    text-align: center;
    padding: 32px 24px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

/* ========== 确认弹窗 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}
.modal h3 {
    font-size: 18px;
    margin-bottom: 12px;
}
.modal p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
}
.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========== Toast 通知 ========== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--primary); color: #fff; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== 加载动画 ========== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .hero h1 { font-size: 36px; }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .images-grid { grid-template-columns: repeat(3, 1fr); }
    .task-card { flex-direction: column; align-items: flex-start; }
    .task-actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 28px; }
    .category-grid { grid-template-columns: repeat(2, 1fr); }
    .images-grid { grid-template-columns: repeat(2, 1fr); }
}
