﻿* { margin: 0; padding: 0; box-sizing: border-box; }
        body {
            font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
            background: #f0f2f6;
            min-height: 100vh;
            padding: 24px;
        }
        .app-wrapper { max-width: 1600px; margin: 0 auto; background: transparent; }
        .top-nav {
            background: white;
            border-radius: 60px;
            padding: 8px 24px;
            margin-bottom: 28px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            box-shadow: 0 4px 12px rgba(0,0,0,0.04);
        }
        .nav-links { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
        .nav-links a {
            text-decoration: none;
            color: #1e293b;
            font-weight: 500;
            font-size: 14px;
            padding: 6px 0;
            border-bottom: 2px solid transparent;
        }
        .nav-links a.active { color: #3b82f6; border-bottom-color: #3b82f6; }
        .nav-links a.hot::after { content: "Hot"; background: #ef4444; color: white; font-size: 10px; border-radius: 20px; padding: 2px 6px; margin-left: 6px; vertical-align: middle; }
        .nav-links a.new::after { content: "New"; background: #10b981; color: white; font-size: 10px; border-radius: 20px; padding: 2px 6px; margin-left: 6px; }
        .user-area { display: flex; align-items: center; gap: 16px; }
        .vip-badge {
            background: linear-gradient(135deg, #f59e0b, #ef4444);
            color: white;
            border-radius: 40px;
            padding: 6px 16px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
        }
        .user-menu-btn {
            background: #3b82f6;
            color: white;
            border: none;
            border-radius: 40px;
            padding: 6px 20px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .flow-hero {
            display: grid;
            grid-template-columns: minmax(0, 1.3fr) minmax(360px, 0.9fr);
            gap: 24px;
            align-items: center;
            background: linear-gradient(135deg, #ffffff 0%, #eef6ff 55%, #fff7ed 100%);
            border: 1px solid rgba(148,163,184,0.18);
            border-radius: 28px;
            padding: 28px 32px;
            margin-bottom: 24px;
            box-shadow: 0 18px 45px rgba(15,23,42,0.07);
        }
        .flow-eyebrow {
            display: inline-flex;
            align-items: center;
            color: #2563eb;
            background: rgba(37,99,235,0.09);
            border: 1px solid rgba(37,99,235,0.18);
            border-radius: 999px;
            padding: 5px 12px;
            font-size: 12px;
            font-weight: 800;
            margin-bottom: 12px;
        }
        .flow-hero h1 {
            font-size: 34px;
            line-height: 1.18;
            color: #0f172a;
            margin: 0 0 10px;
            letter-spacing: 0;
        }
        .flow-hero p {
            color: #475569;
            font-size: 15px;
            line-height: 1.7;
            max-width: 720px;
        }
        .flow-progress {
            display: grid;
            grid-template-columns: 1fr 42px 1fr;
            align-items: center;
            gap: 10px;
            background: rgba(255,255,255,0.72);
            border: 1px solid rgba(148,163,184,0.2);
            border-radius: 20px;
            padding: 14px;
        }
        .flow-progress-item {
            min-height: 94px;
            border-radius: 16px;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            color: inherit;
            padding: 14px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            text-align: left;
            box-shadow: none;
        }
        .flow-progress-item:hover:not(:disabled) {
            background: #eef6ff;
            color: inherit;
            transform: translateY(-1px);
        }
        .flow-progress-item span {
            width: 30px;
            height: 30px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 999px;
            background: #e2e8f0;
            color: #334155;
            font-weight: 900;
            font-size: 13px;
        }
        .flow-progress-item.active {
            background: #eff6ff;
            border-color: rgba(59,130,246,0.32);
        }
        .flow-progress-item.active span {
            background: #2563eb;
            color: white;
        }
        .flow-progress-item strong {
            color: #0f172a;
            font-size: 15px;
        }
        .flow-progress-item em {
            color: #64748b;
            font-size: 12px;
            font-style: normal;
            line-height: 1.4;
        }
        .flow-progress-line {
            height: 2px;
            background: linear-gradient(90deg, #60a5fa, #f97316);
            border-radius: 99px;
        }
        .workflow-steps {
            display: block;
        }
        .workflow-page {
            display: none;
            width: 100%;
            background: white;
            border-radius: 28px;
            padding: 24px;
        }
        .workflow-page.active {
            display: block;
        }
        .step-card {
            border: 1px solid rgba(148,163,184,0.18);
            box-shadow: 0 18px 42px rgba(15,23,42,0.08);
        }
        .step-card-header {
            display: flex;
            align-items: flex-start;
            gap: 14px;
            border-bottom: 1px solid #e2e8f0;
            padding-bottom: 18px;
            margin-bottom: 22px;
        }
        .step-index {
            width: 48px;
            height: 48px;
            border-radius: 14px;
            background: #0f172a;
            color: white;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 15px;
            font-weight: 900;
            flex-shrink: 0;
        }
        .step-card-header h2 {
            font-size: 22px;
            color: #0f172a;
            margin: 0 0 6px;
        }
        .step-card-header p {
            color: #64748b;
            font-size: 13px;
            line-height: 1.6;
        }
        .step-card-video .step-index { background: #4f46e5; }
        .step-content-grid {
            display: grid;
            grid-template-columns: minmax(340px, 0.88fr) minmax(520px, 1.12fr);
            gap: 24px;
            align-items: start;
        }
        .video-grid {
            grid-template-columns: minmax(360px, 0.82fr) minmax(560px, 1.18fr);
        }
        .params-panel,
        .result-prompt-panel {
            border: 1px solid #e2e8f0;
            border-radius: 20px;
            background: #fbfdff;
            padding: 24px;
            min-width: 0;
        }
        .result-prompt-panel {
            background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 12px 30px rgba(15,23,42,0.04);
        }
        .panel-title {
            display: inline-flex;
            align-items: center;
            height: 28px;
            padding: 0 10px;
            margin-bottom: 18px;
            border-radius: 999px;
            background: #e0f2fe;
            color: #075985;
            font-size: 12px;
            font-weight: 800;
        }
        .param-group { margin-bottom: 26px; }
        .param-group:last-child { margin-bottom: 0; }
        .param-group h3 {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 16px;
            color: #0f172a;
            display: flex;
            align-items: center;
            gap: 8px;
            border-left: 3px solid #3b82f6;
            padding-left: 12px;
        }
        .field-hint {
            font-size: 12px;
            color: #64748b;
            line-height: 1.6;
            margin-top: 6px;
        }
        .grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
        .form-field { margin-bottom: 16px; }
        .form-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: #334155; }
        select, input, textarea {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #e2e8f0;
            border-radius: 16px;
            font-size: 14px;
            background: #f8fafc;
            transition: 0.2s;
        }
        select:focus, input:focus, textarea:focus {
            outline: none;
            border-color: #3b82f6;
            box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
        }
        .upload-area {
            border: 2px dashed #cbd5e1;
            background: #f8fafc;
            padding: 20px;
            text-align: center;
            border-radius: 20px;
            cursor: pointer;
            transition: 0.2s;
            margin-bottom: 12px;
        }
        .upload-area:hover { border-color: #3b82f6; background: #eff6ff; }
        .preview-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
        .preview-card {
            width: 100px;
            background: #f1f5f9;
            border-radius: 16px;
            padding: 8px;
            text-align: center;
            position: relative;
        }
        .preview-card img { width: 100%; height: 100px; object-fit: cover; border-radius: 12px; }
        .material-ref-strip {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin: 8px 0;
        }
        .material-ref-chip {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            max-width: 260px;
            border: 1px solid rgba(249, 115, 22, 0.45);
            background: rgba(249, 115, 22, 0.12);
            color: #9a3412;
            border-radius: 8px;
            padding: 6px 8px;
            font-size: 12px;
            font-weight: 700;
            cursor: pointer;
        }
        .material-ref-chip:hover {
            border-color: #f97316;
            background: rgba(249, 115, 22, 0.18);
        }
        .material-ref-thumb {
            width: 30px;
            height: 30px;
            border-radius: 6px;
            object-fit: cover;
            background: rgba(255,255,255,0.6);
            flex-shrink: 0;
        }
        .material-ref-token {
            display: inline-flex;
            align-items: center;
            border: 1px solid rgba(249, 115, 22, 0.55);
            background: rgba(249, 115, 22, 0.15);
            color: #c2410c;
            border-radius: 6px;
            padding: 2px 6px;
            font-size: 12px;
            font-weight: 800;
            line-height: 1.2;
        }
        .material-ref-meta {
            min-width: 0;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .material-ref-title {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .material-ref-kind {
            color: #64748b;
            font-size: 11px;
            font-weight: 600;
        }
        .prompt-token-preview {
            display: none;
            margin-top: 6px;
            padding: 8px 10px;
            border: 1px solid #e2e8f0;
            border-radius: 10px;
            background: #fff7ed;
            color: #334155;
            font-size: 12px;
            line-height: 1.8;
            max-height: 86px;
            overflow: auto;
            white-space: pre-wrap;
        }
        .prompt-token-preview.show { display: block; }
        button {
            background: #3b82f6;
            color: white;
            border: none;
            border-radius: 40px;
            padding: 10px 24px;
            font-weight: 600;
            font-size: 14px;
            cursor: pointer;
            transition: 0.2s;
        }
        button:hover:not(:disabled) { background: #2563eb; transform: translateY(-1px); }
        button:disabled { background: #cbd5e1; cursor: not-allowed; }
        .material-ref-strip .material-ref-chip {
            background: rgba(249, 115, 22, 0.12);
            color: #9a3412;
            border: 1px solid rgba(249, 115, 22, 0.45);
            border-radius: 8px;
            padding: 6px 8px;
            box-shadow: none;
        }
        .material-ref-strip .material-ref-chip:hover:not(:disabled) {
            background: rgba(249, 115, 22, 0.18);
            border-color: #f97316;
            color: #9a3412;
        }
        .btn-block { width: 100%; margin-top: 8px; }
        .btn-primary {
            background: linear-gradient(135deg, #7c3aed, #2563eb);
            box-shadow: 0 12px 24px rgba(37,99,235,0.24);
        }
        .btn-primary:hover:not(:disabled) {
            background: linear-gradient(135deg, #6d28d9, #1d4ed8);
        }
        .primary-action-row {
            display: grid;
            grid-template-columns: minmax(220px, 1fr) auto;
            gap: 12px;
            align-items: center;
            margin-bottom: 14px;
        }
        .primary-action-row .btn-block { margin-top: 0; min-height: 52px; }
        .secondary-action-btn {
            min-height: 52px;
            background: #64748b;
            white-space: nowrap;
            box-shadow: 0 10px 22px rgba(100,116,139,0.18);
        }
        .inline-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-top: 10px;
        }
        .apply-main-image-btn {
            min-height: 42px;
            box-shadow: 0 10px 20px rgba(16,185,129,0.2);
        }
        .result-first-panel {
            padding: 18px;
            border: 1px solid rgba(59,130,246,0.16);
            border-radius: 18px;
            background: linear-gradient(180deg, #f8fbff 0%, #ffffff 64%);
            box-shadow: 0 14px 32px rgba(15,23,42,0.06);
        }
        .result-first-panel h3 {
            margin-bottom: 14px;
        }
        .current-main-image {
            margin-top: 10px;
            padding: 10px 12px;
            border-radius: 12px;
            background: #ecfdf5;
            border: 1px solid rgba(16,185,129,0.22);
            color: #047857;
            font-size: 12px;
            line-height: 1.5;
        }
        .media-result-stage,
        .video-result-stage {
            min-height: 260px;
            background:
                linear-gradient(135deg, rgba(37,99,235,0.04), rgba(16,185,129,0.03)),
                #f8fafc;
            border: 1px dashed #bfdbfe;
            border-radius: 20px;
            padding: 18px;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #94a3b8;
            font-size: 18px;
            font-weight: 700;
        }
        .media-result-stage:empty::before { content: "定妆图会显示在这里"; }
        .media-result-stage img {
            max-width: min(320px, 100%);
            max-height: 500px;
            border-radius: 16px;
            object-fit: contain;
            box-shadow: 0 12px 28px rgba(15,23,42,0.14);
        }
        .script-action-row {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
            margin-top: 4px;
            margin-bottom: 10px;
        }
        .script-action-row span {
            color: #f59e0b;
            font-size: 12px;
            font-weight: 700;
        }
        .video-generate-btn {
            margin-top: 0;
            background: linear-gradient(135deg, #4f46e5, #0ea5e9);
            min-height: 52px;
            font-size: 15px;
            box-shadow: 0 12px 26px rgba(79,70,229,0.24);
        }
        .video-generate-btn:hover:not(:disabled) {
            background: linear-gradient(135deg, #4338ca, #0284c7);
        }
        .video-result-panel {
            border: 1px solid #e2e8f0;
            border-radius: 18px;
            padding: 18px;
            background: #f8fafc;
            margin-bottom: 24px;
        }
        .result-panel-heading {
            display: grid;
            grid-template-columns: minmax(120px, auto) minmax(220px, 1fr);
            gap: 14px;
            align-items: center;
            margin-bottom: 14px;
        }
        .video-result-panel h3,
        .result-panel-heading h3 {
            font-size: 18px;
            margin-bottom: 0;
            color: #0f172a;
        }
        .video-result-stage {
            min-height: 320px;
            border-style: solid;
            align-items: center;
        }
        .video-result-stage:empty::before { content: "生成的视频会显示在这里"; }
        .video-result-stage video {
            max-height: 560px;
            background: #0f172a;
        }
        .upload-inline-row {
            display: grid;
            grid-template-columns: auto minmax(180px, 1fr) auto;
            gap: 8px;
            align-items: center;
        }
        .upload-inline-row button {
            white-space: nowrap;
        }
        .upload-inline-row input {
            min-width: 0;
        }
        .voiceover-control {
            display: grid;
            grid-template-columns: auto minmax(220px, 1fr);
            align-items: center;
            gap: 12px;
        }
        .voiceover-control label {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            white-space: nowrap;
            color: #334155;
            font-size: 13px;
            font-weight: 700;
        }
        .voiceover-control textarea {
            width: 100%;
            min-height: 42px;
            resize: vertical;
        }
        .video-library-panel {
            margin-top: 16px;
        }
        .btn-success { background: #10b981; }
        .result-video { margin-top: 20px; border-radius: 20px; overflow: hidden; }
        .loader {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 2px solid #e2e8f0;
            border-radius: 50%;
            border-top-color: #3b82f6;
            animation: spin 0.7s linear infinite;
            margin-right: 8px;
            vertical-align: middle;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .user-dropdown {
            position: absolute;
            top: 80px;
            right: 30px;
            background: white;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            width: 260px;
            padding: 20px;
            z-index: 1000;
            display: none;
        }
        .user-dropdown.show { display: block; }
        .voiceover-control {
            background: #f1f5f9;
            border-radius: 20px;
            padding: 12px;
            margin: 12px 0;
        }
        .slider-container {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-top: 8px;
        }
        .slider-container input { flex: 1; }
        .randomness-value {
            background: #e2e8f0;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 600;
            min-width: 60px;
            text-align: center;
        }
        @media (max-width: 1000px) { 
    body { padding: 16px; }
    .flow-hero,
    .step-content-grid,
    .video-grid {
        grid-template-columns: 1fr;
    }
    .flow-progress {
        grid-template-columns: 1fr;
    }
    .flow-progress-line {
        width: 2px;
        height: 24px;
        justify-self: center;
    }
    .primary-action-row {
        grid-template-columns: 1fr;
    }
    .result-panel-heading {
        grid-template-columns: 1fr;
    }
    .secondary-action-btn {
        width: 100%;
    }
    .upload-inline-row,
    .voiceover-control {
        grid-template-columns: 1fr;
    }
}


/* ==================== 充值积分弹窗 ==================== */
.recharge-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
}
.recharge-dialog {
    background: #fff;
    border-radius: 1.25rem;
    width: 100%;
    max-width: 420px;
    padding: 1.75rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}
.recharge-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
}
.recharge-title {
    margin: 0 0 0.25rem;
    font-size: 1.3rem;
    text-align: center;
}
.recharge-rate {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    margin: 0 0 1.25rem;
}
.recharge-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
.recharge-amount {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.65rem 0.25rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
    color: #1e293b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.recharge-amount small {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 400;
}
.recharge-amount.active {
    border-color: #10b981;
    background: #ecfdf5;
    color: #047857;
}
.recharge-amount.active small { color: #059669; }
.recharge-custom {
    margin: 1rem 0;
}
.recharge-custom label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.35rem;
}
.recharge-custom input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.6rem;
    font-size: 1rem;
    box-sizing: border-box;
}
.recharge-paytype {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.recharge-pay-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
}
.recharge-pay-option.active {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #1d4ed8;
}
.recharge-confirm,
.recharge-back {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.7rem;
    background: #10b981;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}
.recharge-back {
    background: #f1f5f9;
    color: #475569;
    margin-top: 1rem;
}
.recharge-confirm:disabled { opacity: 0.6; cursor: not-allowed; }
.recharge-qr-tip {
    color: #334155;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.recharge-qr-box {
    width: 220px;
    height: 220px;
    margin: 0 auto 1rem;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.recharge-qr-box img,
.recharge-qr-box canvas { display: block; }
.recharge-status {
    font-size: 0.95rem;
    color: #f59e0b;
    font-weight: 600;
    min-height: 1.4rem;
}
.recharge-status.paid { color: #10b981; }
.recharge-status.failed { color: #ef4444; }
