/* ============================================
   CSS Variables & Reset
   ============================================ */
:root {
    --navy: #14253a;
    --navy-light: #2c4a6e;
    --accent: #0f8a7e;
    --accent-light: #14b8a6;
    --gold: #b8893f;
    --text: #2b3440;
    --text-muted: #6b7785;
    --bg: #ffffff;
    --bg-alt: #f6f8f9;
    --border: #e6eaed;
    --header-bg: rgba(255,255,255,0.92);
    --solid-bg: #14253a;          /* 撖血?????蝐?*/
    --solid-bg-hover: #2c4a6e;
    --solid-fg: #ffffff;
    --footer-bg: #14253a;
    color-scheme: light;
    --shadow-sm: 0 1px 2px rgba(20,37,58,0.06);
    --shadow-md: 0 6px 24px rgba(20,37,58,0.08);
    --radius: 8px;
    --radius-lg: 14px;
    --max-width: 1080px;
    --content-width: 760px;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Noto Sans TC", sans-serif;
    --font-serif: 'Lora', Georgia, serif;
}

/* 瘛梯銝駁?嚗???豢????函頂蝯梯身摰?????敺誑 data-theme ?箸? */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --navy: #e6edf5;
        --navy-light: #b9c6d4;
        --accent: #2dd4bf;
        --accent-light: #5eead4;
        --gold: #d6aa5e;
        --text: #c9d3de;
        --text-muted: #8b98a8;
        --bg: #111a24;
        --bg-alt: #0c131b;
        --border: #243242;
        --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
        --shadow-md: 0 6px 24px rgba(0,0,0,0.45);
        --header-bg: rgba(12,19,27,0.88);
        --solid-bg: #1f3a52;
        --solid-bg-hover: #2a4c6a;
        --solid-fg: #e6edf5;
        --footer-bg: #080d13;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --navy: #e6edf5;
    --navy-light: #b9c6d4;
    --accent: #2dd4bf;
    --accent-light: #5eead4;
    --gold: #d6aa5e;
    --text: #c9d3de;
    --text-muted: #8b98a8;
    --bg: #111a24;
    --bg-alt: #0c131b;
    --border: #243242;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 6px 24px rgba(0,0,0,0.45);
    --header-bg: rgba(12,19,27,0.88);
    --solid-bg: #1f3a52;
    --solid-bg-hover: #2a4c6a;
    --solid-fg: #e6edf5;
    --footer-bg: #080d13;
    color-scheme: dark;
}

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

html { scroll-behavior: smooth; }

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

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4 { color: var(--navy); line-height: 1.3; font-weight: 600; }

h1 { font-family: var(--font-serif); font-size: 2.2rem; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }

p { margin-bottom: 1rem; }

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-light); }

/* ============================================
   Layout
   ============================================ */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 32px; }

main { min-height: 60vh; }

/* ============================================
   Header & Navigation
   ============================================ */
.site-header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.site-title {
    color: var(--navy);
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    white-space: nowrap;
}

.site-title:hover { color: var(--accent); }

.site-nav ul { list-style: none; display: flex; gap: 2px; }

.site-nav a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    position: relative;
    white-space: nowrap;
}

.site-nav a:hover { color: var(--navy); }

.site-nav a.active { color: var(--navy); }

.site-nav a.active::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.header-right { display: flex; align-items: center; gap: 10px; }

.lang-switch {
    flex: none;
    min-width: 44px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--navy);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    transition: all 0.2s;
}

.lang-switch:hover { border-color: var(--accent); color: var(--accent); }

.header-tools { display: flex; align-items: center; gap: 6px; flex: none; }

.theme-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px 0 10px;
    border: 1.5px solid var(--accent);
    border-radius: 999px;
    background: transparent;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-switch:hover { background: var(--accent); color: var(--bg); }
.theme-switch svg { width: 17px; height: 17px; flex: none; }
/* ??憿舐內???????璅∪?嚗滓?脫?憿舐內?漁嚗楛?莎?瘛梯?＊蝷箏云?踝?瘛箄 */
.theme-switch .icon-sun, .theme-switch .label-light { display: none; }
:root[data-theme="dark"] .theme-switch .icon-sun,
:root[data-theme="dark"] .theme-switch .label-light { display: inline; }
:root[data-theme="dark"] .theme-switch .icon-moon,
:root[data-theme="dark"] .theme-switch .label-dark { display: none; }

/* ============================================
   Profile Hero (Homepage ??academic layout)
   ============================================ */
.profile {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 72px 32px 56px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 56px;
    align-items: start;
}

.profile-photo-wrap { position: relative; }

.profile-photo {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: block;
}

.profile-photo-wrap::before {
    content: '';
    position: absolute;
    inset: -10px -10px 14px 14px;
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    z-index: -1;
    opacity: 0.5;
}

.profile-info { padding-top: 6px; }

.profile-name {
    font-family: var(--font-serif);
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
    line-height: 1.15;
}

.profile-title {
    font-size: 1.1rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px;
}

.profile-affiliation {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 22px;
}

.profile-bio {
    font-size: 1.02rem;
    color: var(--text);
    margin-bottom: 24px;
}

.profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--navy);
    background: var(--bg);
    transition: all 0.2s;
}

.profile-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.profile-link.primary {
    background: var(--solid-bg);
    color: var(--solid-fg);
    border-color: var(--solid-bg);
}

.profile-link.primary:hover { background: var(--solid-bg-hover); color: var(--solid-fg); }

/* ============================================
   Section blocks (homepage)
   ============================================ */
.section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px 32px;
}

.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); max-width: none; }
.section-alt > .section-inner { max-width: var(--max-width); margin: 0 auto; }

.section-title {
    font-size: 1.4rem;
    color: var(--navy);
    margin-bottom: 8px;
    position: relative;
    padding-left: 16px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: var(--accent);
    border-radius: 4px;
}

.section-sub { color: var(--text-muted); margin-bottom: 28px; font-size: 0.98rem; }

/* ============================================
   Education
   ============================================ */
.education-list { list-style: none; }

.education-list li {
    display: flex;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

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

.edu-year { min-width: 56px; color: var(--accent); font-size: 0.9rem; font-weight: 700; padding-top: 2px; }
.edu-degree { font-weight: 600; color: var(--navy); }
.edu-school { color: var(--text-muted); font-size: 0.92rem; margin-top: 2px; }

.exp-list { list-style: none; }
.exp-list > li {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
}
.exp-list > li:last-child { border-bottom: none; }
.exp-period { min-width: 132px; color: var(--accent); font-size: 0.88rem; font-weight: 700; padding-top: 2px; white-space: nowrap; }
.exp-role { font-weight: 600; color: var(--navy); }
.exp-org { color: var(--text-muted); font-size: 0.92rem; margin-top: 2px; }
.exp-list ul { margin: 8px 0 0 18px; font-size: 0.94rem; }
.exp-list ul li { margin-bottom: 4px; }

/* ============================================
   Skills
   ============================================ */
.skills-section { margin-top: 8px; }
.skills-group { margin-bottom: 22px; }

.skills-group h4 {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.tag-list, .method-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }

.tag-list li {
    background: var(--solid-bg);
    color: var(--solid-fg);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.method-list li {
    background: var(--bg);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================
   Page Content Area (interior pages)
   ============================================ */
.page-content { padding: 64px 32px; max-width: var(--max-width); margin: 0 auto; }

.page-header { margin-bottom: 44px; padding-bottom: 22px; position: relative; }

.page-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 3px;
    border-radius: 3px;
    background: var(--accent);
}

.page-header h1 { font-size: 2rem; margin-bottom: 8px; color: var(--navy); }
.page-header .lead { color: var(--text-muted); font-size: 1.05rem; }

/* ============================================
   Research Page
   ============================================ */
.research-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 26px 28px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.research-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.research-item h3 { color: var(--navy); font-size: 1.1rem; margin-bottom: 12px; }
.research-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

.research-badge {
    background: var(--bg-alt);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
}

.research-item ul { margin-left: 20px; }
.research-item li { margin-bottom: 5px; }

.research-transfer {
    margin-top: 14px;
    padding: 12px 16px;
    background: var(--bg-alt);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.92rem;
    color: var(--text);
}

.research-transfer strong { color: var(--accent); }

/* ============================================
   Publications Page
   ============================================ */
.pub-section { margin-bottom: 48px; }

.pub-section h2 {
    font-size: 1.3rem;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.pub-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 14px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.pub-item:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }
.pub-title { font-weight: 600; color: var(--navy); font-size: 0.97rem; margin-bottom: 6px; line-height: 1.45; }
.pub-authors { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 4px; }
.pub-journal { font-style: italic; color: var(--text); font-size: 0.88rem; margin-bottom: 10px; }

.pub-doi a {
    display: inline-block;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 3px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.pub-doi a:hover { background: var(--accent); color: var(--bg); }

/* ============================================
   Awards Page
   ============================================ */
.award-item { display: flex; gap: 22px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.award-item:last-child { border-bottom: none; }
.award-year { min-width: 56px; font-weight: 700; color: var(--gold); font-size: 0.95rem; padding-top: 2px; }
.award-title { font-weight: 600; color: var(--navy); margin-bottom: 3px; }
.award-org { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 3px; }
.award-desc { font-size: 0.88rem; color: var(--text-muted); }

.leadership-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s;
}

.leadership-item:hover { box-shadow: var(--shadow-md); }

.leadership-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.leadership-role { font-weight: 600; color: var(--navy); font-size: 0.98rem; }
.leadership-org { font-weight: 600; color: var(--accent); font-size: 0.95rem; margin-bottom: 4px; }

.leadership-period {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.leadership-item ul { margin-left: 20px; margin-top: 8px; }
.leadership-item li { margin-bottom: 4px; font-size: 0.9rem; }

/* ============================================
   Contact Page
   ============================================ */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 24px; }

.contact-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    transition: box-shadow 0.2s, transform 0.2s;
    text-align: center;
}

.contact-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.contact-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 16px;
}

.contact-label { font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.contact-value { font-weight: 600; color: var(--navy); font-size: 0.95rem; }

/* ============================================
   Footer
   ============================================ */
.site-footer { background: var(--footer-bg); color: rgba(255,255,255,0.7); padding: 40px 32px; margin-top: 80px; text-align: center; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-links { display: flex; justify-content: center; gap: 24px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.8); font-size: 0.9rem; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 0.82rem; color: rgba(255,255,255,0.45); }

/* ============================================
   Utility
   ============================================ */
.divider { border: none; border-top: 1px solid var(--border); margin: 0; }
.text-muted { color: var(--text-muted); }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 820px) {
    .profile {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 48px 24px 40px;
        text-align: center;
    }
    .profile-photo-wrap { max-width: 240px; margin: 0 auto; }
    .profile-photo-wrap::before { inset: -8px -8px 10px 10px; }
    .profile-links { justify-content: center; }
    .profile-name { font-size: 2rem; }
}

@media (max-width: 768px) {
    .header-inner { padding: 0 18px; height: 60px; }
    .site-title { font-size: 1rem; }
    .site-nav a { padding: 7px 9px; font-size: 0.82rem; }
    .section, .page-content { padding: 36px 20px; }
    .award-item { flex-direction: column; gap: 4px; }
    .award-year { min-width: unset; }
    .exp-list > li { flex-direction: column; gap: 4px; }
    .exp-period { min-width: unset; }
}

/* 撠汗??銝?閮????嚗????900px 隞乩??曆?銝?銵??寧?抵??? */
@media (max-width: 900px) {
    .header-inner {
        position: relative;
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 10px 16px 6px;
        gap: 4px;
    }
    .header-right { width: 100%; }
    .header-tools { position: absolute; top: 7px; right: 16px; }
    .lang-switch { padding: 3px 10px; font-size: 0.78rem; }
    .theme-switch { height: 28px; padding: 0 10px 0 8px; font-size: 0.78rem; }
    .site-nav ul { gap: 0; flex-wrap: wrap; margin-left: -9px; }
}

@media (max-width: 520px) {
    .site-nav ul { margin-left: -7px; }
    .site-nav a { display: inline-block; padding: 6px 7px; font-size: 0.78rem; }
    .site-nav a.active::after { left: 7px; right: 7px; }
}

/* 窄手機上讓網站名稱與右上角的主題／語言按鈕不重疊 */
@media (max-width: 420px) {
    .site-title { font-size: 0.9rem; }
}

/* 極窄螢幕（約 360px 以下）放不下文字，只保留圖示 */
@media (max-width: 360px) {
    .theme-switch .label-dark, .theme-switch .label-light,
    :root[data-theme="dark"] .theme-switch .label-light { display: none; }
    .theme-switch { padding: 0 8px; }
}
