/* PixSEO 样式 - 全中文界面，大屏操作 */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
}

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

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

/* ─── 导航 ─── */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 12px; }
.nav-brand a {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.nav-subtitle { font-size: 13px; color: var(--text-secondary); }
.nav-links { display: flex; align-items: center; gap: 12px; }
.nav-shop { font-size: 13px; color: var(--text-secondary); }

/* ─── 按钮 ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-lg { padding: 12px 32px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── 加载旋转器 ─── */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    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); } }

/* ─── 主内容 ─── */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ─── 首页 Hero ─── */
.hero {
    text-align: center;
    padding: 80px 0;
}
.hero h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}
.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
}
.hero-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}
.feature-card {
    padding: 24px 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.feature-card h3 { font-size: 16px; margin-bottom: 8px; color: var(--primary); }
.feature-card p { font-size: 13px; color: var(--text-secondary); }

/* ─── 页面标题 ─── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}
.page-header h1 { font-size: 24px; font-weight: 700; }
.page-desc { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ─── 统计卡片 ─── */
.stats { display: flex; gap: 16px; margin-bottom: 24px; }
.stat-card {
    padding: 16px 24px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    flex: 1;
    min-width: 120px;
}
.stat-value { display: block; font-size: 28px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* ─── 配额条 ─── */
.quota-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 13px;
}
.quota-label { color: var(--text-secondary); white-space: nowrap; }
.quota-gauge {
    width: 100px;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.quota-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s;
}
.quota-text { font-weight: 600; white-space: nowrap; }

/* ─── 表格 ─── */
.table-wrapper { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.table th { background: #f1f5f9; font-weight: 600; white-space: nowrap; }
.table code { font-size: 12px; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.no-thumb { color: var(--text-secondary); font-size: 12px; }
.alt-cell { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── 状态标签 ─── */
.status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-processing { background: #dbeafe; color: #1e40af; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-failed { background: #fee2e2; color: #991b1b; }
.status-rolled_back { background: #fef3c7; color: #92400e; }

/* ─── 自动刷新标识 ─── */
.auto-refresh-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    background: #dbeafe;
    color: #1e40af;
    margin-left: 8px;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ─── 进度条 ─── */
.progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.5s;
}

/* ─── 商品网格 ─── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.product-image {
    width: 100%;
    height: 200px;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    gap: 8px;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.no-image { color: var(--text-secondary); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.product-info { padding: 16px; }
.product-info h3 { font-size: 15px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-meta { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.product-actions { margin-bottom: 8px; }
.process-status { font-size: 13px; min-height: 20px; }

/* ─── 任务详情 ─── */
.task-info {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}
.info-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    gap: 8px;
}
.info-row:last-child { border-bottom: none; }
.info-label { width: 100px; color: var(--text-secondary); flex-shrink: 0; }
.info-row.error { color: var(--danger); }

/* ─── 空状态 ─── */
.empty-state {
    text-align: center;
    padding: 48px;
    color: var(--text-secondary);
}
.empty-state svg { margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty-state p { margin-bottom: 16px; font-size: 14px; }

/* ─── 分页 ─── */
.pagination { margin-top: 24px; text-align: center; }

/* ─── Footer ─── */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}
.footer-links { margin-top: 8px; }
.footer-links a { color: var(--text-secondary); text-decoration: underline; }

/* ─── 法律页面 ─── */
.legal-page { max-width: 720px; margin: 0 auto; }
.legal-page h1 { font-size: 28px; margin-bottom: 8px; }
.legal-page .update-date { color: var(--text-secondary); font-size: 13px; margin-bottom: 32px; }
.legal-page section { margin-bottom: 24px; }
.legal-page h2 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.legal-page p, .legal-page li { font-size: 14px; line-height: 1.8; color: var(--text-secondary); }
.legal-page ul { padding-left: 20px; }

/* ─── Toast 通知 ─── */
.toast-container {
    position: fixed;
    top: 72px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    max-width: 400px;
}
.toast-visible { opacity: 1; transform: translateX(0); }
.toast-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.toast-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.toast-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.toast-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ─── 模态弹窗 ─── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    animation: fadeIn 0.15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.2s;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
    padding: 20px 24px 0;
}
.modal-header h3 { font-size: 18px; }
.modal-body {
    padding: 16px 24px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}
.modal-footer {
    padding: 0 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ─── 骨架屏 ─── */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── Demo 页面 ─── */
.demo-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    align-items: start;
}
.demo-upload { position: sticky; top: 72px; }
.upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: #eef2ff;
    color: var(--primary);
}
.upload-text { font-size: 15px; font-weight: 500; }
.upload-hint { font-size: 12px; }
.upload-preview { text-align: center; }
.upload-preview img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: #f1f5f9;
}
.demo-options { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.option-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}
.option-row input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}
.option-toggles { display: flex; flex-wrap: wrap; gap: 12px; }
.toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.demo-results { min-height: 400px; }

/* 对比图 */
.compare-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
}
.compare-card {
    flex: 1;
    text-align: center;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
}
.compare-card h4 { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.compare-card img {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: 4px;
    background: #f1f5f9;
}
.compare-size { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; }
.compare-arrow { font-size: 24px; color: var(--primary); flex-shrink: 0; }

.reduction-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    background: #f1f5f9;
    color: var(--text-secondary);
}
.reduction-good { background: #d1fae5; color: #065f46; }
.reduction-warn { background: #fef3c7; color: #92400e; }

/* 处理步骤 */
.steps-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 24px; }
.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 14px;
}
.step-success { background: #f0fdf4; border: 1px solid #bbf7d0; }
.step-failed { background: #fef2f2; border: 1px solid #fecaca; }
.step-icon { font-size: 16px; }
.step-name { font-weight: 500; }
.step-size { margin-left: auto; font-size: 13px; color: var(--text-secondary); }
.step-error { display: block; width: 100%; font-size: 12px; color: var(--danger); margin-top: 4px; }

/* Alt 文本列表 */
.alt-list { margin: 12px 0 24px; display: flex; flex-direction: column; gap: 8px; }
.alt-item {
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-size: 14px;
}
.alt-lang {
    font-weight: 600;
    color: var(--primary);
    min-width: 70px;
    flex-shrink: 0;
}
.alt-text { color: var(--text); }
.seo-filename {
    display: block;
    margin: 8px 0 24px;
    padding: 10px 14px;
    background: #f1f5f9;
    border-radius: var(--radius);
    font-size: 14px;
}
.text-muted { color: var(--text-secondary); font-size: 14px; }

/* ─── API 文档 ─── */
.api-docs { max-width: 900px; }
.docs-section { margin-bottom: 40px; }
.docs-section h2 {
    font-size: 20px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.docs-section h3 { font-size: 15px; margin: 20px 0 8px; }
.endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.method {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
}
.method-post { background: #10b981; }
.method-get { background: #3b82f6; }
.endpoint-path { font-size: 15px; font-weight: 500; }

.code-block {
    background: #1e293b;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}
.code-header {
    padding: 8px 16px;
    font-size: 12px;
    color: #94a3b8;
    background: #0f172a;
    border-bottom: 1px solid #334155;
}
.code-block pre {
    padding: 16px;
    margin: 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.7;
}
.code-block code {
    color: #e2e8f0;
    font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
    background: none;
    padding: 0;
}

/* ─── 定价页面 ─── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}
.pricing-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 24px;
    text-align: center;
    position: relative;
}
.pricing-popular {
    border: 2px solid var(--primary);
    transform: scale(1.05);
}
.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 2px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.pricing-card h3 { font-size: 20px; margin-bottom: 8px; }
.pricing-price {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 4px;
}
.pricing-price span { font-size: 16px; font-weight: 400; color: var(--text-secondary); }
.pricing-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.pricing-features {
    list-style: none;
    padding: 0;
    margin-bottom: 24px;
    text-align: left;
}
.pricing-features li {
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
}
.pricing-features li::before { content: "✓ "; color: var(--success); font-weight: 700; }

/* ─── 响应式 ─── */
@media (max-width: 768px) {
    .hero-features { grid-template-columns: repeat(2, 1fr); }
    .hero h1 { font-size: 32px; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .stats { flex-direction: column; }
    .page-header { flex-direction: column; }
    .toast-container { right: 12px; left: 12px; }
    .toast { max-width: 100%; }
    .demo-layout { grid-template-columns: 1fr; }
    .demo-upload { position: static; }
    .compare-row { flex-direction: column; }
    .compare-arrow { transform: rotate(90deg); }
    .pricing-grid { grid-template-columns: 1fr; }
    .pricing-popular { transform: none; }
}