/**
 * AI 写真 - 暖色轻奢风格
 * 移动端优先 + 分步向导式交互
 */

/* ==========================================================================
   暖色轻奢配色变量
   ========================================================================== */

:root {
    /* 暖色主色调 */
    --photo-primary: #E8B4B8;
    --photo-secondary: #D4A574;
    --photo-accent: #F5E6D3;
    --photo-highlight: #FFD4A3;

    /* 渐变 */
    --photo-gradient: linear-gradient(135deg, #E8B4B8 0%, #D4A574 50%, #F5E6D3 100%);
    --photo-gradient-soft: linear-gradient(180deg, rgba(232,180,184,0.08) 0%, rgba(212,165,116,0.03) 100%);
    --photo-gradient-button: linear-gradient(135deg, #E8B4B8 0%, #D4A574 100%);
    --photo-gradient-gold: linear-gradient(135deg, #D4A574 0%, #F5E6D3 50%, #D4A574 100%);

    /* 背景色（暗色模式） */
    --photo-bg: #1a1a1a;
    --photo-bg-card: rgba(255, 255, 255, 0.03);
    --photo-bg-hover: rgba(232, 180, 184, 0.1);
    --photo-bg-active: rgba(232, 180, 184, 0.15);

    /* 文字色 */
    --photo-text: #F5E6D3;
    --photo-text-secondary: rgba(245, 230, 211, 0.7);
    --photo-text-muted: rgba(245, 230, 211, 0.5);

    /* 边框 */
    --photo-border: rgba(232, 180, 184, 0.2);
    --photo-border-active: rgba(232, 180, 184, 0.5);

    /* 阴影 */
    --photo-shadow: 0 4px 24px rgba(232, 180, 184, 0.15);
    --photo-shadow-lg: 0 8px 48px rgba(232, 180, 184, 0.2);
    --photo-shadow-glow: 0 0 20px rgba(232, 180, 184, 0.3);
}

/* 亮色主题 */
[data-theme="light"] {
    --photo-bg: #FFF9F5;
    --photo-bg-card: rgba(232, 180, 184, 0.08);
    --photo-bg-hover: rgba(232, 180, 184, 0.15);
    --photo-bg-active: rgba(232, 180, 184, 0.2);
    --photo-text: #3D2C29;
    --photo-text-secondary: rgba(61, 44, 41, 0.7);
    --photo-text-muted: rgba(61, 44, 41, 0.5);
    --photo-border: rgba(232, 180, 184, 0.3);
    --photo-border-active: rgba(232, 180, 184, 0.6);
}

/* ==========================================================================
   页面基础布局
   ========================================================================== */

body.photo-wizard {
    background: var(--photo-bg);
    background-image: var(--photo-gradient-soft);
    min-height: 100vh;
}

body.photo-wizard .main-content {
    background: transparent;
}

body.photo-wizard .content-scroll {
    padding: 0;
    overflow: hidden;
}

/* ==========================================================================
   独立页面模式（无侧边栏）
   ========================================================================== */

body.photo-wizard.standalone {
    display: block;
}

body.photo-wizard.standalone .main-content {
    margin-left: 0;
    width: 100%;
}

body.photo-wizard.standalone .top-bar {
    left: 0;
    padding-left: 20px;
}

body.photo-wizard.standalone .wizard-progress {
    left: 0 !important;
}

body.photo-wizard.standalone .step-actions {
    left: 0 !important;
}

/* 品牌 Logo */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--photo-text);
}

.brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.brand-name {
    font-size: 18px;
    font-weight: 600;
    background: var(--photo-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.photo-wizard.standalone .page-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* ==========================================================================
   顶部进度条
   ========================================================================== */

.wizard-progress {
    position: fixed;
    top: var(--header-height, 56px);
    left: var(--sidebar-width, 260px);
    right: 0;
    padding: 16px 24px;
    background: linear-gradient(180deg, var(--photo-bg) 0%, transparent 100%);
    z-index: 50;
    transition: left 0.3s;
}

.progress-bar {
    height: 4px;
    background: var(--photo-border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--photo-gradient-button);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-indicators {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 10%;
}

.step-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--photo-border);
    transition: all 0.3s;
    cursor: pointer;
}

.step-dot.active {
    background: var(--photo-primary);
    box-shadow: var(--photo-shadow-glow);
    transform: scale(1.2);
}

.step-dot.completed {
    background: var(--photo-secondary);
}

/* ==========================================================================
   向导容器和步骤
   ========================================================================== */

.wizard-container {
    height: calc(100vh - var(--header-height, 56px));
    overflow: hidden;
    position: relative;
}

.wizard-step {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    padding: 80px 24px 120px;
}

.wizard-step.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.wizard-step.prev {
    transform: translateX(-30%);
    opacity: 0;
}

/* 步骤内容 */
.step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 0;
}

.step-content.fullscreen {
    max-width: 100%;
    padding: 0;
}

.step-title {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 12px;
    background: var(--photo-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-desc {
    font-size: 16px;
    color: var(--photo-text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* ==========================================================================
   步骤操作按钮
   ========================================================================== */

.step-actions {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width, 260px);
    right: 0;
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    background: linear-gradient(180deg, transparent 0%, var(--photo-bg) 30%);
    z-index: 60;
    transition: left 0.3s;
}

.btn-next,
.btn-confirm,
.btn-generate {
    padding: 14px 32px;
    background: var(--photo-gradient-button);
    border: none;
    border-radius: 28px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--photo-shadow);
}

.btn-next:hover,
.btn-confirm:hover,
.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: var(--photo-shadow-lg);
}

.btn-next:disabled,
.btn-confirm:disabled,
.btn-generate:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-prev,
.btn-retry {
    padding: 14px 24px;
    background: transparent;
    border: 1px solid var(--photo-border);
    border-radius: 28px;
    color: var(--photo-text);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-prev:hover,
.btn-retry:hover {
    background: var(--photo-bg-hover);
    border-color: var(--photo-border-active);
}

/* ==========================================================================
   人数选择
   ========================================================================== */

.person-select {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.person-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 20px;
    background: var(--photo-bg-card);
    border: 2px solid var(--photo-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.person-option i {
    font-size: 40px;
    color: var(--photo-text-muted);
    transition: all 0.3s;
}

.person-option span {
    font-size: 15px;
    color: var(--photo-text-secondary);
    font-weight: 500;
}

.person-option:hover {
    border-color: var(--photo-border-active);
    background: var(--photo-bg-hover);
}

.person-option.active {
    border-color: var(--photo-primary);
    background: var(--photo-bg-active);
    box-shadow: var(--photo-shadow);
}

.person-option.active i {
    color: var(--photo-primary);
}

.person-option.active span {
    color: var(--photo-text);
}

/* ==========================================================================
   照片上传
   ========================================================================== */

.upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.upload-card {
    position: relative;
    aspect-ratio: 3/4;
    background: var(--photo-bg-card);
    border: 2px dashed var(--photo-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
}

.upload-card:hover {
    border-color: var(--photo-border-active);
    background: var(--photo-bg-hover);
}

.upload-card.has-image {
    border-style: solid;
    border-color: var(--photo-primary);
}

.upload-card .upload-number {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 28px;
    height: 28px;
    background: var(--photo-gradient-button);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    z-index: 2;
}

.upload-card .upload-icon {
    font-size: 36px;
    color: var(--photo-text-muted);
    margin-bottom: 8px;
}

.upload-card .upload-label {
    font-size: 14px;
    color: var(--photo-text-muted);
}

.upload-card .preview-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-card .btn-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: all 0.2s;
}

.upload-card.has-image:hover .btn-remove {
    display: flex;
}

.upload-card .btn-remove:hover {
    background: rgba(220, 53, 69, 0.8);
}

.upload-tips {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 12px 20px;
    background: var(--photo-bg-card);
    border-radius: 12px;
    color: var(--photo-text-secondary);
    font-size: 14px;
}

.upload-tips i {
    color: var(--photo-secondary);
}

/* ==========================================================================
   风格轮播
   ========================================================================== */

.style-carousel {
    width: 100%;
    height: calc(100vh - 280px);
    min-height: 400px;
    position: relative;
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: grab;
}

.carousel-track:active {
    cursor: grabbing;
}

.style-card {
    flex: 0 0 80%;
    max-width: 360px;
    height: 100%;
    margin: 0 10%;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    transition: all 0.4s;
    opacity: 0.4;
    transform: scale(0.9);
}

.style-card.active {
    opacity: 1;
    transform: scale(1);
}

.style-card.selected {
    opacity: 1;
}

.style-card.selected .style-image {
    border: 3px solid var(--photo-primary);
    box-shadow: var(--photo-shadow-lg);
}

.style-image {
    flex: 1;
    border-radius: 24px;
    overflow: hidden;
    background: var(--photo-bg-card);
    position: relative;
}

.style-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.style-image .style-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--photo-text-muted);
}

.style-image .style-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
}

.style-name {
    margin-top: 16px;
    font-size: 20px;
    font-weight: 500;
    color: var(--photo-text);
    text-align: center;
}

.style-desc {
    margin-top: 8px;
    font-size: 14px;
    color: var(--photo-text-secondary);
    text-align: center;
}

.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--photo-border);
    transition: all 0.3s;
    cursor: pointer;
}

.carousel-dot.active {
    width: 24px;
    border-radius: 4px;
    background: var(--photo-primary);
}

/* ==========================================================================
   预览生成
   ========================================================================== */

.preview-container {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 3/4;
    background: var(--photo-bg-card);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loading-spinner.warm {
    width: 56px;
    height: 56px;
    border: 3px solid var(--photo-border);
    border-top-color: var(--photo-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.preview-loading p {
    color: var(--photo-text-secondary);
    font-size: 16px;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.credits-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 24px;
    background: var(--photo-bg-card);
    border-radius: 24px;
    color: var(--photo-text-secondary);
    font-size: 14px;
}

.credits-info i {
    color: var(--photo-secondary);
}

.credits-info strong {
    color: var(--photo-primary);
}

/* ==========================================================================
   批量选项
   ========================================================================== */

.batch-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
}

.batch-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    background: var(--photo-bg-card);
    border: 2px solid var(--photo-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.batch-option:hover {
    border-color: var(--photo-border-active);
    background: var(--photo-bg-hover);
}

.batch-option.active {
    border-color: var(--photo-primary);
    background: var(--photo-bg-active);
    box-shadow: var(--photo-shadow);
}

.batch-option.popular {
    border-color: var(--photo-secondary);
}

.batch-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    padding: 4px 12px;
    background: var(--photo-gradient-gold);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #3D2C29;
}

.batch-count {
    font-size: 24px;
    font-weight: 600;
    color: var(--photo-text);
}

.batch-credits {
    font-size: 14px;
    color: var(--photo-text-secondary);
}

/* ==========================================================================
   批量生成进度
   ========================================================================== */

.batch-progress {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 32px;
}

.batch-progress-bar {
    height: 8px;
    background: var(--photo-border);
    border-radius: 4px;
    overflow: hidden;
}

.batch-progress-fill {
    height: 100%;
    background: var(--photo-gradient-button);
    border-radius: 4px;
    transition: width 0.5s;
}

.batch-status {
    margin-top: 16px;
    font-size: 16px;
    color: var(--photo-text-secondary);
    text-align: center;
}

.batch-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.batch-preview-item {
    aspect-ratio: 3/4;
    border-radius: 12px;
    overflow: hidden;
    background: var(--photo-bg-card);
    animation: fadeIn 0.5s;
}

.batch-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   结果画廊
   ========================================================================== */

.result-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 24px;
}

.result-item {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.result-item:hover {
    transform: scale(1.02);
}

.result-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.result-item:hover .result-overlay {
    opacity: 1;
}

.result-item-actions {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.result-item:hover .result-item-actions {
    opacity: 1;
}

.result-item-actions button {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-item-actions button:hover {
    background: var(--photo-primary);
}

/* 结果操作按钮组 */
.result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.btn-download-all {
    padding: 14px 28px;
    background: var(--photo-gradient-button);
    border: none;
    border-radius: 28px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-download-all:hover {
    transform: translateY(-2px);
    box-shadow: var(--photo-shadow);
}

.btn-share,
.btn-new {
    padding: 14px 24px;
    background: transparent;
    border: 1px solid var(--photo-border);
    border-radius: 28px;
    color: var(--photo-text);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-share:hover,
.btn-new:hover {
    background: var(--photo-bg-hover);
    border-color: var(--photo-border-active);
}

/* ==========================================================================
   图片查看器
   ========================================================================== */

.photo-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.photo-viewer.active {
    display: flex;
}

.viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 100px;
}

.viewer-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 16px;
}

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.viewer-nav.prev {
    left: 20px;
}

.viewer-nav.next {
    right: 20px;
}

.viewer-actions {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
}

.viewer-actions button {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-actions button:hover {
    background: var(--photo-primary);
}

.viewer-dots {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.viewer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.viewer-dot.active {
    background: var(--photo-primary);
}

/* ==========================================================================
   移动端响应式
   ========================================================================== */

@media (max-width: 768px) {
    .wizard-progress {
        left: 0;
        padding: 12px 16px;
    }

    .step-actions {
        left: 0;
        padding: 20px 16px;
    }

    .wizard-step {
        padding: 60px 16px 100px;
    }

    .step-title {
        font-size: 24px;
    }

    .step-desc {
        font-size: 15px;
        margin-bottom: 24px;
    }

    .person-select {
        gap: 12px;
        max-width: 320px;
    }

    .person-option {
        padding: 20px 16px;
    }

    .person-option i {
        font-size: 32px;
    }

    .person-option span {
        font-size: 14px;
    }

    .upload-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .style-card {
        flex: 0 0 85%;
        margin: 0 7.5%;
        max-width: none;
    }

    .style-carousel {
        height: calc(100vh - 320px);
        min-height: 350px;
    }

    .preview-container {
        max-width: 300px;
    }

    .batch-options {
        gap: 12px;
    }

    .batch-option {
        padding: 20px;
    }

    .batch-count {
        font-size: 20px;
    }

    .result-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .result-actions {
        gap: 10px;
    }

    .btn-download-all,
    .btn-share,
    .btn-new {
        padding: 12px 20px;
        font-size: 14px;
    }

    .viewer-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .viewer-nav.prev {
        left: 10px;
    }

    .viewer-nav.next {
        right: 10px;
    }
}

/* 超小屏幕 */
@media (max-width: 375px) {
    .step-title {
        font-size: 22px;
    }

    .person-select {
        max-width: 280px;
    }

    .upload-grid {
        max-width: 280px;
    }

    .style-card {
        flex: 0 0 90%;
        margin: 0 5%;
    }
}

/* ==========================================================================
   侧边栏收起时
   ========================================================================== */

body.sidebar-collapsed .wizard-progress,
body.sidebar-collapsed .step-actions {
    left: 0;
}

/* 侧边栏打开时的遮罩 */
@media (max-width: 768px) {
    body.sidebar-open .wizard-progress,
    body.sidebar-open .step-actions {
        opacity: 0.3;
        pointer-events: none;
    }
}

/* ==========================================================================
   カスタマイズパネル
   ========================================================================== */

.customization-panel {
    width: 100%;
    max-width: 500px;
    margin: 20px auto 0;
    padding: 0 16px;
}

.customization-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--photo-gradient-button);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.customization-header i {
    background: var(--photo-gradient-button);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.customization-category {
    background: var(--photo-bg-card);
    border: 1px solid var(--photo-border);
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.customization-category.expanded {
    border-color: var(--photo-primary);
    box-shadow: var(--photo-shadow);
}

.category-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-header:hover {
    background: var(--photo-bg-hover);
}

.category-icon {
    width: 36px;
    height: 36px;
    background: var(--photo-gradient-button);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.category-icon i {
    font-size: 18px;
    color: #fff;
}

.category-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--photo-text);
}

.category-value {
    font-size: 13px;
    color: var(--photo-text-secondary);
    margin-right: 8px;
    padding: 4px 10px;
    background: var(--photo-bg-hover);
    border-radius: 20px;
}

.category-arrow {
    color: var(--photo-text-muted);
    transition: transform 0.3s;
}

.customization-category.expanded .category-arrow {
    transform: rotate(180deg);
}

.category-options {
    display: none;
    padding: 12px 16px 16px;
    background: rgba(0, 0, 0, 0.1);
    gap: 8px;
    flex-wrap: wrap;
}

.customization-category.expanded .category-options {
    display: flex;
}

.option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    min-width: 80px;
    background: var(--photo-bg-card);
    border: 1px solid var(--photo-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--photo-text-secondary);
}

.option-btn:hover {
    background: var(--photo-bg-hover);
    border-color: var(--photo-border-active);
}

.option-btn.active {
    background: var(--photo-gradient-button);
    border-color: transparent;
    color: #fff;
}

.option-btn i {
    font-size: 20px;
}

.option-btn span {
    font-size: 12px;
    white-space: nowrap;
}

.option-btn[style*="--option-color"]::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--option-color);
    position: absolute;
    top: 8px;
    right: 8px;
}

/* 画像サイズ表示 */
.upload-card .image-size {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    font-size: 11px;
    color: #fff;
    z-index: 2;
}

.upload-card .upload-hint {
    font-size: 11px;
    color: var(--photo-text-muted);
    margin-top: 4px;
}

/* ローディングスピナー (upload card) */
.upload-card.loading {
    pointer-events: none;
}

.upload-card .loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--photo-border);
    border-top-color: var(--photo-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* モバイル向け調整 */
@media (max-width: 480px) {
    .customization-panel {
        padding: 0 12px;
    }

    .option-btn {
        min-width: 70px;
        padding: 10px 12px;
    }

    .option-btn i {
        font-size: 18px;
    }

    .option-btn span {
        font-size: 11px;
    }

    .category-icon {
        width: 32px;
        height: 32px;
    }

    .category-icon i {
        font-size: 16px;
    }
}
