/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db; /* Blue */
    --accent-color: #2ecc71; /* Green */
    --text-color: #333;
    --light-bg: #f5f7fa;
    --card-bg: #fff;
    --border-color: #e1e8ed;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --spacing: 1.5rem;
    --gradient-start: #e0f2f7;
    --gradient-middle: #c5e1ee;
    --gradient-end: #a9d4e5;
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-middle), var(--gradient-end));
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    z-index: -1;
    opacity: 0.7;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2.2rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    padding-bottom: 0.5rem;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

/* 表单样式 */
form {
    padding: 2rem;
    border-radius: var(--border-radius);
}

/* 两栏布局 */
.main-content {
    display: flex;
    gap: var(--spacing);
    margin-bottom: var(--spacing);
}

.left-column {
    flex: 1;
    min-width: 0;
}

.right-column {
    flex: 1;
    min-width: 0;
}

/* 区块样式 */
.section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: var(--spacing);
    margin-bottom: var(--spacing);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.5s ease-out forwards;
}

.section:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-medium);
}

.section-title {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* 表单组件样式 */
.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.3s ease-in-out;
    background-color: #fcfcfc;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    background-color: #fff;
}

/* 页边距网格 */
.margins-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* 字体设置组 */
.font-settings {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* 页眉页脚设置 */
.header-footer-settings {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border: 1px dashed var(--border-color);
}

.settings-title {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
}

.back-btn {
    display: inline-block;
    margin-bottom: 1rem;
    color: #3498db;
    text-decoration: none;
}

.back-btn:hover {
    text-decoration: underline;
}

/* 页码设置 */
.page-number-settings {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
}

/* 按钮样式 */
.form-actions {
    text-align: center;
    margin-top: 2rem;
}

button {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        padding: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }
    
    .margins-grid,
    .font-settings {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    form {
        padding: 1rem;
    }
    
    .section {
        padding: 1rem;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    label {
        font-size: 0.95rem;
    }
    
    input[type="text"],
    input[type="number"],
    select {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    button {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .checkbox-group {
        flex-direction: column;
        gap: 1rem;
    }

    .header-footer-settings, .page-number-settings {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .form-group {
        margin-bottom: 0.8rem;
    }
    
    input[type="text"],
    input[type="number"],
    select {
        font-size: 0.85rem;
    }

    button {
        width: 100%;
    }
}

/* 必填项标记 */
.required::after {
    content: "*";
    color: #e74c3c;
    margin-left: 4px;
}

/* 禁用状态样式 */
select option:disabled {
    color: #95a5a6;
    background-color: #f5f5f5;
}

/* 输入框占位符样式 */
::placeholder {
    color: #95a5a6;
}

/* 数字输入框箭头样式 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 2em;
}

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

/* fillinCode 页面特定样式 */
.fillinCode-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.fillinCode-file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.fillinCode-file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.fillinCode-file-input-trigger {
    display: block;
    padding: 0.8rem;
    background: #f8f9fa;
    border: 2px dashed #ddd;
    border-radius: 5px;
    text-align: center;
    color: #666;
    transition: all 0.3s;
}

.fillinCode-file-input-wrapper:hover .fillinCode-file-input-trigger {
    border-color: #3498db;
    color: #3498db;
}

.fillinCode-file-name {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

#fileTree {
    margin-top: 2rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    max-height: 400px;
    overflow-y: auto;
}

.tree-item {
    margin-left: 1.5rem;
    position: relative;
}

.tree-item::before {
    content: "├─";
    position: absolute;
    left: -1.5rem;
    color: #666;
}

.tree-item:last-child::before {
    content: "└─";
} 