/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.logo {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.icon {
    font-size: 2.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.upload-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.upload-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin: 15px 0;
}

.upload-btn:hover {
    transform: translateY(-2px);
}

.supported-formats {
    color: #666;
    font-size: 0.9rem;
    margin-top: 15px;
}

/* Control Section */
.control-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.controls {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-weight: 600;
    color: #333;
}

.control-group label input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.control-hint {
    font-size: 12px;
    color: #666;
    margin-left: 24px;
    display: block;
    font-weight: 400;
}

.control-group input,
.control-group select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    min-width: 120px;
}

.control-group input:focus,
.control-group select:focus {
    outline: none;
    border-color: #667eea;
}

.process-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-left: auto;
}

.process-btn:hover {
    transform: translateY(-2px);
}

.reset-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.reset-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Preview Section */
.preview-section,
.result-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.preview-section h3,
.result-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.image-info {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Result Section */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.select-all-btn,
.download-selected-btn,
.download-all-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.select-all-btn:hover,
.download-selected-btn:hover,
.download-all-btn:hover {
    background: #0056b3;
}

.download-all-btn {
    background: #28a745;
}

.download-all-btn:hover {
    background: #1e7e34;
}

/* Cutting Grid */
.cutting-grid {
    display: grid;
    gap: 20px;
    margin-top: 20px;
}

.cutting-item {
    position: relative;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.cutting-item:hover {
    transform: scale(1.05);
}

.cutting-item.selected {
    box-shadow: 0 0 0 3px #667eea;
}

.cutting-item img {
    width: 100%;
    height: 200px;
    object-fit: contain;
}

.cutting-item .item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cutting-item:hover .item-overlay {
    opacity: 1;
}

.cutting-item .download-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
}

.cutting-item .checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 20px;
    height: 20px;
    z-index: 2;
}

.cutting-item .item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px;
    font-size: 0.8rem;
    text-align: center;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    font-size: 1.2rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: white;
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .logo {
        font-size: 2rem;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .control-group input,
    .control-group select {
        flex: 1;
        max-width: 200px;
    }

    .result-header {
        flex-direction: column;
        align-items: stretch;
    }

    .result-actions {
        justify-content: center;
    }

    .cutting-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .cutting-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 10px;
    }

    .cutting-item img {
        height: 150px;
    }
}

/* ===== 标签页导航样式 ===== */
.tabs-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    border: 2px solid transparent;
    border-radius: 25px;
    background: #f8f9fa;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.tab-icon {
    font-size: 1.2rem;
}

/* ===== 标签页内容区域 ===== */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 裁剪工具样式（限定在 #crop-tab 作用域） ===== */

/* 裁剪工具的上传区域 */
#crop-tab .upload-area {
    background: white;
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

#crop-tab .upload-area:hover,
#crop-tab .upload-area.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

#crop-tab .upload-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
}

#crop-tab .upload-hint {
    color: #666;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* 裁剪工具栏 */
#crop-tab .crop-toolbar {
    display: flex;
    gap: 1rem;
    justify-content: center;
    background: white;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* 裁剪按钮样式 */
.crop-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.crop-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.crop-btn-primary {
    background: #667eea;
    color: white;
}

.crop-btn-primary:hover:not(:disabled) {
    background: #5568d3;
}

.crop-btn-secondary {
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.crop-btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
}

.crop-btn-success {
    background: #10b981;
    color: white;
    width: 100%;
    margin-top: 1rem;
}

.crop-btn-success:hover:not(:disabled) {
    background: #059669;
}

/* 裁剪工作区 */
#crop-tab .crop-workspace {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* 图片容器 */
#crop-tab .image-container {
    position: relative;
    background: #f1f5f9;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

#crop-tab #crop-sourceImage {
    max-width: 100%;
    max-height: 600px;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* 裁剪框 */
#crop-tab .crop-box {
    position: absolute;
    border: 2px solid #667eea;
    background: transparent;
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    display: none;
}

/* 裁剪手柄 */
#crop-tab .crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #667eea;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#crop-tab .crop-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
#crop-tab .crop-handle.n { top: -6px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
#crop-tab .crop-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
#crop-tab .crop-handle.e { top: 50%; right: -6px; transform: translateY(-50%); cursor: e-resize; }
#crop-tab .crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }
#crop-tab .crop-handle.s { bottom: -6px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
#crop-tab .crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
#crop-tab .crop-handle.w { top: 50%; left: -6px; transform: translateY(-50%); cursor: w-resize; }

/* 放大镜 */
#crop-tab .crop-magnifier {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid #667eea;
    overflow: hidden;
    pointer-events: none;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
    background: white;
}

#crop-tab #magnifierCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* 预览面板 */
#crop-tab .crop-preview-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#crop-tab .crop-preview-panel h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

#crop-tab .crop-preview-container {
    background: #f1f5f9;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

#crop-tab #crop-previewCanvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

#crop-tab .crop-info {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
}

#crop-tab .crop-info p {
    color: #64748b;
}

#crop-tab .crop-info span {
    color: #1e293b;
    font-weight: 500;
}

/* 裁剪工具响应式设计 */
@media (max-width: 1024px) {
    #crop-tab .crop-workspace {
        grid-template-columns: 1fr;
    }

    #crop-tab .crop-preview-panel {
        order: -1;
    }
}

@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
        justify-content: center;
    }

    #crop-tab .crop-toolbar {
        flex-direction: column;
    }

    .crop-btn {
        width: 100%;
    }

    #crop-tab .crop-workspace {
        padding: 1rem;
    }
}

/* ===== 简历导出工具样式（限定在 #resume-tab 作用域） ===== */

#resume-tab .resume-editor-section,
#resume-tab .resume-preview-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#resume-tab .resume-editor-wrapper h3,
#resume-tab .resume-preview-header h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

#resume-tab #resume-markdownInput {
    width: 100%;
    min-height: 450px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    background: #fafafa;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#resume-tab #resume-markdownInput:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
}

#resume-tab .resume-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

/* Template picker grid */
#resume-tab .resume-template-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
}

#resume-tab .template-card {
    cursor: pointer;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px;
    transition: all 0.25s ease;
    background: #fafafa;
}

#resume-tab .template-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

#resume-tab .template-card.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
    background: #f0f3ff;
}

#resume-tab .template-name {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

#resume-tab .template-card.active .template-name {
    color: #667eea;
}

/* Mini template preview (inside each card) */
#resume-tab .template-preview {
    width: 100%;
    aspect-ratio: 210 / 297;
    border-radius: 4px;
    padding: 12% 10% 8%;
    display: flex;
    flex-direction: column;
    gap: 5%;
    font-size: 0;
    overflow: hidden;
    position: relative;
}

#resume-tab .tp-title {
    height: 9%;
    border-radius: 2px;
    width: 55%;
}

#resume-tab .tp-title.tp-center {
    margin: 0 auto;
}

#resume-tab .tp-title.tp-serif {
    font-family: Georgia, serif;
    letter-spacing: 2px;
}

#resume-tab .tp-title.tp-mono {
    font-family: 'Courier New', monospace;
    width: 65%;
}

#resume-tab .tp-line {
    height: 2px;
    width: 100%;
    margin: 1% 0 3%;
}

#resume-tab .tp-line.dashed {
    border-top: 2px dashed;
    height: 0;
    background: none !important;
}

#resume-tab .tp-heading {
    height: 6%;
    border-radius: 2px;
    width: 35%;
}

#resume-tab .tp-heading.tp-serif {
    font-family: Georgia, serif;
}

#resume-tab .tp-heading.tp-uppercase {
    width: 50%;
    letter-spacing: 1px;
}

#resume-tab .tp-heading.tp-sidebar {
    border-left-width: 3px;
    border-left-style: solid;
    padding-left: 6px;
    border-radius: 0;
}

#resume-tab .tp-heading.tp-mono {
    font-family: 'Courier New', monospace;
}

#resume-tab .tp-text {
    height: 3.5%;
    border-radius: 2px;
    width: 85%;
    opacity: 0.45;
}

#resume-tab .tp-text.short {
    width: 60%;
}

#resume-tab .tp-text.tp-mono {
    font-family: 'Courier New', monospace;
}

#resume-tab .tp-badge {
    height: 7%;
    border-radius: 3px;
    width: 38%;
}

#resume-tab .tp-bullet {
    height: 3.5%;
    border-radius: 2px;
    width: 80%;
    opacity: 0.4;
    position: relative;
    padding-left: 8px;
}

#resume-tab .tp-bullet.short {
    width: 55%;
}

#resume-tab .tp-deco {
    height: 3px;
    width: 25%;
    margin: 0 auto 2%;
    border-radius: 2px;
}

/* --- Classic: centered, black/white, traditional --- */
#resume-tab .template-preview-classic {
    background: #fff;
    border: 1px solid #e8e8e8;
}
#resume-tab .template-preview-classic .tp-title { background: #1a1a1a; }
#resume-tab .template-preview-classic .tp-line { background: #333; }
#resume-tab .template-preview-classic .tp-heading { background: #333; }
#resume-tab .template-preview-classic .tp-text { background: #666; }

/* --- Modern: left-aligned, blue accents, bullet items --- */
#resume-tab .template-preview-modern {
    background: #fff;
    border: 1px solid #e8e8e8;
}
#resume-tab .template-preview-modern .tp-title { background: #2c3e50; width: 50%; }
#resume-tab .template-preview-modern .tp-line { background: #2980b9; }
#resume-tab .template-preview-modern .tp-heading { background: #2980b9; }
#resume-tab .template-preview-modern .tp-bullet { background: #95a5a6; }
#resume-tab .template-preview-modern .tp-bullet::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #2980b9;
}

/* --- Creative: centered, gradient badges, dashed lines --- */
#resume-tab .template-preview-creative {
    background: #faf5ff;
    border: 1px solid #e8e0f0;
}
#resume-tab .template-preview-creative .tp-title { background: #6c5ce7; }
#resume-tab .template-preview-creative .tp-line { border-color: #a29bfe; }
#resume-tab .template-preview-creative .tp-badge { background: linear-gradient(135deg, #6c5ce7, #a29bfe); }
#resume-tab .template-preview-creative .tp-text { background: #a29bfe; }

/* --- Academic: serif, uppercase headings, minimalist --- */
#resume-tab .template-preview-academic {
    background: #fff;
    border: 1px solid #e0e0e0;
}
#resume-tab .template-preview-academic .tp-title { background: #000; }
#resume-tab .template-preview-academic .tp-line { background: #000; }
#resume-tab .template-preview-academic .tp-heading { background: #333; }
#resume-tab .template-preview-academic .tp-text { background: #888; }

/* --- Business: gold sidebar borders, dark navy --- */
#resume-tab .template-preview-business {
    background: #fff;
    border: 1px solid #e0e0e0;
}
#resume-tab .template-preview-business .tp-title { background: #1b2a4a; width: 50%; }
#resume-tab .template-preview-business .tp-line { background: #c9a961; }
#resume-tab .template-preview-business .tp-heading {
    background: #1b2a4a;
    border-left-color: #c9a961;
}
#resume-tab .template-preview-business .tp-text { background: #8a8a8a; }

/* --- Fresh: green, light bg, centered with dot deco --- */
#resume-tab .template-preview-fresh {
    background: #f0fff4;
    border: 1px solid #c8f7d8;
}
#resume-tab .template-preview-fresh .tp-title { background: #2d8f5e; }
#resume-tab .template-preview-fresh .tp-deco { background: #a8e6cf; }
#resume-tab .template-preview-fresh .tp-heading { background: #27ae60; }
#resume-tab .template-preview-fresh .tp-text { background: #6dd5a0; }

/* --- Tech: dark bg, cyan monospace, terminal feel --- */
#resume-tab .template-preview-tech {
    background: #1a1a2e;
    border: 1px solid #16213e;
}
#resume-tab .template-preview-tech .tp-title { background: #00d4ff; }
#resume-tab .template-preview-tech .tp-line { background: #16213e; height: 1px; }
#resume-tab .template-preview-tech .tp-heading { background: #00d4ff; width: 45%; }
#resume-tab .template-preview-tech .tp-text { background: #3a3a5a; opacity: 0.7; }

/* Resume action buttons row */
#resume-tab .resume-actions {
    display: flex;
    gap: 12px;
}

/* Editor header */
#resume-tab .resume-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

#resume-tab .resume-editor-header h3 {
    margin-bottom: 0;
}

/* Draft toggle button */
#resume-tab .draft-toggle-btn {
    padding: 6px 16px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#resume-tab .draft-toggle-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

/* Draft panel */
#resume-tab .draft-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0;
}

#resume-tab .draft-panel.open {
    max-height: 400px;
    margin-bottom: 12px;
    overflow-y: auto;
}

#resume-tab .draft-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e8e8e8;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

#resume-tab .draft-save-btn {
    padding: 6px 16px;
    font-size: 13px;
}

/* Draft list */
#resume-tab .draft-list {
    padding: 8px;
}

#resume-tab .draft-empty {
    text-align: center;
    color: #999;
    font-size: 13px;
    padding: 16px 0;
    margin: 0;
}

#resume-tab .draft-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

#resume-tab .draft-item:hover {
    background: #eef0f5;
}

#resume-tab .draft-item.active {
    background: #eef1ff;
    border-left: 3px solid #667eea;
}

#resume-tab .draft-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

#resume-tab .draft-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#resume-tab .draft-time {
    font-size: 12px;
    color: #999;
}

#resume-tab .draft-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 12px;
}

#resume-tab .draft-load,
#resume-tab .draft-delete {
    padding: 4px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

#resume-tab .draft-load:hover {
    border-color: #667eea;
    color: #667eea;
}

#resume-tab .draft-item.active .draft-load {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    cursor: default;
}

#resume-tab .draft-delete {
    color: #999;
}

#resume-tab .draft-delete:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Resume buttons */
#resume-tab .resume-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    font-weight: 500;
}

#resume-tab .resume-btn:hover {
    transform: translateY(-2px);
}

#resume-tab .resume-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#resume-tab .resume-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#resume-tab .resume-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

#resume-tab .resume-btn-secondary {
    background: #6c757d;
    color: white;
}

#resume-tab .resume-btn-secondary:hover {
    background: #5a6268;
}

/* Resume preview layout */
#resume-tab .resume-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

#resume-tab .resume-preview-header h3 {
    margin-bottom: 0;
}

#resume-tab .resume-preview-actions {
    display: flex;
    gap: 12px;
}

#resume-tab .resume-preview-wrapper {
    display: flex;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 30px;
}

/* Resume preview container - A4 style */
#resume-tab .resume-preview-container {
    width: 210mm;
    max-width: 100%;
    min-height: 297mm;
    background: white;
    padding: 20mm 25mm;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}

#resume-tab .resume-preview-container h1 {
    font-size: 28px;
    margin-bottom: 4px;
}

#resume-tab .resume-preview-container h2 {
    font-size: 20px;
    margin: 24px 0 12px;
    padding-bottom: 6px;
}

#resume-tab .resume-preview-container h3 {
    font-size: 16px;
    margin: 16px 0 8px;
}

#resume-tab .resume-preview-container p {
    margin: 6px 0;
}

#resume-tab .resume-preview-container ul {
    margin: 6px 0 6px 24px;
}

#resume-tab .resume-preview-container li {
    margin: 4px 0;
    line-height: 1.6;
}

#resume-tab .resume-preview-container strong {
    font-weight: 600;
}

#resume-tab .resume-preview-container hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 16px 0;
}

#resume-tab .resume-preview-container a {
    color: inherit;
    text-decoration: none;
}

/* 模板1: 经典简约 */
#resume-tab .resume-classic h1 {
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 8px;
}

#resume-tab .resume-classic h2 {
    color: #1a1a1a;
    border-bottom: 2px solid #333;
}

#resume-tab .resume-classic h3 {
    color: #333;
}

/* 模板2: 现代双栏 */
#resume-tab .resume-modern h1 {
    color: #2c3e50;
    margin-bottom: 8px;
}

#resume-tab .resume-modern h2 {
    color: #2980b9;
    border-bottom: 2px solid #2980b9;
}

#resume-tab .resume-modern h3 {
    color: #34495e;
}

#resume-tab .resume-modern strong {
    color: #2c3e50;
}

#resume-tab .resume-modern li::marker {
    color: #2980b9;
}

/* 模板3: 创意卡片 */
#resume-tab .resume-creative h1 {
    color: #6c5ce7;
    text-align: center;
    margin-bottom: 8px;
}

#resume-tab .resume-creative h2 {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    border-bottom: none;
    display: inline-block;
    margin-top: 24px;
}

#resume-tab .resume-creative h3 {
    color: #6c5ce7;
}

#resume-tab .resume-creative strong {
    color: #6c5ce7;
}

#resume-tab .resume-creative hr {
    border-top: 2px dashed #a29bfe;
}

#resume-tab .resume-creative li::marker {
    color: #a29bfe;
}

/* 模板4: 学术科研 */
#resume-tab .resume-academic {
    font-family: 'Georgia', 'Times New Roman', serif;
}

#resume-tab .resume-academic h1 {
    color: #000;
    text-align: center;
    letter-spacing: 4px;
    border-bottom: none;
    margin-bottom: 2px;
    font-size: 26px;
}

#resume-tab .resume-academic h2 {
    color: #000;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #000;
    padding-bottom: 4px;
    margin-top: 22px;
    font-size: 17px;
}

#resume-tab .resume-academic h3 {
    color: #222;
    font-style: italic;
    font-size: 15px;
}

#resume-tab .resume-academic p,
#resume-tab .resume-academic li {
    color: #222;
    line-height: 1.75;
    font-size: 13.5px;
}

#resume-tab .resume-academic strong {
    color: #000;
}

#resume-tab .resume-academic hr {
    border-top: 1px solid #999;
}

/* 模板5: 商务精英 */
#resume-tab .resume-business h1 {
    color: #1b2a4a;
    letter-spacing: 2px;
}

#resume-tab .resume-business h2 {
    color: #1b2a4a;
    border-left: 4px solid #c9a961;
    padding-left: 12px;
    border-bottom: none;
    margin-top: 24px;
    font-size: 18px;
}

#resume-tab .resume-business h3 {
    color: #2c3e50;
    font-size: 15px;
}

#resume-tab .resume-business strong {
    color: #1b2a4a;
}

#resume-tab .resume-business hr {
    border-top: 1px solid #c9a961;
}

#resume-tab .resume-business li {
    list-style-type: square;
}

#resume-tab .resume-business li::marker {
    color: #c9a961;
}

/* 模板6: 清新文艺 */
#resume-tab .resume-fresh h1 {
    color: #2d8f5e;
    text-align: center;
}

#resume-tab .resume-fresh h2 {
    color: #27ae60;
    border-bottom: 2px solid #a8e6cf;
    padding-bottom: 6px;
    margin-top: 22px;
}

#resume-tab .resume-fresh h3 {
    color: #2d8f5e;
}

#resume-tab .resume-fresh strong {
    color: #27ae60;
}

#resume-tab .resume-fresh hr {
    border-top: 2px dotted #a8e6cf;
}

#resume-tab .resume-fresh li::marker {
    color: #6dd5a0;
}

/* 模板7: 科技极客 */
#resume-tab .resume-tech {
    background: #1a1a2e;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 20mm;
}

#resume-tab .resume-tech h1 {
    color: #00d4ff;
    font-family: 'Courier New', monospace;
    text-align: left;
    font-size: 26px;
}

#resume-tab .resume-tech h2 {
    color: #00d4ff;
    font-family: 'Courier New', monospace;
    border-bottom: 1px solid #16213e;
    padding-bottom: 4px;
    margin-top: 22px;
    font-size: 18px;
}

#resume-tab .resume-tech h3 {
    color: #7fdbca;
    font-size: 15px;
}

#resume-tab .resume-tech p,
#resume-tab .resume-tech li {
    color: #c5c8c6;
}

#resume-tab .resume-tech strong {
    color: #00d4ff;
}

#resume-tab .resume-tech hr {
    border-top: 1px solid #16213e;
}

#resume-tab .resume-tech li::marker {
    color: #00d4ff;
}

#resume-tab .resume-tech code {
    background: #16213e;
    color: #7fdbca;
    padding: 1px 4px;
    border-radius: 3px;
}

/* 简历工具响应式设计 */
@media (max-width: 768px) {
    #resume-tab #resume-markdownInput {
        min-height: 300px;
        font-size: 13px;
    }

    #resume-tab .resume-template-picker {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    #resume-tab .resume-btn {
        width: 100%;
        text-align: center;
    }

    #resume-tab .resume-actions {
        flex-direction: column;
    }

    #resume-tab .draft-panel-header {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    #resume-tab .draft-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    #resume-tab .draft-actions {
        margin-left: 0;
        width: 100%;
    }

    #resume-tab .draft-load,
    #resume-tab .draft-delete {
        flex: 1;
        text-align: center;
    }

    #resume-tab .resume-preview-header {
        flex-direction: column;
        align-items: flex-start;
    }

    #resume-tab .resume-preview-actions {
        width: 100%;
    }

    #resume-tab .resume-preview-actions .resume-btn {
        flex: 1;
    }

    #resume-tab .resume-preview-wrapper {
        padding: 10px;
    }

    #resume-tab .resume-preview-container {
        padding: 10mm 12mm;
    }
}
