* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 30px 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 18px;
    opacity: 0.9;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.input-section, .preview-section {
    background: white;
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.input-section h2 {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.preview-header h2 {
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group {
    margin-bottom: 25px;
}

textarea {
    width: 100%;
    height: 160px;
    padding: 18px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 15px;
    resize: vertical;
    transition: all 0.3s;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea::placeholder {
    color: #999;
}

.optimize-hints-group textarea {
    height: auto;
    min-height: 88px;
}

.field-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #888;
    line-height: 1.5;
}

.resume-preview .target-job-line {
    text-align: center;
    color: #667eea;
    font-size: 15px;
    margin-bottom: 12px;
    font-weight: 600;
}

.upload-btn {
    margin-top: 12px;
}

.upload-btn input[type="file"] {
    display: none;
}

.upload-btn label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.3s;
}

.upload-btn label:hover {
    background: #f1f3f4;
    border-color: #667eea;
    color: #667eea;
}

.upload-btn.resume-upload label {
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    border-color: #90cdf4;
}

.upload-btn.resume-upload label:hover {
    background: #ebf8ff;
    border-color: #3182ce;
    color: #2c5282;
}

.ocr-status {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    min-height: 20px;
}

.basic-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.basic-info input {
    padding: 14px 18px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

.basic-info input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.basic-info input::placeholder {
    color: #999;
}

.actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

#optimize-btn {
    padding: 14px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#optimize-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

#optimize-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#download-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#download-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

#download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.preview-content {
    min-height: 450px;
    border: 2px dashed #e8e8e8;
    border-radius: 12px;
    padding: 25px;
    margin-top: 10px;
    background: #fafafa;
}

.placeholder {
    text-align: center;
    color: #bbb;
    padding: 80px 0;
    font-size: 15px;
}

/* 简优简历版式（预览 + 导出共用） */
.preview-content .jy-resume {
    background: #fff;
    padding: 20px 28px 28px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.jy-resume {
    position: relative;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    color: #000;
    font-size: 14px;
    line-height: 1.65;
}

.jy-resume,
.jy-resume * {
    color: #000;
}

.jy-resume .rs-header,
.jy-resume .rs-body {
    position: relative;
    z-index: 1;
}

.jy-resume .rs-header {
    text-align: center;
    margin: 0 0 14px;
    padding: 0 0 10px;
    border-bottom: 2px solid #000;
}

.jy-resume .rs-header-has-photo {
    padding-right: 100px;
    padding-left: 8px;
    min-height: 118px;
}

.jy-resume .rs-photo-wrap {
    position: absolute;
    top: 0;
    right: 12px;
    width: 88px;
    height: 110px;
}

.jy-resume .rs-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border: 1px solid #000;
    display: block;
    background: #fff;
}

.jy-resume .rs-name {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: 2px;
    color: #000;
}

.jy-resume .rs-meta,
.jy-resume .rs-intent {
    font-size: 13px;
    color: #000;
    margin: 3px 0;
}

.jy-resume .rs-section {
    margin-top: 14px;
}

.jy-resume .rs-section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #000;
    color: #000;
}

.jy-resume .rs-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}

.jy-resume .rs-entry-left {
    flex: 1;
}

.jy-resume .rs-entry-right {
    flex-shrink: 0;
    font-size: 13px;
    color: #000;
}

.jy-resume .rs-block {
    margin-bottom: 12px;
}

.jy-resume .rs-label {
    font-weight: 700;
}

.jy-resume .rs-label-line,
.jy-resume .rs-paragraph {
    margin: 4px 0;
    text-align: justify;
}

.jy-resume .rs-list {
    margin: 4px 0 0;
    padding-left: 1.2em;
}

.jy-resume .rs-list li {
    margin-bottom: 6px;
    text-align: justify;
}

.jy-resume .rs-skill-line {
    margin: 3px 0;
}

.photo-upload-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.photo-preview {
    width: 96px;
    height: 120px;
    flex-shrink: 0;
    border: 1px dashed #ccc;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.photo-placeholder {
    font-size: 13px;
    color: #999;
}

.photo-upload-actions {
    flex: 1;
}

.photo-upload-label {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 10px;
}

#avatar-image {
    display: none;
}

.photo-clear-btn {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    color: #666;
}

.photo-clear-btn:hover {
    border-color: #cbd5e0;
}

.pdf-export-sandbox {
    position: fixed;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

footer {
    text-align: center;
    color: rgba(255,255,255,0.8);
    margin-top: 40px;
    font-size: 14px;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 32px;
    }
    
    .basic-info {
        grid-template-columns: 1fr;
    }
    
    .actions {
        flex-direction: column;
        gap: 15px;
    }
    
    #optimize-btn {
        width: 100%;
    }
}