/* 智能换发型工具样式 */

/* 剪刀光标 */
.hair-studio-container,
.customize-container,
.hairstyle-card,
.color-card {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23667eea" stroke-width="2"><circle cx="6" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><line x1="20" y1="4" x2="8.12" y2="15.88"/><line x1="14.47" y1="14.48" x2="20" y2="20"/><line x1="8.12" y1="8.12" x2="12" y2="12"/></svg>'), auto;
}

/* 浮动装饰元素 */
.floating-scissors {
    position: fixed;
    font-size: 2rem;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
    animation: float 6s ease-in-out infinite;
}

.floating-scissors-1 {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.floating-scissors-2 {
    top: 60%;
    right: 8%;
    animation-delay: 2s;
    animation-duration: 7s;
}

.floating-scissors-3 {
    bottom: 20%;
    left: 15%;
    animation-delay: 4s;
    animation-duration: 8s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(-10px) rotate(-5deg);
    }
    75% {
        transform: translateY(-30px) rotate(3deg);
    }
}

/* 基础容器 */
.hair-studio-container {
    min-height: 100vh;
    padding: 60px 24px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    gap: 22px;
    box-sizing: border-box;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
}

#app-container {
    flex: 1;
    max-width: 1150px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.studio-header {
    position: sticky;
    top: 90px;
    min-width: 120px;
    color: white;
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 18px 14px;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.studio-header h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 6px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.studio-header p {
    display: none;
}

/* 阶段容器 */
.stage-container {
    display: none;
    width: 100%;
}

.stage-container.active {
    display: block;
}

/* 上传阶段样式 */
.upload-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.upload-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    color: white;
}

.upload-card h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 1rem;
}

.upload-tips {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #555;
    font-size: 0.95rem;
}

.tip-item:last-child {
    margin-bottom: 0;
}

.tip-item i {
    color: #667eea;
    font-size: 1.1rem;
}

.image-preview {
    margin-top: 20px;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 15px 40px;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* 定制阶段样式 */
.customize-container {
    display: grid;
    grid-template-columns: 450px minmax(0, 1fr);
    gap: 20px;
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
}

.photo-preview {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.preview-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.photo-preview img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

.generated-result {
    margin-top: 20px;
}

.generated-result img {
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

.customize-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 功能亮点 */
.feature-highlights {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.feature-item {
    flex: 1;
    min-width: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.feature-item i {
    font-size: 1rem;
}

.customize-options h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.customize-options h3 {
    font-size: 1.1rem;
    margin: 16px 0 8px;
    color: #333;
}

.option-card {
    background: #f9fafb;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.option-card .section-header h3 {
    font-size: 1rem;
    color: #2d3748;
    font-weight: 600;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.section-header h2,
.section-header h3 {
    margin: 0;
    color: #2d3748;
}

.section-header p {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
}

.section-header--compact {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.section-header--inline {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
}

.optional-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(102, 126, 234, 0.15);
    color: #4c51bf;
}

/* 搜索框 */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.tab-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* 发型网格 */
.hairstyle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
    max-height: 450px;
    overflow-y: auto;
    padding: 4px;
}

.hairstyle-card {
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hairstyle-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.hairstyle-card.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.hairstyle-card img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.hairstyle-info {
    padding: 8px;
    background: white;
    text-align: center;
}

.hairstyle-info h4 {
    font-size: 0.85rem;
    margin: 0;
    color: #333;
    font-weight: 500;
}

/* 发色选择区域 */
.color-section {
    background: #f0f4ff;
    border-radius: 10px;
    padding: 12px;
    margin-top: 10px;
    border: 2px solid #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.color-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.color-section .section-header h3 {
    margin: 0;
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
}

.btn-close-color {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px 8px;
    transition: color 0.3s ease;
}

.btn-close-color:hover {
    color: #667eea;
}

/* 发色网格 */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 2px;
}

.color-card {
    cursor: pointer;
    border-radius: 8px;
    padding: 4px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.color-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-card.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

.color-card img {
    width: 100%;
    height: 45px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 4px;
}

.color-card h4 {
    font-size: 0.65rem;
    margin: 0;
    color: #333;
    font-weight: 500;
    line-height: 1.2;
}

/* 自定义描述区域 */
.custom-prompt-section {
    margin-top: 12px;
}

.custom-prompt-section .section-header {
    margin-bottom: 8px;
}

.custom-prompt-section .section-header h3 {
    font-size: 0.95rem;
    margin: 0 0 4px 0;
    color: #333;
}

.custom-prompt-section .section-header p {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

/* 自定义输入 */
textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    min-height: 60px;
    max-height: 100px;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* 生成按钮区域 */
.generate-actions {
    margin-top: 12px;
    position: sticky;
    bottom: 0;
    background: white;
    padding: 10px 0;
    z-index: 10;
}

.btn-generate {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 14px;
    font-size: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

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

/* 加载指示器 */
.loading-indicator {
    text-align: center;
    padding: 30px;
    margin-top: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    color: #666;
    font-size: 1rem;
}

/* 结果展示阶段样式 */
.result-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.result-container h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #333;
}

.result-comparison {
    margin-bottom: 30px;
}

.result-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 600px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 400px;
}

.result-image-wrapper::before {
    content: '图片加载中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    z-index: 1;
}

.result-image-wrapper img {
    width: 100%;
    display: block;
    position: relative;
    z-index: 2;
}

.comparison-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.comparison-overlay.active {
    opacity: 1;
}

.comparison-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
}

/* 结果操作按钮 */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn-download, .btn-share, .btn-retry {
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-share {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-share:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(240, 147, 251, 0.4);
}

.btn-retry {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-retry:hover {
    background: #667eea;
    color: white;
}

/* 结果信息 */
.result-info {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 15px;
    text-align: left;
}

.result-info h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
}

.result-info p {
    color: #666;
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hair-studio-container {
        flex-direction: column;
        padding: 60px 20px 30px;
    }

    #app-container {
        width: 100%;
        max-width: none;
    }

    .studio-header {
        position: relative;
        top: 0;
        width: 100%;
        flex-direction: row;
        min-width: auto;
        justify-content: center;
    }

    .studio-header h1 {
        font-size: 2rem;
        writing-mode: horizontal-tb;
        letter-spacing: 2px;
    }

    .upload-card {
        padding: 40px 20px;
    }

    .customize-container {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .photo-preview {
        position: relative;
        top: 0;
    }

    .hairstyle-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        max-height: 300px;
    }

    .color-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .result-container {
        padding: 30px 20px;
    }

    .result-container h2 {
        font-size: 1.8rem;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn-download, .btn-share, .btn-retry {
        width: 100%;
    }
}

/* 滚动条样式 */
.hairstyle-grid::-webkit-scrollbar {
    width: 8px;
}

.hairstyle-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.hairstyle-grid::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.hairstyle-grid::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

