/* 
   量子饰品工厂产品标签生成器 - 专业样式表
   现代商务风格，体现饰品工厂的专业性和品质感
*/

/* 导入字体和图标 */
@import url('fonts.css');
@import url('icons/fontawesome.min.css');

/* CSS变量定义 - 品牌色彩系统 */
:root {
    /* 主色调 - 柔和深蓝 */
    --primary-color: #2a4d8f;
    --primary-dark: #223f75;
    --primary-light: #4f74c2;
    
    /* 辅色 - 低饱和金杏，用作点缀 */
    --accent-color: #e8b860;
    --accent-light: #f2d9a0;
    --accent-dark: #c9983f;
    
    /* 中性色 */
    --text-primary: #1f2937;
    --text-secondary: #5b6474;
    --text-muted: #8a95a5;
    --bg-white: #ffffff;
    --bg-gray-50: #f5f7fb;
    --bg-gray-100: #eef1f7;
    --border-color: #e1e6ef;
    --shadow-sm: 0 4px 8px rgb(34 60 102 / 0.05);
    --shadow-md: 0 8px 16px rgb(34 60 102 / 0.08);
    --shadow-lg: 0 16px 30px rgb(34 60 102 / 0.12);
    
    /* 字体 */
    --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
    --font-mono: "Consolas", "Monaco", "Courier New", monospace;
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: radial-gradient(circle at 20% 20%, #f5f7fb 0%, #e8ecf5 35%, #dfe5f3 65%, #d6deef 100%);
    min-height: 100vh;
    padding: 2rem 1rem 3rem;
}

/* 主容器 */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
}

/* 头部区域 - 修复样式匹配 */
.main-header {
    background: linear-gradient(135deg, #2f559b 0%, #2a4d8f 100%);
    color: white;
    padding: 1.25rem 2rem;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.main-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    color: white;
    text-shadow: none;
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
}

/* 主要内容区域 */
.main-content {
    padding: 1rem 0;
}

/* 紧凑步骤指示器 */
.compact-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.25rem 0;
}

.compact-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.compact-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    background: var(--bg-gray-100);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.compact-step.active .compact-step-circle {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.compact-step-line {
    width: 60px;
    height: 2px;
    background: var(--border-color);
    margin: 0 0.5rem;
}

.compact-step-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.compact-step.active .compact-step-text {
     color: var(--primary-color);
     font-weight: 600;
 }

/* 紧凑操作面板 */
.compact-operation-panel {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* 标签页导航 */
.operation-tabs {
    display: flex;
    background: var(--bg-gray-100);
    border-radius: 8px 8px 0 0;
    padding: 0;
    margin: 0;
    list-style: none;
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    background: var(--bg-gray-50);
    color: var(--primary-color);
}

.tab-button.active {
    background: white;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-content {
    padding: 1.5rem;
    background: white;
    border-radius: 0 0 8px 8px;
    display: none;
}

.tab-content.active {
    display: block;
}

/* 紧凑上传区域 */
.compact-upload {
    text-align: center;
    padding: 2rem;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: var(--bg-gray-50);
}

.compact-upload:hover {
    border-color: var(--primary-light);
    background: var(--bg-white);
}

.compact-upload.dragover {
    border-color: var(--accent-color);
    background: var(--bg-white);
    transform: scale(1.01);
}

/* 模式选择器 */
.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.mode-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-gray-50);
}

.mode-option:hover {
    border-color: var(--primary-light);
    background: var(--bg-white);
}

.mode-option.selected {
    border-color: var(--primary-color);
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.mode-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.mode-title {
    font-size: 0.875rem;
    font-weight: 600;
}

/* 隐藏的单选框 */
.mode-radio {
    display: none;
}

/* 上传区域 */
.upload-section {
    background: var(--bg-gray-50);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-section:hover {
    border-color: var(--primary-light);
    background: var(--bg-white);
    box-shadow: var(--shadow-md);
}

.upload-section.dragover {
    border-color: var(--accent-color);
    background: var(--bg-white);
    transform: scale(1.02);
}

.upload-content {
    text-align: center;
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    opacity: 0.8;
}

.upload-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* 文件输入隐藏但功能保留 */
input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* 自定义文件选择按钮 */
.custom-file-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.custom-file-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 选项区域 */
.options-section {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.options-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.option-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.option-card.selected {
    border-color: var(--primary-color);
    background: var(--bg-gray-50);
}

.option-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.option-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gray-100);
    color: var(--text-secondary);
    font-size: 1rem;
}

.option-card.selected .option-icon {
    background: var(--primary-color);
    color: white;
}

.option-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.option-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* 预览区域 */
.preview-section {
    background: var(--bg-gray-50);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.preview-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.preview-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 1rem;
    border: 1px solid var(--border-color);
    text-align: center;
}

.preview-label {
    width: 200px;
    height: 50px;
    background: white;
    border: 2px solid var(--border-color);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
}

.preview-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding-right: 0.25rem;
}

.preview-seq {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.preview-po {
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.preview-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding-left: 0.25rem;
}

.preview-barcode {
    width: 100%;
    height: 25px;
    background: linear-gradient(90deg, #000 25%, transparent 25%, transparent 50%, #000 50%, #000 75%, transparent 75%, transparent);
    background-size: 4px 100%;
    border: 1px solid var(--border-color);
    margin-bottom: 0.25rem;
}

.preview-sku {
    font-size: 0.6rem;
    color: var(--text-secondary);
}

.preview-qr {
    width: 25px;
    height: 25px;
    background: 
        radial-gradient(circle at 25% 25%, #000 2px, transparent 2px),
        radial-gradient(circle at 75% 25%, #000 2px, transparent 2px),
        radial-gradient(circle at 25% 75%, #000 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, #000 2px, transparent 2px);
    border: 1px solid var(--border-color);
}

/* 提交按钮 */
.submit-section {
    text-align: center;
    margin-bottom: 2rem;
}

.submit-button {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    min-width: 200px;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-button:active {
    transform: translateY(-1px);
}

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

/* 消息提示 */
.message {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.message-icon {
    font-size: 1.25rem;
}

.message-text {
    flex: 1;
}

/* 下载链接 */
.download-section {
    background: var(--bg-gray-50);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.download-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .steps-indicator {
        flex-direction: column;
        align-items: center;
    }
    
    .steps-indicator::before {
        display: none;
    }
    
    .step {
        margin: 0.5rem 0;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-grid {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 渐入动画 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
