/* ===== 字体定义 (保持不变) ===== */
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat/Montserrat-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Montserrat';
    src: url('../fonts/Montserrat/Montserrat-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}
@font-face {
    font-family: 'Source Han Sans CN';
    src: url('../fonts/SourceHanSans/SourceHanSansCN-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Source Han Sans CN';
    src: url('../fonts/SourceHanSans/SourceHanSansCN-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

/* ===== 全局样式 (S-Future 风格) ===== */
:root {
    /* 用户指定配色: 办公提效 (Teal) -> Markdown转换器 (Dark) */
    --primary-gradient: linear-gradient(135deg, #448098 0%, #313D4B 100%);
    --primary-color: #448098;
    --primary-hover: #3a6d82;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-main: #2c3e50;
    --text-light: #666;
    --border-color: #e1e4e8;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 16px rgba(102, 126, 234, 0.15);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', 'Source Han Sans CN', "Microsoft YaHei", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

/* 恢复旧版单列布局容器 */
.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 30px;
    background: var(--primary-gradient);
    padding: 30px 20px;
    border-radius: var(--radius);
    color: white;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.main-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    transform: rotate(30deg);
}

.main-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.2rem;
    font-weight: 700;
}

.main-header .subtitle {
    margin: 0;
    font-size: 1rem;
    opacity: 0.95;
    font-weight: normal;
}

/* 卡片样式 (Card) */
.step-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 25px;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.step-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: none; /* 移除原来的底部线条 */
    padding: 0;
    background: transparent;
}

.step-num {
    width: 36px;
    height: 36px;
    background: #4a5568; /* 深灰色背景，参考图1/2的黑灰色圆圈 */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    margin-right: 15px;
}

.card-header h2 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--text-main);
    font-weight: 700;
}

/* 上传区域 (Upload) */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    background: #fafbfc;
    transition: all 0.3s;
    position: relative;
    margin: 10px 0;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #f0f7ff;
}

.upload-area input[type=file] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

/* 筛选与操作栏 Grid */
.filter-section {
    background: #fff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 15px;
    align-items: end;
}

.control-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 8px;
}

select, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e4e8;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    background: white;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 配置行 (Config Row - 以前的 Font/Theme) */
.config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.config-box {
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 15px;
}

.config-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 色块选择器 */
.color-presets {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.swatch {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 0 0 1px #cbd5e0;
    transition: transform 0.2s;
}

.swatch:hover {
    transform: scale(1.1);
}

/* 颜色和字体表单 */
.style-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.color-input-group label {
    font-size: 12px; margin: 0; color: #666;
}
input[type="color"] {
    width: 100%;
    height: 38px;
    padding: 2px;
    border: 2px solid #e1e4e8;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
}

/* 列选择器 Grid */
.column-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
}

.col-item {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #e1e4e8;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: grab; /* Change cursor for draggable */
    transition: all 0.2s;
}

.col-item:active {
    cursor: grabbing;
}

.col-item:hover {
    background: #f0f7ff;
    border-color: #bee3f8;
}

.col-item.selected {
    background: #ebf8ff;
    border-color: #63b3ed; /* Lighter blue border */
}

.col-item.selected .col-name {
    color: #2b6cb0;
    font-weight: 600;
}

.col-item .checkmark {
    margin-left: auto;
    color: var(--primary-color);
    font-weight: bold;
    opacity: 0;
}
.col-item.selected .checkmark { opacity: 1; }

/* 参数微调 (3列布局) */
.params-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* 按钮组 */
.actions-bar {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-outline {
    background: white;
    border: 2px solid #e1e4e8;
    color: #4a5568;
}
.btn-outline:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

/* 预览区域 */
.preview-section {
    background: #fff;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

.preview-container {
    background: #fafbfc;
    border: 2px dashed #e1e4e8;
    border-radius: 8px;
    padding: 30px;
    min-height: 200px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.placeholder-text {
    color: #a0aec0;
    padding: 40px;
}

#previewCanvas {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-width: 100%;
}

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

/* 提示块 */
.tip-block {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 5px;
    background: #ebf8ff;
    padding: 8px 12px;
    border-radius: 4px;
    display: block;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.page-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    cursor: pointer;
}

/* 单列调整历史 */
.adjust-list {
    margin-top: 10px;
}

@media (max-width: 768px) {
    .filter-row, .config-row, .params-grid, .column-grid {
        grid-template-columns: 1fr;
    }
}
