/* 全局变量 */
:root {
    --primary-color: #2196F3;
    --secondary-color: #1976D2;
    --text-color: #333;
    --border-color: #ddd;
    --background-color: #f5f5f5;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --danger-color: #F44336;
    --header-height: 60px;
    --section-spacing: 20px;
    --form-group-spacing: 15px;
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--background-color);
    overflow: hidden;
}

.app-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
}

/* 模板切换器样式 */
.template-switcher {
    display: flex;
    gap: 1rem;
}

.template-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.template-btn i {
    font-size: 1.1rem;
}

.template-btn:hover {
    background: rgba(255,255,255,0.2);
}

.template-btn.active {
    background: rgba(255,255,255,0.3);
    font-weight: 500;
}

/* 主要内容区域 */
main {
    flex: 1;
    margin-top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

.editor-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    height: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

/* 左侧编辑区域 */
.editor-sidebar {
    background: white;
    padding: 20px;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

/* 自定义滚动条 */
.editor-sidebar::-webkit-scrollbar {
    width: 8px;
}

.editor-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.editor-sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.editor-sidebar::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* 表单组件样式 */
.form-group {
    margin-bottom: var(--form-group-spacing);
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #666;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

/* 区块样式 */
.section-container {
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f8f9fa;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
}

.section-header .section-title {
    margin: 0;
    padding: 0;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.toggle-btn {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px;
    transition: transform 0.3s ease;
}

.toggle-btn i {
    transition: transform 0.3s ease;
}

.section-container.collapsed .toggle-btn i {
    transform: rotate(-90deg);
}

.section-content {
    padding: 15px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.section-container.collapsed .section-content {
    max-height: 0;
    opacity: 0;
    padding: 0 15px;
}

/* 添加按钮样式 */
.add-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    margin-bottom: 15px;
    transition: background-color 0.3s ease;
}

.add-btn i {
    margin-right: 8px;
}

.add-btn:hover {
    background: var(--secondary-color);
}

/* 条目样式 */
.education-item,
.experience-item,
.skill-item,
.project-item,
.award-item,
.certificate-item,
.language-item,
.custom-item {
    background: #fff;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 删除按钮样式 */
.remove-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.remove-btn i {
    margin-right: 5px;
}

.remove-btn:hover {
    background: #d32f2f;
}

/* 技能等级输入样式 */
.skill-level-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-level-input input[type="range"] {
    flex: 1;
}

.skill-value {
    min-width: 45px;
    text-align: right;
    color: #666;
}

/* 保存和导出按钮样式 */
.form-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.save-button,
.export-button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.save-button {
    background: var(--success-color);
    color: white;
}

.export-button {
    background: var(--warning-color);
    color: var(--text-color);
}

.save-button:hover {
    background: #388E3C;
}

.export-button:hover {
    background: #FFA000;
}

/* 右侧预览区域 */
.preview-panel {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: calc(100vh - var(--header-height) - 4rem);
    overflow-y: auto;
    position: sticky;
    top: calc(var(--header-height) + 2rem);
}

/* 模板样式 */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.template-card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.template-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(33, 150, 243, 0.05);
}

.template-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .editor-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .editor-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .template-switcher {
        flex-direction: column;
        width: 100%;
    }
    
    .template-btn {
        width: 100%;
        justify-content: center;
    }
    
    main {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
}

/* 工具类 */
.hidden {
    display: none;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.template-card {
    animation: fadeIn 0.5s ease-out;
}

/* Modern Template Styles */
.modern-template {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Roboto', sans-serif;
    color: #333;
    line-height: 1.6;
}

.modern-template section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.modern-template section:last-child {
    border-bottom: none;
}

.modern-template h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modern-template h2 i {
    color: #3498db;
    font-size: 1.2rem;
}

.modern-template .resume-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #3498db;
}

.modern-template .name {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.modern-template .contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.modern-template .contact-info p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.modern-template .contact-info i {
    color: #3498db;
}

.modern-template .contact-info a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

.modern-template .contact-info a:hover {
    color: #2980b9;
}

/* Common item styles */
.modern-template .education-item,
.modern-template .experience-item,
.modern-template .project-item,
.modern-template .award-item,
.modern-template .certificate-item,
.modern-template .language-item,
.modern-template .custom-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modern-template .education-item:hover,
.modern-template .experience-item:hover,
.modern-template .project-item:hover,
.modern-template .award-item:hover,
.modern-template .certificate-item:hover,
.modern-template .language-item:hover,
.modern-template .custom-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.modern-template .education-item h3,
.modern-template .experience-item h3,
.modern-template .project-item h3,
.modern-template .award-item h3,
.modern-template .certificate-item h3,
.modern-template .language-item h3,
.modern-template .custom-item h3 {
    color: #2c3e50;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.modern-template .time,
.modern-template .position,
.modern-template .role,
.modern-template .level,
.modern-template .score,
.modern-template .issuer,
.modern-template .subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.modern-template .description {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}

/* Skills section */
.modern-template .skill-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.modern-template .skill-name {
    min-width: 120px;
    font-weight: 500;
    color: #2c3e50;
}

.modern-template .skill-bar {
    flex-grow: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.modern-template .skill-level {
    height: 100%;
    background: #3498db;
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Empty section styles */
.modern-template .empty-section {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Summary section */
.modern-template .summary-section p {
    color: #555;
    font-size: 1rem;
    line-height: 1.6;
    text-align: justify;
}

/* Responsive design */
@media (max-width: 768px) {
    .modern-template {
        padding: 1rem;
    }

    .modern-template .contact-info {
        flex-direction: column;
        align-items: center;
    }

    .modern-template .name {
        font-size: 2rem;
    }

    .modern-template h2 {
        font-size: 1.3rem;
    }
}

@media print {
    .modern-template {
        padding: 0;
    }

    .modern-template section {
        page-break-inside: avoid;
    }

    .modern-template .education-item,
    .modern-template .experience-item,
    .modern-template .project-item,
    .modern-template .award-item,
    .modern-template .certificate-item,
    .modern-template .language-item,
    .modern-template .custom-item {
        background: none;
        padding: 0.5rem 0;
    }
}

/* 自定义模块样式 */
.custom-section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #fff;
}

.section-title-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    background: #fff;
    transition: all 0.2s;
}

.section-title-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
    outline: none;
}

.section-title-input::placeholder {
    color: #999;
    font-weight: normal;
}

.custom-items {
    margin: 15px 0;
}

.section-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.section-actions .add-btn,
.section-actions .remove-btn {
    margin-bottom: 0;
}

/* 预览样式 */
.resume-section {
    margin-bottom: 30px;
}

.resume-section .section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.resume-section .resume-item {
    margin-bottom: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.resume-section .item-header {
    margin-bottom: 10px;
}

.resume-section .item-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.resume-section .item-date {
    color: #666;
    font-size: 14px;
    margin-top: 4px;
}

.resume-section .item-description {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.close-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--danger-color);
}

.cancel-btn, .confirm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.cancel-btn {
    background: #f5f5f5;
    color: var(--text-color);
}

.confirm-btn {
    background: var(--primary-color);
    color: white;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

.confirm-btn:hover {
    background: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
    outline: none;
}

.form-control.error {
    border-color: var(--danger-color);
    animation: shake 0.3s;
}

.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 导出下拉菜单样式 */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.export-button:hover {
    background: #1976d2;
}

.export-options {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    display: none;
    z-index: 1000;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.export-dropdown.active .export-options {
    display: block;
    opacity: 1;
    visibility: visible;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    width: 100%;
    border: none;
    background: none;
    color: #333;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.export-option:hover {
    background: #f5f5f5;
    color: #2196f3;
}

.export-option i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

/* 添加一个小的三角形指示器 */
.export-options::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: white;
    transform: rotate(45deg);
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1);
}

.donate-button {
    margin-left: auto;
    padding: 0 1rem;
}

.donate-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.donate-link:hover {
    background: linear-gradient(135deg, #ff5252, #ff6b6b);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.donate-link i {
    color: white;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .donate-button {
        padding: 0.5rem;
    }
    
    .donate-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
} 