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

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 应用容器 */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 左侧控制面板 */
.control-panel {
    width: 350px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.control-panel h1 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.control-panel .section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.control-panel .section:last-child {
    border-bottom: none;
}

.control-panel h3 {
    font-size: 16px;
    color: #34495e;
    margin-bottom: 15px;
    font-weight: 600;
}

/* 模板选择 */
.template-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.template-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.template-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

.template-card.active {
    border-color: #3498db;
    background-color: #ebf5fb;
}

.template-preview {
    width: 100%;
    height: 60px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.developer-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.artist-preview {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.business-preview {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.creative-preview {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.template-card span {
    font-size: 12px;
    color: #555;
}

/* 表单样式 */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 头像上传 */
.avatar-upload {
    position: relative;
}

.avatar-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.avatar-preview {
    width: 100px;
    height: 100px;
    border: 2px dashed #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    color: #999;
    font-size: 12px;
    text-align: center;
    overflow: hidden;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 列表项样式 */
.experience-item,
.education-item,
.skill-item,
.hobby-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.experience-item input,
.education-item input,
.skill-item input {
    margin-bottom: 8px;
}

.skill-item {
    display: flex;
    gap: 10px;
    align-items: center;
}

.skill-item input {
    flex: 1;
    margin-bottom: 0;
}

.skill-item select {
    width: 100px;
}

.hobby-item {
    display: flex;
    gap: 10px;
    align-items: center;
}

.hobby-item input {
    flex: 1;
    margin-bottom: 0;
}

/* 按钮样式 */
.btn-add {
    width: 100%;
    padding: 10px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-add:hover {
    background: #2980b9;
}

.btn-remove {
    padding: 5px 10px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.btn-remove:hover {
    background: #c0392b;
}

/* 颜色选择器 */
.color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-picker input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

/* 右侧预览区域 */
.preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #e8e8e8;
    overflow: hidden;
}

.toolbar {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid #ddd;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-export {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-export:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-export.excel {
    background: #27ae60;
}

.btn-export.excel:hover {
    background: #229954;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.resume-container {
    flex: 1;
    overflow: auto;
    padding: 40px;
    display: flex;
    justify-content: center;
}

/* A4 纸张尺寸 */
.resume-page {
    width: 210mm;
    min-height: 297mm;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
    padding: 40px;
    position: relative;
}

/* 打印样式 */
@media print {
    .control-panel,
    .toolbar {
        display: none !important;
    }
    
    .preview-area {
        background: white;
    }
    
    .resume-container {
        padding: 0;
    }
    
    .resume-page {
        box-shadow: none;
        width: 100%;
        min-height: auto;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .control-panel {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100%;
        height: 50vh;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    
    .preview-area {
        height: 50vh;
    }
    
    .resume-page {
        width: 100%;
        min-height: auto;
        padding: 20px;
    }
}
