/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a3e 50%, #0f0f2d 100%);
    min-height: 100vh;
    color: #e4e4e7;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 50px;
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.1) 0%, rgba(212, 168, 67, 0.05) 100%);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(201, 168, 76, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, #c9a84c 0%, #d4a843 50%, #e8c76d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 18px;
    color: #a1a1aa;
    font-weight: 400;
}

/* 主内容区 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.section {
    background: linear-gradient(135deg, rgba(26, 26, 62, 0.6) 0%, rgba(15, 15, 45, 0.4) 100%);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(201, 168, 76, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.section h2 {
    font-size: 22px;
    font-weight: 600;
    color: #e4e4e7;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 分类卡片网格 */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.category-card {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.08) 0%, rgba(212, 168, 67, 0.04) 100%);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    border-color: rgba(201, 168, 76, 0.4);
    box-shadow: 0 8px 24px rgba(201, 168, 76, 0.15);
}

.category-card.selected {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.2) 0%, rgba(212, 168, 67, 0.1) 100%);
    border-color: #c9a84c;
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.25);
}

.category-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    color: #e4e4e7;
    margin-bottom: 8px;
}

.category-desc {
    font-size: 13px;
    color: #a1a1aa;
    line-height: 1.4;
}

/* 尺寸选择器 */
.aspect-ratio-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.ratio-option {
    flex: 1;
    min-width: 120px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 18px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.ratio-option:hover {
    border-color: rgba(201, 168, 76, 0.3);
    background: rgba(201, 168, 76, 0.05);
}

.ratio-option.selected {
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.15) 0%, rgba(212, 168, 67, 0.08) 100%);
    border-color: #c9a84c;
}

.ratio-option.recommended .ratio-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #c9a84c 0%, #d4a843 100%);
    color: #0a0e27;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
}

.ratio-label {
    font-size: 20px;
    font-weight: 700;
    color: #e4e4e7;
    margin-bottom: 6px;
}

.ratio-desc {
    font-size: 13px;
    color: #a1a1aa;
}

/* 输入字段容器 */
.fields-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 500;
    margin-bottom: 10px;
    color: #d4d4d8;
    font-size: 15px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.3);
    color: #e4e4e7;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #c9a84c;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1);
}

.form-control::placeholder {
    color: #71717a;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* 提示词预览区 */
.preview-container {
    height: 350px;
}

.prompt-textarea {
    width: 100%;
    height: 100%;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    background: rgba(0, 0, 0, 0.3);
    color: #d4d4d8;
}

/* 生成按钮区域 */
.action-section {
    text-align: center;
    margin: 20px 0;
}

.generate-btn {
    padding: 18px 60px;
    font-size: 20px;
    font-weight: 600;
    color: #0a0e27;
    background: linear-gradient(135deg, #c9a84c 0%, #d4a843 50%, #e8c76d 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 24px rgba(201, 168, 76, 0.3);
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(201, 168, 76, 0.4);
}

.generate-btn:disabled {
    background: linear-gradient(135deg, #3f3f46 0%, #52525b 100%);
    color: #a1a1aa;
    cursor: not-allowed;
    box-shadow: none;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 25px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c9a84c 0%, #d4a843 50%, #e8c76d 100%);
    width: 0%;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* 结果展示区 */
.result-section {
    margin-top: 20px;
    padding-top: 40px;
    border-top: 1px solid rgba(201, 168, 76, 0.2);
}

.result-section h2 {
    font-size: 28px;
    color: #e4e4e7;
    margin-bottom: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.result-container {
    text-align: center;
}

.image-container {
    margin-bottom: 30px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(201, 168, 76, 0.15);
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.result-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.action-btn.primary {
    background: linear-gradient(135deg, #c9a84c 0%, #d4a843 100%);
    color: #0a0e27;
}

.action-btn.secondary {
    background: linear-gradient(135deg, #52525b 0%, #71717a 100%);
    color: #e4e4e7;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* 设置按钮 */
.settings-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9a84c 0%, #d4a843 100%);
    color: #0a0e27;
    border: none;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(201, 168, 76, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.settings-btn:hover {
    transform: scale(1.1) rotate(45deg);
    box-shadow: 0 8px 32px rgba(201, 168, 76, 0.5);
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a3e 0%, #0f0f2d 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(201, 168, 76, 0.2);
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 24px;
    color: #e4e4e7;
}

.close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #71717a;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: #e4e4e7;
}

.modal-body {
    padding: 30px;
}

.help-text {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: #a1a1aa;
}

.help-text a {
    color: #c9a84c;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #c9a84c 0%, #d4a843 100%);
    color: #0a0e27;
}

.btn-secondary {
    background: #3f3f46;
    color: #e4e4e7;
}

.btn-primary:hover,
.btn-secondary:hover {
    opacity: 0.9;
}

/* 复选框样式 */
input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    accent-color: #c9a84c;
}

/* 提示信息 */
.hint {
    color: #71717a;
    text-align: center;
    font-style: italic;
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 16px 32px;
    background: rgba(0, 0, 0, 0.9);
    color: #e4e4e7;
    border-radius: 30px;
    font-size: 16px;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    opacity: 1;
}

.toast.error {
    background: rgba(185, 28, 28, 0.95);
    border-color: rgba(252, 84, 84, 0.3);
}

.toast.success {
    background: rgba(22, 163, 74, 0.95);
    border-color: rgba(74, 222, 128, 0.3);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 76, 0.5);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 16px;
    }

    .category-cards {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }

    .aspect-ratio-selector {
        flex-direction: column;
    }

    .ratio-option {
        min-width: 100%;
    }

    .result-actions {
        flex-direction: column;
        align-items: center;
    }

    .action-btn {
        width: 100%;
        max-width: 280px;
    }

    .settings-btn {
        bottom: 20px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
}
