/* =============================================
   Minimal Academic Personal Website
   ============================================= */

:root {
    --accent:    #2563eb;
    --accent-light: #eff6ff;
    --text:      #1a1a2e;
    --muted:     #6b7280;
    --border:    #e5e7eb;
    --bg:        #ffffff;
    --bg-alt:    #f9fafb;
    --radius:    8px;
    --max-width: 860px;
    --font-sans: 'Google Sans', 'Noto Sans', system-ui, sans-serif;
}

[data-theme="dark"] {
    --accent:       #60a5fa;
    --accent-light: #1e3a5f;
    --text:         #f1f5f9;
    --muted:        #94a3b8;
    --border:       #334155;
    --bg:           #0f172a;
    --bg-alt:       #1e293b;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Hero ---- */
.hero {
    padding: 72px 24px 64px;
    max-width: var(--max-width);
    margin: 0 auto;
}
.hero-inner {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}
.hero-photo {
    flex-shrink: 0;
}
.hero-photo img {
    width: 140px;
    height: 180px;
    border-radius: var(--radius);
    object-fit: cover;
    object-position: center top;
    border: 1px solid var(--border);
    display: block;
}

.hero-text h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 6px;
}
.hero-title {
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 16px;
}
.hero-bio {
    color: var(--text);
    font-size: 0.97rem;
    max-width: 580px;
    margin-bottom: 24px;
}
.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.btn-link {
    display: inline-block;
    padding: 6px 16px;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.btn-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
    text-decoration: none;
}

/* ---- Sections ---- */
.section {
    padding: 64px 24px;
}
.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}
.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 36px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    color: var(--text);
}

/* ---- Timeline (Education) ---- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.timeline-item {
    display: flex;
    gap: 20px;
    padding-bottom: 32px;
    position: relative;
}
.timeline-item:last-child {
    padding-bottom: 0;
}
.timeline-dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    position: relative;
    z-index: 1;
}
.timeline-item:not(:last-child) .timeline-dot::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 5px;
    width: 2px;
    height: calc(100% + 20px);
    background: var(--border);
}
.timeline-content {
    flex: 1;
    padding-bottom: 4px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.edu-thumb {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
}
.edu-thumb img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    display: block;
    padding: 6px;
}
.edu-text { flex: 1; }
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}
.timeline-degree {
    font-weight: 600;
    font-size: 0.97rem;
    color: var(--text);
}
.timeline-date {
    font-size: 0.84rem;
    color: var(--muted);
    white-space: nowrap;
}
.timeline-institution {
    font-size: 0.92rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 4px;
}
.timeline-detail {
    font-size: 0.87rem;
    color: var(--muted);
}

/* ---- Publications ---- */
.pub-item {
    display: flex;
    gap: 20px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    align-items: stretch;
}
.pub-item:first-of-type { padding-top: 0; }
.pub-item:last-of-type  { border-bottom: none; }
.pub-thumb {
    flex-shrink: 0;
    width: 140px;
}
.pub-thumb img {
    width: 140px;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: block;
    background: var(--bg-alt);
}
.pub-thumb-placeholder {
    width: 140px;
    height: 100%;
    min-height: 90px;
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.03em;
}
.pub-body { flex: 1; }
.pub-year-inline {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pub-title {
    font-weight: 600;
    font-size: 0.97rem;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.5;
}
.pub-authors {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 4px;
}
.pub-authors strong {
    color: var(--text);
}
.pub-venue {
    font-size: 0.88rem;
    color: var(--muted);
    font-style: italic;
    margin-bottom: 10px;
}
.pub-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-link {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-light);
    transition: background 0.2s, color 0.2s;
}
.tag-link:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    text-decoration: none;
}

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

/* ---- Dark mode toggle ---- */
.theme-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.theme-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .hero-inner { flex-direction: column; gap: 24px; }
    .hero-text h1 { font-size: 1.6rem; }
    .pub-item { flex-direction: column; gap: 12px; }
    .pub-thumb, .pub-thumb img { width: 100%; height: 160px; }
    .timeline-header { flex-direction: column; gap: 2px; }
}
