/* 
 * 纹身图像风格化处理网站 - 样式表
 * 现代深色主题设计
 */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    --bg-input: #16213e;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: #334155;
    --border-light: rgba(255, 255, 255, 0.1);
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* 背景效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* 用量统计样式 */
.usage-stats {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 20px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.usage-icon {
    font-size: 1.1rem;
}

.usage-text {
    color: var(--text-secondary);
}

.usage-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

.usage-divider {
    color: var(--border-color);
}

/* 步骤指示器 */
.steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.step.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
}

.step-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.step.active .step-label,
.step.completed .step-label {
    color: var(--text-primary);
}

.step-line {
    flex: 1;
    max-width: 60px;
    height: 2px;
    background: var(--border-color);
    margin: 0 10px;
    margin-bottom: 28px;
}

/* 主要内容区 */
.main-content {
    flex: 1;
    position: relative;
}

.step-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 上传区域 */
.upload-area {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-glow);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: var(--primary-color);
}

.upload-icon svg {
    width: 100%;
    height: 100%;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.upload-area p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 描述容器 - 新布局 */
.describe-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    align-items: start;
}

.image-preview-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border-light);
}

.image-preview-section h3 {
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 1.1rem;
}

.config-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 图像包装器 */
.image-wrapper {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 16px;
    display: inline-block;
    max-width: 100%;
}

.image-wrapper img {
    max-width: 100%;
    max-height: 350px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

/* 分析框 */
.analysis-box {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--primary-color);
}

.analysis-box h4 {
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 500;
}

.analysis-box p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* 输入组 */
.input-group {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-light);
}

.input-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.input-group label svg {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.text-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.text-input::placeholder {
    color: var(--text-muted);
}

.textarea-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.custom-prompt-group {
    margin-top: 16px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 风格选择 */
.style-group {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-light);
}

.style-group > label {
    display: block;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.style-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.style-option {
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.style-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-card-hover);
}

.style-option.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.15);
}

.style-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.style-option span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.style-option.selected span {
    color: var(--text-primary);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn svg {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-color);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.btn-link {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
}

.btn-link:hover {
    color: var(--primary-color);
}

/* 动作按钮组 */
.action-buttons {
    display: flex;
    gap: 16px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* 处理中动画 */
.processing-container {
    text-align: center;
    padding: 60px 20px;
}

.processing-animation {
    margin-bottom: 40px;
}

.processing-animation h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.processing-animation p {
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 24px;
}

.spinner.large {
    width: 80px;
    height: 80px;
    border-width: 5px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.processing-tips {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    display: inline-block;
}

.processing-tips p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 结果展示 */
.result-container {
    text-align: center;
    padding: 20px;
}

.result-container h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.result-comparison {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.result-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-light);
    flex: 1;
    max-width: 450px;
    min-width: 300px;
}

.result-item.featured {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
}

.result-item h4 {
    margin-bottom: 15px;
    font-weight: 500;
}

.result-item.featured h4 {
    color: var(--primary-color);
}

.result-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 26, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.loading-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .describe-container {
        grid-template-columns: 1fr;
    }
    
    .style-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .logo h1 {
        font-size: 1.8rem;
    }
    
    .steps-indicator {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .step {
        padding: 10px;
    }
    
    .step-line {
        display: none;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-icon {
        width: 60px;
        height: 60px;
    }
    
    .result-comparison {
        flex-direction: column;
        align-items: center;
    }
    
    .result-item {
        max-width: 100%;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 消息提示 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-color: var(--success-color);
}

.toast.error {
    border-color: var(--danger-color);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 警告按钮样式 */
.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

/* 小按钮 */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* 暂存区面板 */
.queue-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    transition: transform 0.3s ease;
}

.queue-panel.collapsed .queue-content {
    display: none;
}

.queue-panel.collapsed .queue-toggle svg {
    transform: rotate(180deg);
}

.queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
}

.queue-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    color: var(--text-primary);
}

.queue-header h3 svg {
    width: 20px;
    height: 20px;
    color: var(--primary-color);
}

.queue-toggle {
    padding: 4px;
}

.queue-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.queue-content {
    padding: 16px 20px;
    max-height: 200px;
    overflow-y: auto;
}

.queue-items {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.queue-empty {
    width: 100%;
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.queue-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.queue-item:hover {
    border-color: var(--primary-color);
}

.queue-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: var(--danger-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.queue-item:hover .remove-btn {
    opacity: 1;
}

.queue-item .remove-btn svg {
    width: 12px;
    height: 12px;
}

.queue-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.layout-modal {
    max-width: 1000px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-close {
    padding: 8px;
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* 排版设置 */
.layout-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.select-input,
.number-input {
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.select-input:focus,
.number-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.number-input {
    width: 100px;
}

.radio-group {
    display: flex;
    gap: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-primary);
}

.radio-label input[type="radio"] {
    accent-color: var(--primary-color);
}

/* 图片尺寸设置列表 */
.layout-images h4,
.layout-preview-section h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.image-size-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 200px;
    overflow-y: auto;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.image-size-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.image-size-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.image-size-item .size-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.image-size-item .size-inputs label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.image-size-item .size-inputs input {
    width: 70px;
}

.image-size-item .size-inputs span {
    color: var(--text-muted);
}

/* 排版预览 */
.layout-preview-container {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    justify-content: center;
    overflow: auto;
}

.layout-preview {
    background: white;
    box-shadow: var(--shadow-md);
    position: relative;
    /* 尺寸会通过JS动态设置 */
}

.layout-preview .preview-image {
    position: absolute;
    object-fit: contain;
    border: 1px dashed rgba(0, 0, 0, 0.2);
}

.layout-preview .preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    height: 300px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .queue-content {
        max-height: 150px;
    }
    
    .queue-item {
        width: 60px;
        height: 60px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .layout-settings {
        grid-template-columns: 1fr;
    }
    
    .image-size-item {
        flex-wrap: wrap;
    }
    
    .image-size-item .size-inputs {
        width: 100%;
    }
}
