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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fafafa;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0;
    border-bottom: 1px solid #eee;
}

.profile-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.hero .title {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
    margin-bottom: 24px;
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.social-links a {
    color: #666;
    transition: color 0.2s ease, transform 0.2s ease;
    padding: 8px;
}

.social-links a:hover {
    color: #0066cc;
    transform: translateY(-2px);
}

.social-links svg {
    width: 22px;
    height: 22px;
}

/* Sections */
.section {
    padding: 48px 0;
    border-bottom: 1px solid #eee;
}

.section:last-of-type {
    border-bottom: none;
}

.section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 24px;
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: #0066cc;
    border-radius: 2px;
}

.section p {
    color: #555;
    font-size: 1rem;
    line-height: 1.8;
}

/* Timeline (Experience & Education) */
.timeline {
    position: relative;
}

.timeline-item {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-date {
    flex-shrink: 0;
    width: 140px;
    font-size: 0.9rem;
    color: #888;
    font-weight: 500;
}

.timeline-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-content .organization {
    font-size: 0.95rem;
    color: #666;
}

.organization-link {
    color: #0066cc;
    text-decoration: none;
}

.organization-link:hover {
    text-decoration: underline;
}

.timeline-item.clickable {
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.timeline-item.clickable:hover {
    background: #f0f5ff;
}

/* Publications */
.publication-list {
    list-style: none;
}

.publication-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.publication-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.publication-item:last-child {
    margin-bottom: 0;
}

.publication-item.clickable {
    cursor: pointer;
}

.publication-item.clickable:hover {
    border-color: #0066cc;
}

.pub-image {
    flex-shrink: 0;
    width: 200px;
    height: auto;
    max-height: 140px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8f8f8;
}

.pub-content {
    flex: 1;
    min-width: 0;
}

.pub-title {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-size: 1rem;
}

.expand-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #0066cc;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.publication-item.clickable:hover .expand-icon {
    opacity: 1;
}

.pub-venue {
    display: inline-block;
    background: #e8f4fd;
    color: #0066cc;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 8px;
}

.pub-authors {
    display: block;
    color: #666;
    font-size: 0.9rem;
    margin-top: 8px;
}

.pub-links {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pub-links a {
    display: inline-block;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.pub-links a:hover {
    background: #e8f4fd;
}

/* Link Preview Card */
.link-preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 0.9rem;
    background: #f5f5f5;
}

.link-preview-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 32px;
    background: #f5f5f5;
}

.link-preview-card {
    display: block;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    max-width: 480px;
    width: 100%;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.link-preview-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.14);
    transform: translateY(-2px);
}

.link-preview-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: #eee;
}

.link-preview-body {
    padding: 16px 20px 20px;
}

.link-preview-site {
    display: block;
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.link-preview-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin: 0 0 8px;
}

.link-preview-desc {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    color: #999;
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 40px 20px;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 1000px;
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    padding-right: 40px;
}

.modal-authors {
    color: #666;
    font-size: 0.95rem;
    margin-top: 12px;
}

/* Modal Split Layout */
.modal-split {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* Story Panel */
.modal-story {
    width: 360px;
    flex-shrink: 0;
    padding: 24px 20px;
    background: #f8f9fa;
    border-right: 1px solid #eee;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.story-message {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.story-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.story-bubble {
    background: #fff;
    padding: 14px 16px;
    border-radius: 12px;
    border-top-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    width: 100%;
}

.story-bubble p {
    color: #444;
    line-height: 1.75;
    font-size: 0.9rem;
    margin: 0;
    word-break: keep-all;
}

.story-date {
    display: block;
    margin-top: 10px;
    color: #aaa;
    font-size: 0.78rem;
}

/* Modal Body */
.modal-body {
    flex: 1;
    background: #333;
    min-width: 0;
    overflow: hidden;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    min-height: 500px;
    border: none;
    display: block;
}

.modal-body .blog-frame {
    background: #fff;
}

.modal-body .no-content {
    padding: 60px 32px;
    text-align: center;
    color: #999;
    background: #f5f5f5;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body .no-content a {
    color: #0066cc;
}

.edu-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #111;
    display: block;
}

.modal-body .loading {
    padding: 60px 32px;
    text-align: center;
    color: #666;
    background: #f5f5f5;
}

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

    .hero {
        padding: 40px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .profile-img {
        width: 120px;
        height: 120px;
    }

    .section {
        padding: 32px 0;
    }

    .timeline-item {
        flex-direction: column;
        gap: 4px;
    }

    .timeline-date {
        width: auto;
        font-size: 0.85rem;
    }

    .publication-item {
        flex-direction: column;
        padding: 16px;
    }

    .pub-image {
        width: 100%;
        height: auto;
        max-height: none;
    }

    .modal {
        padding: 20px 12px;
    }

    .modal-content {
        max-height: calc(100vh - 40px);
    }

    .modal-header {
        padding: 24px 20px 20px;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .modal-split {
        flex-direction: column;
        min-height: unset;
    }

    .modal-story {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding: 20px;
    }

    .story-message {
        flex-direction: row;
        gap: 12px;
        align-items: flex-start;
    }

    .story-avatar {
        width: 36px;
        height: 36px;
    }

    .story-bubble {
        padding: 12px 14px;
    }

    .modal-body iframe {
        height: 50vh;
        min-height: 300px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero .title {
        font-size: 1rem;
    }

    .social-links {
        gap: 12px;
    }

    .social-links svg {
        width: 20px;
        height: 20px;
    }
}
