/* ── 品牌服装 AI 模特图生成系统 ── */

:root {
    --bg: #0e0e12;
    --surface: #18181f;
    --surface-hover: #22222c;
    --border: #2a2a36;
    --text: #e8e6e3;
    --text-muted: #8a8a9a;
    --accent: #c9a96e;
    --accent-light: #e0c98f;
    --success: #4ade80;
    --warning: #fbbf24;
    --error: #f87171;
    --radius: 12px;
    --font-body: 'Noto Sans SC', system-ui, sans-serif;
    --font-display: 'Playfair Display', serif;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* ── Header ── */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}
.logo span { color: var(--accent); }
.site-header nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color .2s;
}
.site-header nav a:hover { color: var(--accent); }

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 48px 0 24px;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.hero .accent { color: var(--accent); }
.subtitle {
    color: var(--text-muted);
    margin-top: 8px;
    font-size: 1.05rem;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
}
.form-card h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--accent-light);
}

/* ── Form ── */
label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 6px;
    margin-top: 16px;
    color: var(--text-muted);
}
label:first-of-type { margin-top: 0; }
.required { color: var(--error); }
.optional { color: var(--text-muted); font-weight: 300; font-size: 0.8rem; }

.input-full, select, input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: border-color .2s;
}
.input-full:focus, select:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--accent);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all .2s;
    font-family: var(--font-body);
}
.btn-primary {
    background: var(--accent);
    color: var(--bg);
    margin-top: 24px;
}
.btn-primary:hover { background: var(--accent-light); }
.btn-primary:disabled {
    opacity: .4;
    cursor: not-allowed;
}
.btn-secondary {
    background: var(--surface-hover);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); }
.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-outline:hover { color: var(--accent); border-color: var(--accent); }

/* ── Alerts ── */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.92rem;
    line-height: 1.5;
}
.alert-warning {
    background: rgba(251, 191, 36, .08);
    border: 1px solid rgba(251, 191, 36, .25);
    color: var(--warning);
}
.alert-error {
    background: rgba(248, 113, 113, .08);
    border: 1px solid rgba(248, 113, 113, .25);
    color: var(--error);
}
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    margin: 0 4px;
}
.badge-on { background: rgba(74, 222, 128, .15); color: var(--success); }
.badge-off { background: rgba(248, 113, 113, .15); color: var(--error); }

/* ── Stages grid (首页说明) ── */
.info-section {
    margin: 40px 0;
}
.info-section h2 {
    font-family: var(--font-display);
    text-align: center;
    margin-bottom: 24px;
    color: var(--accent-light);
}
.stages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}
.stage-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: border-color .2s;
}
.stage-card:hover { border-color: var(--accent); }
.stage-num {
    width: 40px; height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    margin: 0 auto 12px;
}
.stage-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.stage-card p { color: var(--text-muted); font-size: 0.88rem; }

/* ── Task detail ── */
.task-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 32px 0 16px;
}
.task-header h1 {
    font-family: var(--font-display);
    font-size: 1.6rem;
}
.task-header code {
    background: var(--surface);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
}
.status-badge {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}
.status-pending { background: rgba(138, 138, 154, .15); color: var(--text-muted); }
.status-running { background: rgba(201, 169, 110, .15); color: var(--accent); }
.status-completed { background: rgba(74, 222, 128, .15); color: var(--success); }
.status-failed { background: rgba(248, 113, 113, .15); color: var(--error); }

.meta-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.meta-row:last-child { border-bottom: none; }
.meta-label {
    width: 120px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.meta-value {
    color: var(--text);
    font-size: 0.9rem;
}
a.meta-value { color: var(--accent); text-decoration: none; }
a.meta-value:hover { text-decoration: underline; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 600px;
}

/* ── Timeline ── */
.stages-timeline {
    margin: 24px 0;
    padding-left: 24px;
    border-left: 2px solid var(--border);
}
.timeline-item {
    position: relative;
    padding: 12px 0 12px 24px;
}
.timeline-dot {
    position: absolute;
    left: -31px;
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--border);
    border: 2px solid var(--bg);
}
.timeline-pending .timeline-dot { background: var(--text-muted); }
.timeline-running .timeline-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.timeline-completed .timeline-dot { background: var(--success); }
.timeline-failed .timeline-dot { background: var(--error); }

.timeline-content h3 {
    font-size: 0.95rem;
    font-weight: 500;
    display: inline;
}
.stage-status {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: 8px;
    text-transform: uppercase;
}
.stage-link {
    display: block;
    color: var(--accent);
    font-size: 0.82rem;
    margin-top: 4px;
    text-decoration: none;
}
.stage-link:hover { text-decoration: underline; }
.stage-error {
    color: var(--error);
    font-size: 0.82rem;
    margin-top: 4px;
}

/* ── Spinner ── */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result ── */
.result-section h2 {
    font-family: var(--font-display);
    color: var(--accent-light);
    margin-bottom: 16px;
}
.result-image-wrap {
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
    text-align: center;
}
.result-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.back-link { margin: 24px 0 48px; }

/* ── Footer ── */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 20px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}
