* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: white;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: calc(100vh - 40px);
}

/* 头部样式 */
.header-section {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 25px 30px;
    text-align: center;
    position: relative;
}

.header-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.05)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.header-section > * {
    position: relative;
    z-index: 1;
}

.profile-image {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.profile-image:hover {
    transform: scale(1.05);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.title {
    font-size: 15px;
    color: #bdc3c7;
    font-weight: 300;
    margin-bottom: 20px;
}

.contact-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: inherit;
    text-decoration: none;
}

.contact-item:visited {
    color: inherit;
}

.contact-item:active {
    transform: translateY(0);
}

.contact-item i {
    color: #3498db;
    margin-right: 10px;
    font-size: 16px;
}

/* 主内容区样式 */
.main-content {
    padding: 30px 40px;
    background: #fafafa;
}

/* 技能网格样式 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.skill-item {
    margin-bottom: 20px;
}

.skill-name {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.skill-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 5px;
    width: 0;
    transition: width 1.5s ease-in-out;
}

/* 语言能力样式 */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.language-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.language-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.language-name {
    font-weight: 500;
    color: #2c3e50;
}

.level {
    background: linear-gradient(45deg, #3498db, #2ecc71);
    color: white;
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.main-content section {
    margin-bottom: 30px;
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-content section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.main-content h2 {
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid #3498db;
}

.main-content h2 i {
    color: #3498db;
    font-size: 22px;
}

.about-section p {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
}

/* 时间轴样式 */
.timeline-item {
    display: flex;
    margin-bottom: 30px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 140px;
    top: 0;
    bottom: -30px;
    width: 2px;
    background: linear-gradient(180deg, #3498db, #2ecc71);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 135px;
    top: 8px;
    width: 12px;
    height: 12px;
    background: #3498db;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #3498db;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-date {
    width: 120px;
    font-weight: 600;
    color: #3498db;
    font-size: 14px;
    padding-top: 5px;
}

.timeline-content {
    flex: 1;
    margin-left: 40px;
}

.timeline-content h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.timeline-content h4 {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 15px;
    font-weight: 500;
}

.timeline-content ul {
    list-style: none;
    padding-left: 0;
}

.timeline-content li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    color: #555;
}

.timeline-content li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #3498db;
    font-weight: bold;
}

/* 项目样式 */
.project-item {
    margin-bottom: 30px;
    padding: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.project-item:hover {
    border-color: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.1);
}

.project-item h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.project-tech {
    margin-bottom: 15px;
}

.tech-tag {
    display: inline-block;
    background: linear-gradient(45deg, #3498db, #2ecc71);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    margin-right: 8px;
    margin-bottom: 8px;
    font-weight: 500;
}

.project-item p {
    color: #555;
    line-height: 1.6;
}

/* 教育背景样式 */
.education-item {
    display: flex;
    margin-bottom: 25px;
}

.education-date {
    width: 140px;
    font-weight: 600;
    color: #3498db;
    font-size: 14px;
    padding-top: 5px;
}

.education-content {
    flex: 1;
    margin-left: 20px;
}

.education-content h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 5px;
}

.education-content h4 {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 500;
}

.education-content p {
    color: #555;
    line-height: 1.6;
}

/* 证书网格样式 */
.certificate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.certificate-item {
    text-align: center;
    padding: 25px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.certificate-item:hover {
    border-color: #3498db;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.15);
}

.certificate-item i {
    font-size: 32px;
    color: #3498db;
    margin-bottom: 15px;
}

.certificate-item h4 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.certificate-item p {
    color: #7f8c8d;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    .header-section {
        padding: 20px 15px;
    }
    
    .profile-image {
        width: 80px;
        height: 80px;
    }
    
    .name {
        font-size: 24px;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .languages-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-item {
        flex-direction: column;
    }
    
    .timeline-item::before,
    .timeline-item::after {
        display: none;
    }
    
    .timeline-date {
        width: 100%;
        margin-bottom: 10px;
        font-size: 16px;
    }
    
    .timeline-content {
        margin-left: 0;
    }
    
    .education-item {
        flex-direction: column;
    }
    
    .education-date {
        width: 100%;
        margin-bottom: 10px;
        font-size: 16px;
    }
    
    .education-content {
        margin-left: 0;
    }
    
    .certificate-grid {
        grid-template-columns: 1fr;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content section {
    animation: fadeInUp 0.6s ease-out;
}

.main-content section:nth-child(1) { animation-delay: 0.1s; }
.main-content section:nth-child(2) { animation-delay: 0.2s; }
.main-content section:nth-child(3) { animation-delay: 0.3s; }
.main-content section:nth-child(4) { animation-delay: 0.4s; }
.main-content section:nth-child(5) { animation-delay: 0.5s; }

/* 打印样式 */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* 强制显示所有内容，忽略滚动动画 */
    .main-content section {
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
        animation: none !important;
        transition: none !important;
    }
    
    /* 确保所有元素都可见 */
    * {
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    @page {
        margin: 0.5in;
        size: A4;
    }
    
    body {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 11pt !important;
        line-height: 1.3 !important;
    }
    
    .container {
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
        width: 100% !important;
        min-height: auto !important;
    }
    
    .header-section {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
        color: white !important;
        padding: 15px 20px !important;
        page-break-inside: avoid;
        margin-bottom: 0 !important;
    }
    
    .profile-image {
        width: 70px !important;
        height: 70px !important;
        margin: 0 auto 12px !important;
    }
    
    .name {
        font-size: 20pt !important;
        margin-bottom: 4px !important;
    }
    
    .title {
        font-size: 12pt !important;
        margin-bottom: 12px !important;
    }
    
    .contact-info {
        gap: 6px !important;
        margin-top: 8px !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        display: flex !important;
    }
    
    .contact-item {
        padding: 3px 8px !important;
        font-size: 8pt !important;
        margin-bottom: 0 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
    
    .main-content {
        padding: 10px 15px !important;
        background: white !important;
    }
    
    .main-content section {
        box-shadow: none !important;
        border: 1px solid #e0e0e0 !important;
        margin-bottom: 12px !important;
        padding: 12px !important;
        page-break-inside: avoid;
        border-radius: 3px !important;
    }
    
    .main-content section:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    .main-content h2 {
        font-size: 14pt !important;
        margin-bottom: 10px !important;
        padding-bottom: 6px !important;
        border-bottom: 1.5px solid #3498db !important;
        page-break-after: avoid;
    }
    
    .main-content h2 i {
        font-size: 12pt !important;
    }
    
    .about-section p {
        font-size: 10pt !important;
        line-height: 1.4 !important;
    }
    
    .timeline-item {
        margin-bottom: 12px !important;
        page-break-inside: avoid;
    }
    
    .timeline-date {
        font-size: 9pt !important;
        width: 100px !important;
    }
    
    .timeline-content {
        margin-left: 20px !important;
    }
    
    .timeline-content h3 {
        font-size: 12pt !important;
        margin-bottom: 2px !important;
    }
    
    .timeline-content h4 {
        font-size: 10pt !important;
        margin-bottom: 6px !important;
    }
    
    .timeline-content li {
        font-size: 9pt !important;
        margin-bottom: 3px !important;
        line-height: 1.3 !important;
    }
    
    .project-item {
        margin-bottom: 12px !important;
        padding: 12px !important;
        page-break-inside: avoid;
    }
    
    .project-item h3 {
        font-size: 12pt !important;
        margin-bottom: 8px !important;
    }
    
    .project-item p {
        font-size: 9pt !important;
        line-height: 1.3 !important;
    }
    
    .tech-tag {
        font-size: 8pt !important;
        padding: 1px 6px !important;
        margin-right: 4px !important;
        margin-bottom: 4px !important;
    }
    
    .education-item {
        margin-bottom: 10px !important;
        page-break-inside: avoid;
    }
    
    .education-date {
        font-size: 9pt !important;
        width: 120px !important;
    }
    
    .education-content {
        margin-left: 15px !important;
    }
    
    .education-content h3 {
        font-size: 12pt !important;
        margin-bottom: 2px !important;
    }
    
    .education-content h4 {
        font-size: 10pt !important;
        margin-bottom: 4px !important;
    }
    
    .education-content p {
        font-size: 9pt !important;
    }
    
    .skills-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .skill-item {
        margin-bottom: 8px !important;
    }
    
    .skill-name {
        font-size: 10pt !important;
        margin-bottom: 4px !important;
    }
    
    .skill-bar {
        height: 5px !important;
    }
    
    .certificate-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    
    .certificate-item {
        padding: 8px !important;
        border: 1px solid #e0e0e0 !important;
    }
    
    .certificate-item i {
        font-size: 16pt !important;
    }
    
    .certificate-item h4 {
        font-size: 10pt !important;
        margin-bottom: 2px !important;
    }
    
    .certificate-item p {
        font-size: 8pt !important;
    }
    
    .languages-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .language-item {
        padding: 6px 10px !important;
        font-size: 10pt !important;
    }
    
    .level {
        font-size: 8pt !important;
        padding: 3px 8px !important;
    }
    
    /* 隐藏打印按钮和不必要的元素 */
    .print-button,
    .mobile-menu-toggle {
        display: none !important;
    }
    
    /* 确保页面分页合理 */
    .header-section {
        page-break-after: avoid;
    }
    
    .main-content section:last-child {
        page-break-after: auto;
    }
    
    /* 优化分页 */
    .experience-section,
    .projects-section {
        page-break-inside: auto;
    }
    
    .timeline-item:nth-child(3) {
        page-break-before: auto;
    }
    
    /* 链接样式 */
    a {
        color: inherit !important;
        text-decoration: none !important;
    }
    
    /* 强制显示背景色 */
    .header-section,
    .contact-item,
    .tech-tag,
    .level {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* 时间轴样式优化 */
    .timeline-item::before,
    .timeline-item::after {
        display: none !important;
    }
}
