/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* 模板选择器样式 */
.template-selector .template-item {
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
    text-align: center;
}

.template-selector .template-item:hover {
    border-color: #007bff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.template-selector .template-item.active {
    border-color: #007bff;
    background-color: #e9f5ff;
}

.template-selector .template-name {
    margin-top: 5px;
    font-weight: 500;
}

/* 简历容器样式 */
.resume-container {
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: auto;
    max-height: 800px;
}

/* 简历基础样式 */
.resume {
    width: 210mm;
    min-height: 297mm;
    padding: 20mm;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    font-size: 12pt;
}

/* 简历照片样式 */
.resume-photo-placeholder {
    width: 120px;
    height: 150px;
    overflow: hidden;
    border: 1px solid #ddd;
}

.resume-photo-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 模板1：经典简约 */
.resume.template1 {
    font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
    color: #333;
}

.resume.template1 .resume-header {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 20px;
}

.resume.template1 .resume-title {
    margin-left: 20px;
    flex-grow: 1;
}

.resume.template1 h2 {
    color: #007bff;
    margin-bottom: 5px;
    font-size: 24pt;
}

.resume.template1 .resume-contact {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
}

.resume.template1 .resume-contact p {
    margin-right: 15px;
    margin-bottom: 5px;
    font-size: 10pt;
}

.resume.template1 .resume-section {
    margin-bottom: 20px;
}

.resume.template1 .resume-section h3 {
    color: #007bff;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 10px;
    font-size: 14pt;
}

.resume.template1 .resume-section h3 i {
    margin-right: 5px;
}

/* 模板2：现代商务 */
.resume.template2 {
    font-family: 'Arial', sans-serif;
    color: #333;
    padding: 0;
}

.resume.template2 .resume-header {
    background-color: #2c3e50;
    color: white;
    padding: 30px;
    text-align: center;
}

.resume.template2 .resume-photo-placeholder {
    margin: 0 auto 15px;
    border-radius: 50%;
    width: 150px;
    height: 150px;
    border: 3px solid white;
}

.resume.template2 .resume-photo-placeholder img {
    border-radius: 50%;
}

.resume.template2 h2 {
    margin-bottom: 5px;
    font-size: 24pt;
}

.resume.template2 .resume-contact {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.resume.template2 .resume-contact p {
    margin: 0 10px 5px;
    font-size: 10pt;
}

.resume.template2 .resume-section {
    padding: 0 30px;
    margin-top: 20px;
}

.resume.template2 .resume-section h3 {
    color: #2c3e50;
    border-left: 4px solid #2c3e50;
    padding-left: 10px;
    margin-bottom: 15px;
    font-size: 14pt;
}

/* 模板3：创意设计 */
.resume.template3 {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    color: #333;
    background-color: #fff;
    border-top: 10px solid #ff6b6b;
}

.resume.template3 .resume-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.resume.template3 .resume-photo-placeholder {
    border-radius: 10px;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.resume.template3 .resume-title {
    margin-left: 20px;
}

.resume.template3 h2 {
    color: #ff6b6b;
    margin-bottom: 5px;
    font-size: 28pt;
    font-weight: 700;
}

.resume.template3 .resume-contact {
    margin-top: 10px;
}

.resume.template3 .resume-contact p {
    margin-bottom: 5px;
    font-size: 10pt;
}

.resume.template3 .resume-section {
    margin-bottom: 25px;
    padding-left: 15px;
    border-left: 3px solid #ff6b6b;
}

.resume.template3 .resume-section h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 16pt;
    font-weight: 600;
}

/* 模板4：专业学术 */
.resume.template4 {
    font-family: 'Times New Roman', 'SimSun', serif;
    color: #333;
    padding: 25mm;
}

.resume.template4 .resume-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
    padding-bottom: 20px;
}

.resume.template4 .resume-photo-placeholder {
    margin: 0 auto 15px;
    border: 1px solid #333;
}

.resume.template4 h2 {
    margin-bottom: 5px;
    font-size: 24pt;
    font-weight: bold;
}

.resume.template4 .resume-contact {
    margin-top: 15px;
}

.resume.template4 .resume-contact p {
    margin-bottom: 5px;
    font-size: 11pt;
}

.resume.template4 .resume-section {
    margin-bottom: 25px;
}

.resume.template4 .resume-section h3 {
    text-align: center;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 16pt;
    text-transform: uppercase;
}

/* 技能标签样式 */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background-color: #e9ecef;
    border-radius: 20px;
    padding: 5px 15px;
    font-size: 10pt;
    display: inline-block;
}

/* 技能进度条样式 */
.skill-bars .skill-item {
    margin-bottom: 10px;
}

.skill-bars .skill-name {
    margin-bottom: 5px;
    font-weight: 500;
}

.skill-bars .skill-progress {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.skill-bars .skill-progress-bar {
    height: 100%;
    background-color: #007bff;
}

/* 教育和工作经历样式 */
.resume-item {
    margin-bottom: 15px;
}

.resume-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.resume-item-title {
    font-weight: bold;
}

.resume-item-subtitle {
    font-style: italic;
    margin-bottom: 5px;
}

.resume-item-date {
    color: #6c757d;
    font-size: 0.9em;
}

.resume-item-description {
    font-size: 0.95em;
    white-space: pre-line;
}

/* 背景设置相关样式 */
.preset-bg {
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.preset-bg.active {
    border-color: #0d6efd;
}

.preset-bg-inner {
    width: 100%;
    height: 40px;
    border-radius: 2px;
}

#backgroundPreview {
    max-height: 150px;
    object-fit: cover;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .resume-container {
        max-height: 500px;
    }
    
    /* 移动端导航优化 */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs .nav-item {
        float: none;
        display: inline-block;
    }
    
    /* 移动端表单优化 */
    .form-group {
        margin-bottom: 15px;
    }
    
    /* 移动端按钮优化 */
    .btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    /* 移动端模板选择器优化 */
    .template-selector {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .template-item {
        width: 45%;
        margin: 5px;
    }
}

@media (max-width: 768px) {
    .resume {
        width: 100%;
        padding: 15mm;
    }
    
    /* 移动端简历预览优化 */
    .resume-container {
        transform-origin: top center;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .resume {
        transform: scale(0.8);
        transform-origin: top center;
    }
}

/* 小屏幕手机优化 */
@media (max-width: 576px) {
    .header {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        margin: 2px;
    }
    
    .template-item {
        width: 90%;
    }
    
    /* 简化表单在小屏幕上的显示 */
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        width: 100%;
        padding: 0;
    }
    
    /* 调整教育和工作经历项的布局 */
    .education-item, .experience-item {
        padding: 10px;
    }
    
    /* 调整简历预览大小 */
    .resume {
        transform: scale(0.7);
    }
}

/* 缩放控制 */
.resume-container {
    transition: transform 0.3s;
}

/* 打印样式 */
@media print {
    body * {
        visibility: hidden;
    }
    
    .resume-container, .resume-container * {
        visibility: visible;
    }
    
    .resume-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        box-shadow: none;
        overflow: visible;
        transform: scale(1) !important;
    }
    
    .resume {
        box-shadow: none;
    }
}