/* ===== CSS Variables & Theme ===== */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --text: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 10px;
    --max-width: 920px;
    --nav-height: 60px;
    --transition: 0.25s ease;
}

[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-hover: #93c5fd;
    --primary-light: #1e3a5f;
    --text: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --bg: #111827;
    --bg-secondary: #1f2937;
    --bg-card: #1f2937;
    --border: #374151;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.4);
}

/* ===== Reset ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 15px;
    transition: background var(--transition), color var(--transition);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Navigation ===== */
.navbar {
    position: sticky;
    top: 0;
    height: var(--nav-height);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background var(--transition), box-shadow var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-lg);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.nav-brand:hover {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.8rem;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    padding: 0.3rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    transition: all var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
}

.hamburger span {
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu .mobile-link {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
}

.mobile-menu .mobile-link:hover {
    color: var(--primary);
}

/* ===== Container ===== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== Profile ===== */
.profile {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
    padding: 3rem 0 2.5rem;
}

.profile-photo-wrapper {
    flex-shrink: 0;
}

.profile-photo {
    width: 180px;
    height: 240px;
    border-radius: var(--radius);
    object-fit: cover;
    border: 2px solid var(--border);
    transition: transform 0.3s, box-shadow 0.3s;
}

.profile-photo:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.profile-name {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: -0.02em;
}

.profile-title {
    color: var(--primary);
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.profile-affiliation {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

.profile-links {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.profile-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition);
}

.profile-links a:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ===== Sections ===== */
.section {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1.2rem;
    letter-spacing: -0.01em;
}

/* Biography */
.bio p {
    margin-bottom: 0.8rem;
    line-height: 1.8;
}

.bio p:last-child {
    margin-bottom: 0;
}

/* News */
.news-list {
    list-style: none;
}

.news-list li {
    display: flex;
    gap: 1.2rem;
    padding: 0.65rem 0;
    align-items: baseline;
    border-bottom: 1px dashed var(--border);
}

.news-list li:last-child {
    border-bottom: none;
}

.news-date {
    color: var(--text-muted);
    font-size: 0.83rem;
    font-weight: 600;
    min-width: 80px;
    flex-shrink: 0;
}

.news-content {
    font-size: 0.92rem;
    color: var(--text);
}

/* Publications */
.pub-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 0;
    align-items: flex-start;
    border-bottom: 1px solid var(--border);
}

.pub-item:last-child {
    border-bottom: none;
}

.pub-thumb {
    width: 160px;
    height: 105px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    transition: transform 0.3s;
}

.pub-thumb:hover {
    transform: scale(1.03);
}

.pub-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    line-height: 1.4;
}

.pub-authors {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.pub-venue {
    font-size: 0.84rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.5rem;
}

.pub-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.4rem;
}

.badge-oral {
    background: #fef3c7;
    color: #92400e;
}

.badge-highlight {
    background: #d1fae5;
    color: #065f46;
}

.badge-spotlight {
    background: #e0e7ff;
    color: #3730a3;
}

[data-theme="dark"] .badge-oral {
    background: #78350f;
    color: #fef3c7;
}

[data-theme="dark"] .badge-highlight {
    background: #064e3b;
    color: #d1fae5;
}

[data-theme="dark"] .badge-spotlight {
    background: #312e81;
    color: #e0e7ff;
}

.pub-links {
    margin-top: 0.3rem;
}

.pub-links a {
    font-size: 0.82rem;
    margin-right: 0.7rem;
    font-weight: 600;
}

/* Experience / Awards */
.exp-list {
    display: flex;
    flex-direction: column;
}

.exp-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.exp-item:last-child {
    border-bottom: none;
}

.exp-org {
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
}

.exp-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 0.15rem;
}

.exp-year {
    font-size: 0.83rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Services */
.services p {
    margin-bottom: 0.5rem;
    font-size: 0.93rem;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 2rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

/* ===== Responsive: Tablet (768px ~ 1024px) ===== */
@media (max-width: 1024px) {
    .profile {
        gap: 2rem;
    }

    .profile-photo {
        width: 150px;
        height: 150px;
    }

    .pub-thumb {
        width: 140px;
        height: 90px;
    }
}

/* ===== Responsive: Mobile (< 768px) ===== */
@media (max-width: 768px) {
    :root {
        --nav-height: 56px;
    }

    body {
        font-size: 14px;
    }

    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .mobile-menu {
        display: flex;
    }

    .profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 2rem 0;
    }

    .profile-photo {
        width: 140px;
        height: 140px;
    }

    .profile-name {
        font-size: 1.6rem;
    }

    .profile-links {
        justify-content: center;
    }

    .pub-item {
        flex-direction: column;
        gap: 1rem;
    }

    .pub-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .news-list li {
        flex-direction: column;
        gap: 0.2rem;
    }

    .news-date {
        min-width: auto;
    }

    .exp-item {
        flex-direction: column;
        gap: 0.2rem;
    }

    .exp-year {
        color: var(--text-muted);
    }

    .section-title {
        font-size: 1.2rem;
    }
}

/* ===== Responsive: Small Mobile (< 480px) ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

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

    .profile-links a span {
        display: none;
    }

    .profile-links a {
        padding: 0.5rem 0.6rem;
    }
}

/* ===== Animations ===== */
@media (prefers-reduced-motion: no-preference) {
    .section {
        animation: fadeInUp 0.5s ease backwards;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ===== Print Styles ===== */
@media print {
    nav, .theme-toggle, .hamburger, .mobile-menu {
        display: none !important;
    }

    body {
        font-size: 12px;
    }

    .container {
        max-width: 100%;
    }
}
