* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --accent-color: #3b82f6;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.lang-switcher {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.lang-switcher:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.profile-section {
    display: flex;
    align-items: center;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.profile-image {
    flex-shrink: 0;
}

.avatar-placeholder {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.profile-info .name-block {
    position: relative;
    display: inline-block;
    margin-bottom: 10px;
}

.profile-info h1 {
    font-size: 42px;
    margin-bottom: 0;
    font-weight: 700;
}

.profile-info .motto {
    position: absolute;
    left: 100%;
    bottom: 0;
    margin-left: 12px;
    margin-bottom: 0;
    font-size: 13px;
    font-style: italic;
    opacity: 0.9;
    white-space: nowrap;
}

.title {
    font-size: 20px;
    opacity: 0.95;
    margin-bottom: 15px;
}

.contact-info {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    font-size: 14px;
    opacity: 0.9;
    justify-content: flex-start;
    text-align: left;
}

.contact-info .contact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.contact-info .contact-icon {
    font-style: normal;
    flex-shrink: 0;
    min-width: 1.2em;
    text-align: left;
}

.contact-info .contact-text {
    word-break: break-all;
    text-align: left;
}

/* 章节样式 */
.section {
    padding: 50px 40px;
    border-bottom: 1px solid var(--border-color);
    animation: slideIn 0.6s ease-out;
}

.section:last-of-type {
    border-bottom: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-title {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--accent-color);
    display: inline-block;
    font-weight: 700;
}

.content p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-light);
}

/* 技能网格 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.skill-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.skill-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.skill-card h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: white;
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* 时间线 */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -46px;
    top: 5px;
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--accent-color);
}

.timeline-date {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
}

.timeline-content h3 {
    font-size: 22px;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.company {
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 15px;
}

.achievements {
    list-style: none;
    padding-left: 0;
}

.achievements li {
    padding: 8px 0 8px 25px;
    position: relative;
    color: var(--text-light);
    line-height: 1.6;
}

.achievements li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* 项目卡片 */
.projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
    transition: all 0.3s ease;
}

.project-card p {
    margin-bottom: 12px;
    line-height: 1.7;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.project-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.project-desc {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 14px;
}

.project-card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.project-card li {
    padding: 6px 0 6px 20px;
    position: relative;
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
}

.project-card li ul {
    margin-top: 8px;
    padding-left: 20px;
}

.project-card li ul li {
    padding: 4px 0 4px 20px;
    font-size: 13px;
}

.project-card li ul li::before {
    content: '◦';
    font-size: 16px;
}

.project-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.project-card li strong {
    color: var(--text-dark);
    font-weight: 600;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tech {
    background: white;
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    font-weight: 500;
}

/* Project fullscreen modal */
.project-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 20px;
}

.project-modal {
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 40px 36px;
    position: relative;
}

.project-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.project-modal-close:hover {
    color: var(--text-dark);
}

.project-modal .timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 0;
    cursor: default;
}

.project-modal .timeline-item::before {
    display: none;
}

.project-modal .timeline-date {
    font-size: 16px;
    margin-bottom: 12px;
}

.project-modal .timeline-content h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.project-modal .timeline-content {
    padding-left: 0;
}

/* 教育背景 */
.education-item {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
}

.education-item h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.education-item p {
    margin-bottom: 8px;
}

.education-desc {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

/* 个人优势 */
.advantages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
}

.advantage-item {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-light);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.advantage-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.advantage-item .icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.advantage-item h4 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.advantage-item p {
    font-size: 14px;
    color: var(--text-light);
}

/* 页脚 */
.footer {
    background: var(--bg-light);
    padding: 30px 40px;
    text-align: center;
    color: var(--text-light);
}

.footer p {
    margin: 5px 0;
    font-size: 14px;
}

.footer-note {
    font-size: 12px;
    opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 12px;
    }

    .header {
        padding: 36px 20px 32px;
        min-height: 0;
    }

    .lang-switcher {
        top: 14px;
        right: 14px;
        padding: 5px 10px;
        font-size: 13px;
    }

    .profile-section {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .profile-info {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 0 8px;
    }

    .profile-info .name-block {
        display: block;
        width: 100%;
        margin-bottom: 12px;
    }

    .profile-info h1 {
        font-size: 28px;
        display: block;
    }

    .profile-info .motto {
        position: static;
        display: block;
        margin-top: 4px;
        margin-left: 0;
        white-space: normal;
        font-size: 12px;
        text-align: center;
    }

    .profile-info .title {
        font-size: 16px;
        margin-bottom: 14px;
        text-align: center;
    }

    .contact-info {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        width: 100%;
        max-width: 100%;
        text-align: left;
    }

    .contact-info .contact-item {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 24px;
        width: 100%;
        box-sizing: border-box;
    }

    .contact-info .contact-icon {
        width: 22px;
        min-width: 22px;
        text-align: left;
        flex-shrink: 0;
    }

    .contact-info .contact-text {
        flex: 1;
        min-width: 0;
        word-break: break-all;
        text-align: left;
    }

    .section {
        padding: 28px 20px;
    }

    .section-title {
        font-size: 22px;
    }

    .skills-grid,
    .projects,
    .advantages {
        grid-template-columns: 1fr;
    }

    .timeline {
        padding-left: 30px;
    }

    .timeline-item::before {
        left: -36px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
        border-radius: 0;
    }

    .header {
        background: var(--primary-color);
        padding: 24px 32px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .header .profile-section {
        gap: 20px;
    }

    .header .avatar-placeholder {
        width: 72px;
        height: 72px;
    }

    .header .profile-info h1 {
        font-size: 26px;
    }

    .header .profile-info .motto {
        font-size: 12px;
    }

    .header .profile-info .title {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .header .contact-info {
        font-size: 12px;
        gap: 16px;
    }

    .value-proposition-block {
        page-break-inside: avoid;
    }

    .value-proposition-block .section {
        padding: 16px 32px 20px;
    }

    .value-proposition-block .section-title {
        font-size: 22px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .value-proposition-block .content p,
    .value-proposition-block .achievements li {
        font-size: 14px;
        line-height: 1.6;
    }

    .value-proposition-block .achievements li {
        padding: 4px 0 4px 20px;
    }

    .section {
        page-break-inside: avoid;
    }
}
