/* Base styles */
:root {
    --accent: #2f4fc7;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
    min-height: 100vh;
}

h1 {
    margin-bottom: 10px;
    color: #2c3e50;
    text-align: center;
    padding: 20px 0;
}

hr {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #ddd, transparent);
    margin: 20px 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s;
}

/* Header section */
.title-container {
    text-align: center;
    margin: 20px 0;
}

.title {
    display: inline-block;
    font-family: 'Courier New', monospace;
    color: #2c3e50;
    font-weight: bold;
    font-size: 2.2rem;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #2c3e50;
    animation-name: typing, blink-caret;
    animation-duration: 2.2s, 0.2s;
    animation-timing-function: steps(11, end), step-end;
    animation-iteration-count: 1, 11;
}

/* Intro section */
.intro {
    margin-bottom: 30px;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
}

.intro-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.intro-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid #e3e7ee;
    border-radius: 999px;
    background: #f8f9fb;
    color: #2c3e50;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}

.intro-link > i:first-child {
    color: var(--accent);
    font-size: 0.95rem;
    transition: color 0.2s;
}

.intro-link .external-icon {
    margin-left: 0;
    font-size: 0.8em;
    opacity: 0.55;
    transition: opacity 0.2s;
}

.intro-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

.intro-link:hover > i {
    color: #fff;
}

.intro-link:hover .external-icon {
    opacity: 1;
}

.intro-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Animations */
@keyframes typing {
    from { width: 0; }
    to { width: calc(2.2 * 11 * 0.61rem); } /* Adjusted for "D:/Xianzhao" text, 2.2 font size, 0.61rem character width */
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #2c3e50; }
}

/* Projects */
.projects-section {
    margin-bottom: 40px;
}

.projects-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
}

.projects-title {
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    color: #2c3e50;
    font-size: 1.15rem;
    line-height: 1.4;
}

.projects-item {
    display: flex;
    align-items: stretch;
    gap: 16px;
    padding-top: 14px;
}

.projects-item + .projects-item {
    margin-top: 12px;
}

.projects-thumb {
    flex: 0 0 160px;
    width: 160px;
    height: auto;
    min-height: 100px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f4f6f8;
    object-fit: cover;
}

.projects-content {
    flex: 1;
    min-width: 0;
}

.projects-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.projects-name {
    margin-bottom: 2px;
    color: #2c3e50;
    font-size: 1rem;
    line-height: 1.45;
}

.projects-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.projects-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border: 1px solid #e6eaf0;
    border-radius: 999px;
    background: #f7f8fb;
    color: #65717c;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.projects-name a {
    color: inherit;
}

.projects-name a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.projects-date {
    flex-shrink: 0;
    padding-top: 1px;
    color: #65717c;
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: right;
    white-space: nowrap;
}

.projects-summary {
    margin-top: 7px;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

.external-icon {
    margin-left: 3px;
    font-size: 0.75em;
    vertical-align: 0.08em;
}

/* Responsive design */
@media (max-width: 768px) {
    .title {
        font-size: 1.8rem;
    }

    .projects-header {
        flex-direction: column;
        gap: 5px;
    }

    .projects-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .projects-thumb {
        flex: none;
        width: 100%;
        max-width: 240px;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 10;
    }

    .projects-date {
        padding-top: 0;
        text-align: left;
        white-space: normal;
    }

    @keyframes typing {
        from { width: 0; }
        to { width: calc(1.8 * 11 * 0.61rem); } /* Adjusted for mobile */
    }
}

@media (max-width: 576px) {
    body {
        padding: 15px;
    }

    .title {
        font-size: 1.6rem;
    }

    @keyframes typing {
        from { width: 0; }
        to { width: calc(1.6 * 11 * 0.61rem); } /* Adjusted for small mobile */
    }
}