/* ATS-friendly one-page resume — screen + A4 print */

:root {
    --ink: #111827;
    --muted: #4b5563;
    --rule: #d1d5db;
    --accent: #1A3263;
    --bg: #f3f4f6;
}

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

body {
    font-family: "Noto Sans TC", "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.4;
    font-size: 10pt;
}

/* Bilingual: zh default (html lang zh-*), en when html[lang=en] */
.i18n[data-lang="en"] {
    display: none;
}

html[lang="en"] .i18n[data-lang="zh"] {
    display: none;
}

html[lang="en"] .i18n[data-lang="en"] {
    display: inline;
}

.resume-links > .i18n[data-lang="zh"] {
    display: block;
}

html[lang="en"] .resume-links > .i18n[data-lang="en"] {
    display: block;
}

.toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--rule);
    backdrop-filter: blur(6px);
}

.toolbar-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.toolbar-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    border: 1px solid var(--rule);
    background: #fff;
    color: var(--ink);
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

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

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.08);
    color: #fff;
}

.btn.active {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.resume {
    width: min(210mm, 100% - 2rem);
    margin: 1.25rem auto 2rem;
    background: #fff;
    padding: 12mm 13mm;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.resume-header {
    text-align: left;
    margin-bottom: 0.55rem;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid var(--accent);
}

.resume-header h1 {
    font-size: 16pt;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.15;
}

.resume-title {
    font-size: 9.5pt;
    font-weight: 600;
    margin-top: 0.15rem;
}

.resume-links {
    margin-top: 0.25rem;
    font-size: 8pt;
    color: var(--muted);
    word-break: break-word;
}

.resume-links a {
    color: var(--accent);
    text-decoration: none;
}

.resume section {
    margin-top: 0.5rem;
}

.resume h2 {
    font-size: 9pt;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.1rem;
    margin-bottom: 0.28rem;
}

.summary {
    font-size: 8.75pt;
}

.skills-grid {
    display: grid;
    gap: 0.12rem 0.6rem;
}

.skill-row {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 0.4rem;
    font-size: 8.5pt;
}

.skill-row strong {
    color: var(--accent);
    font-weight: 700;
}

.item {
    margin-bottom: 0.38rem;
    break-inside: avoid;
}

.item-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.item-head h3 {
    font-size: 9.25pt;
    font-weight: 700;
}

.item-meta {
    font-size: 8pt;
    color: var(--muted);
    white-space: nowrap;
}

.item-sub {
    font-size: 8.25pt;
    color: var(--muted);
}

.item-sub a,
.stack a {
    color: var(--accent);
    text-decoration: none;
}

.stack {
    font-size: 7.75pt;
    color: var(--muted);
}

.item ul {
    margin: 0.15rem 0 0 1rem;
}

.item li {
    font-size: 8.4pt;
    margin-bottom: 0.05rem;
}

.highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.7rem;
    font-size: 8pt;
    color: var(--muted);
}

.highlights strong {
    color: var(--accent);
    font-weight: 700;
}

@media screen and (max-width: 700px) {
    .resume {
        width: auto;
        margin: 0.75rem;
        padding: 1rem;
    }

    .skill-row {
        grid-template-columns: 1fr;
    }

    .item-meta {
        white-space: normal;
    }

    .toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@page {
    size: A4;
    margin: 10mm 12mm;
}

@media print {
    body {
        background: #fff;
        font-size: 9pt;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .no-print,
    .toolbar {
        display: none !important;
    }

    .resume {
        width: auto;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    a {
        color: inherit !important;
        text-decoration: none !important;
    }

    .item,
    section {
        break-inside: avoid;
    }
}

/* PDF export body (Playwright) */
body.pdf-export {
    background: #fff;
}
