* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 222, 189, 0.55), transparent 30%),
        radial-gradient(circle at right center, rgba(189, 224, 255, 0.45), transparent 32%),
        linear-gradient(180deg, #f7f4ef 0%, #eef4f8 100%);
    color: #1f2937;
}

.dh-section {
    padding: 24px 20px 56px;
}

.video-gen-container {
    max-width: 1240px;
    margin: 0 auto;
}

.breadcrumb {
    margin-top: 70px;
    margin-bottom: 20px;
    color: #64748b;
    font-size: 14px;
}

.breadcrumb a {
    color: #64748b;
    text-decoration: none;
}

.main-title {
    margin: 0;
    text-align: center;
    font-size: 44px;
    line-height: 1.1;
    letter-spacing: -0.04em;
    color: #172033;
}

.sub-title {
    margin: 14px auto 36px;
    max-width: 760px;
    text-align: center;
    color: #52607a;
    font-size: 17px;
    line-height: 1.7;
    font-weight: 500;
}

.studio-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.78fr);
    gap: 24px;
    align-items: start;
}

.workflow-panel,
.preview-card {
    border: 1px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(16, 24, 40, 0.08);
}

.workflow-panel {
    border-radius: 28px;
    padding: 22px;
}

.workflow-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.workflow-step {
    border: 1px solid #dbe5ef;
    background: #f8fafc;
    color: #64748b;
    border-radius: 999px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.workflow-step.active {
    background: linear-gradient(135deg, #f97316, #fb7185);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 12px 30px rgba(249, 115, 22, 0.25);
}

.step-panel {
    display: none;
}

.step-panel.active {
    display: block;
}

.step-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.step-header h3 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.15;
    color: #172033;
}

.step-header p {
    margin: 0;
    color: #64748b;
    line-height: 1.7;
}

.step-tag {
    flex-shrink: 0;
    background: #fff1e8;
    color: #c2410c;
    border-radius: 999px;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.input-grid {
    display: grid;
    gap: 16px;
}

.input-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    position: relative;
    margin-bottom: 18px;
}

.field label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #344054;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid #dbe5ef;
    background: #fff;
    border-radius: 18px;
    padding: 15px 16px;
    font-size: 15px;
    color: #172033;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: #fb7185;
    box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.12);
}

.field textarea {
    min-height: 110px;
    resize: vertical;
    line-height: 1.7;
}

.product-upload-box {
    border: 1.5px dashed #fdba74;
    background: linear-gradient(180deg, #fffaf5 0%, #ffffff 100%);
    border-radius: 24px;
    min-height: 180px;
    padding: 12px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.product-image-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.product-upload-btn {
    border: none;
    border-radius: 18px;
    min-height: 150px;
    background: #fff7ed;
    color: #c2410c;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 20px;
    width: calc(50% - 5px);
}

.product-upload-btn.full-width {
    width: 100%;
}

.product-upload-btn i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #fed7aa;
    font-style: normal;
    font-size: 24px;
}

.product-thumb {
    position: relative;
    width: calc(50% - 5px);
    aspect-ratio: 1;
    border-radius: 18px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e6edf5;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumb-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.char-count {
    position: absolute;
    right: 16px;
    bottom: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 10px;
}

.point-hint {
    font-size: 13px;
    color: #94a3b8;
}

.point-hint a {
    color: #E91E63;
    text-decoration: none;
}

.point-hint a:hover {
    text-decoration: underline;
}

.actions-inline {
    justify-content: flex-start;
}

.btn {
    border: none;
    border-radius: 18px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #f97316, #fb7185);
    color: #fff;
    box-shadow: 0 12px 28px rgba(249, 115, 22, 0.18);
}

.btn-secondary {
    background: #f8fafc;
    color: #475467;
    border: 1px solid #dbe5ef;
}

.btn-dark {
    background: #172033;
    color: #fff;
}

.script-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.hint-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    font-size: 13px;
    font-weight: 700;
}

.text-btn {
    border: none;
    background: transparent;
    color: #f97316;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.script-list {
    display: grid;
    gap: 16px;
}

.script-card {
    border: 1px solid #e6edf5;
    background: #fcfdff;
    border-radius: 22px;
    padding: 16px;
}

.script-card-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: #172033;
    font-size: 14px;
    font-weight: 800;
}

.script-item {
    width: 100%;
    min-height: 110px;
    border: none;
    background: transparent;
    resize: vertical;
    outline: none;
    font-size: 15px;
    line-height: 1.7;
    color: #344054;
}

.mode-switch {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.mode-btn {
    flex: 1;
    border: 1px solid #dbe5ef;
    border-radius: 18px;
    background: #f8fafc;
    color: #52607a;
    font-size: 14px;
    font-weight: 700;
    padding: 14px 16px;
    cursor: pointer;
}

.mode-btn.active {
    background: #172033;
    color: #fff;
    border-color: #172033;
}

.avatar-mode-panel {
    display: none;
}

.avatar-mode-panel.active {
    display: block;
}

.upload-card {
    position: relative;
    border: 1.5px dashed #f97316;
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
    border-radius: 24px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
}

.upload-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 24px;
    color: #9a3412;
}

.upload-copy strong {
    font-size: 18px;
}

.upload-copy span {
    max-width: 280px;
    line-height: 1.7;
    color: #7c2d12;
}

.upload-preview {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-library {
    border: 1px solid #e6edf5;
    border-radius: 24px;
    background: #fcfdff;
    padding: 14px;
}

.avatar-library-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.avatar-library-empty {
    display: none;
    padding: 24px 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

.avatar-library-item {
    position: relative;
    border: 1px solid #e6edf5;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 3 / 4;
    background: #f8fafc;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.avatar-library-item:hover {
    transform: translateY(-1px);
}

.avatar-library-item.active {
    border-color: #fb7185;
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.16);
}

.avatar-library-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-library-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: none;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(23, 32, 51, 0.88);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.avatar-library-item.active .avatar-library-badge {
    display: inline-flex;
}

.avatar-load-more {
    display: none;
    margin-top: 14px;
    width: 100%;
}

.summary-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
    margin-bottom: 18px;
}

.summary-item {
    background: #f8fafc;
    border: 1px solid #e6edf5;
    border-radius: 20px;
    padding: 16px;
}

.summary-item span {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #64748b;
}

.summary-item strong {
    color: #172033;
    font-size: 18px;
}

.preview-panel {
    position: sticky;
    top: 20px;
}

.preview-card {
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    padding: 22px;
    max-height: calc(100vh - 40px);
    overflow: hidden;
}

.preview-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 18px;
}

.preview-body::-webkit-scrollbar {
    width: 8px;
}

.preview-body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
}

.preview-head h3 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #172033;
}

.preview-head p {
    margin: 0;
    color: #64748b;
    line-height: 1.7;
}

.preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 220px;
    color: #94a3b8;
}

.preview-empty-icon {
    font-size: 54px;
    color: #f97316;
    opacity: 0.3;
    margin-bottom: 18px;
}

.avatar-stage,
.progress-section,
.result-section {
    display: none;
}

.avatar-stage {
    margin-top: 0;
}

.avatar-stage-head,
.progress-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.avatar-stage-head span,
.progress-title-row h4 {
    font-size: 15px;
    font-weight: 800;
    color: #172033;
    margin: 0;
}

.progress-title-row span {
    font-size: 13px;
    color: #64748b;
}

.avatar-display,
.result-card {
    position: relative;
    width: 100%;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(180deg, #e2e8f0 0%, #f8fafc 100%);
}

.ratio-9-16 {
    aspect-ratio: 9 / 16;
}

.ratio-16-9 {
    aspect-ratio: 16 / 9;
}

.avatar-display img,
.result-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.progress-section {
    margin-top: 18px;
}

.progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #f97316, #fb7185);
    transition: width 0.4s ease;
}

.stage-list {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.stage-item {
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid #e6edf5;
    padding: 12px 14px;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

.stage-item.active {
    border-color: #fdba74;
    background: #fff7ed;
    color: #c2410c;
}

.stage-item.done {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.result-section {
    margin-top: 18px;
}

.result-section.is-pending {
    display: block;
}

.result-card.is-pending {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    background: linear-gradient(180deg, #edf2f7 0%, #f8fafc 100%);
}

.result-placeholder {
    display: none;
    padding: 24px;
    text-align: center;
    color: #64748b;
    line-height: 1.8;
    font-size: 14px;
}

.result-card.is-pending .result-placeholder {
    display: block;
}

.result-card.is-pending video {
    display: none;
}

.download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 14px;
    width: 100%;
    text-decoration: none;
    border-radius: 16px;
    padding: 14px 16px;
    background: #172033;
    color: #fff;
    font-weight: 700;
}

.seo-brief {
    padding: 0 20px 56px;
}

.seo-brief-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.seo-brief article {
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    padding: 24px;
}

.seo-brief h2 {
    margin: 0 0 12px;
    font-size: 22px;
    color: #172033;
}

.seo-brief p {
    margin: 0;
    line-height: 1.8;
    color: #52607a;
}

@media (max-width: 1100px) {
    .studio-shell {
        grid-template-columns: 1fr;
    }

    .preview-panel {
        position: static;
    }

    .preview-card {
        max-height: none;
    }

    .preview-body {
        overflow: visible;
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .dh-section {
        padding-left: 14px;
        padding-right: 14px;
    }

    .breadcrumb {
        margin-top: 30px;
    }

    .main-title {
        font-size: 34px;
    }

    .sub-title {
        font-size: 15px;
        margin-bottom: 26px;
    }

    .workflow-panel,
    .preview-card {
        border-radius: 22px;
        padding: 16px;
    }

    .studio-shell.is-step-3 .preview-panel {
        order: -1;
    }

    .workflow-nav,
    .input-grid-2,
    .summary-card,
    .seo-brief-inner {
        grid-template-columns: 1fr;
    }

    .step-header {
        flex-direction: column;
    }

    .mode-switch,
    .actions {
        flex-direction: column;
    }

    .avatar-library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-upload-btn,
    .product-thumb {
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}
