:root {
    --font-en: 'TimesNRWeb', 'Times New Roman', serif;
    --font-zh: 'TimesNRWeb', 'BiauKaiWeb', 'Times New Roman', '標楷體', serif;
    --font-ja: 'Yumin', '游明朝', 'Yu Mincho', serif;
    --font-sans: var(--font-en);
    --font-serif: inherit;
    --color-bg: #0e1116;
    --color-surface: #1a1f27;
    --color-surface-alt: #222a35;
    --color-primary: #4ea1ff;
    --color-primary-accent: #7bbdff;
    --color-secondary: #ffffff;
    --color-text: #e6e9ef;
    --color-text-invert: #0e1116;
    --color-muted: #bfc6cf;
    --color-border: #2c3642;
    --color-soft-bg: #192129;
    --radius-sm: 4px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 18px rgba(0, 0, 0, 0.55);
    --max-width: clamp(980px, 62vw, 1320px);
    --transition: .25s cubic-bezier(.4, 0, .2, 1);
    --space-2xs: .15rem;
    --space-xs: .25rem;
    --space-sm: .4rem;
    --space-md: .6rem;
    --space-lg: 1rem;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Fluid root size: scales all rem-based values with viewport
       14" ≈ 1366px → 16px · 1920px → ~18px · 2560px → ~20px */
    font-size: clamp(16px, calc(12px + 0.3vw), 22px);
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-align: justify;
    text-justify: inter-word;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: #fff;
    text-decoration: none;
}

a:hover,
a:focus {
    color: #fff;
}

/* 可鍵盤操作的可見聚焦樣式（避免完全無邊框） */
a:focus-visible,
button:focus-visible,
.nav-toggle:focus-visible {
    --color-secondary: #ffffff;
    /* secondary (text / neutral) */
    --color-accent: #ff6b91;
    /* accent 強調色 */
    outline-offset: 2px;
}

/* 無障礙隱藏文字工具類 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Utility spacing & text helpers (were incorrectly nested inside .visually-hidden) */
.mt-0 {
    margin-top: 0 !important
}

.mb-0 {
    margin-bottom: 0 !important
}

.mt-sm {
    margin-top: .5rem !important
}

.mb-sm {
    margin-bottom: .5rem !important
}

.mt-md {
    margin-top: 1rem !important
}

.mb-md {
    margin-bottom: 1rem !important
}

.text-small {
    font-size: .8rem !important
}

.text-muted {
    color: var(--color-muted) !important
}

.list-tight {
    margin: .4rem 0 .2rem 1.1rem !important
}

.list-tight li {
    margin-bottom: .25rem
}

h1,
h2,
h3,
h4 {
    font-family: inherit;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 .6em;
}

p {
    margin: 0 0 1.1em;
}

ul,
ol {
    margin: 0 0 1.1em 1.25em;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.2rem;
}

.flex {
    display: flex;
}

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

.grid {
    display: grid;
    gap: 1.5rem;
}

/* Generic compact list card pattern (shared by education & experience) */
.list-cards {
    list-style: none;
    margin: 0 0 var(--space-md);
    padding: 0;
}

.list-cards:last-of-type {
    margin-bottom: 0;
}

.list-card {
    position: relative;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: .75rem .85rem .8rem;
    margin: 0 0 var(--space-sm);
}

.list-card:last-child {
    margin-bottom: 0;
}

.list-card h3 {
    margin: 0 0 var(--space-xs);
    font-size: 1rem;
    font-weight: 600;
}

.list-card .meta-line {
    font-size: .6rem;
    text-transform: uppercase;
    color: var(--color-muted);
    margin: 0 0 var(--space-xs);
    letter-spacing: 0;
}

.list-card .small {
    font-size: .75rem;
}

.tight-points {
    margin: var(--space-xs) 0 0 1rem;
    padding: 0;
    font-size: .82rem;
    line-height: 1.45;
}

.tight-points li {
    margin: 0 0 var(--space-2xs);
}

.tight-points li:last-child {
    margin: 0;
}

.tag {
    display: inline-block;
    background: var(--color-soft-bg);
    border: 1px solid var(--color-border);
    padding: .25rem .6rem;
    margin: .2rem .4rem .2rem 0;
    border-radius: 999px;
    font-size: .75rem;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #fff;
    color: #222;
    padding: .6rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.btn:hover {
    background: #e6e6e6;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
}

.btn-outline:hover {
    background: #fff;
    color: #222;
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.25rem 1.4rem;
    box-shadow: var(--shadow-sm);
    position: relative;
}

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

.badge-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--color-secondary);
    color: #fff;
    padding: .25rem .55rem;
    font-size: .65rem;
    letter-spacing: .75px;
    border-radius: 999px;
    text-transform: uppercase;
}

.section {
    padding: 3.2rem 0 3.6rem;
}

.section-alt {
    background: var(--color-surface);
}

.section-title {
    font-size: 2.1rem;
    margin-bottom: 1.4rem;
    position: relative;
}

.section-title:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 60px;
    height: 3px;
    background: var(--color-secondary);
    border-radius: 2px;
}

footer {
    padding: 2.4rem 0 3rem;
    font-size: .875rem;
    color: var(--color-muted);
}

footer a {
    color: inherit;
}

@media (max-width: 860px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.9rem;
    }

    h2 {
        font-size: 1.55rem;
    }

    .section {
        padding: 2.4rem 0 2.8rem;
    }
}

:lang(zh-Hant) {
    font-family: var(--font-zh);
}

:lang(ja) {
    font-family: var(--font-ja);
}

:lang(en) {
    font-family: var(--font-en);
}

/* ── Large-screen enhancements ─────────────────────────────── */
@media (min-width: 1600px) {
    .section {
        padding: 3.8rem 0 4.2rem;
    }

    .container {
        padding: 0 2rem;
    }
}

@media (min-width: 2000px) {
    .section {
        padding: 4.4rem 0 4.8rem;
    }

    .container {
        padding: 0 2.5rem;
    }
}