/* 深色側欄履歷版：左欄深色（個人資訊與技術棧）、右欄白底內容。
   配色集中在 :root，換強調色只需改 --accent 與 --accent-ink。
   --accent-ink 是強調色的深色版，用於白底上的小標籤，對比需 ≥ 4.5:1。 */
:root {
    --page-bg: #e9ebee;
    --side-bg: #0d1117;
    --side-text: #e6edf3;
    --side-muted: #8b949e;
    --side-dashed: #57606a;
    --accent: #9ec5df;
    --accent-ink: #2f6f8f;
    --panel-bg: #ffffff;
    --panel-border: #d5d9df;
    --text: #2b2c35;
    --muted: #4a4b57;
    --rule: #c9cad2;
    --soft: #f1f1f4;
    --sans: 'Noto Sans TC', 'Microsoft JhengHei', system-ui, sans-serif;
    --head: 'Montserrat', 'Noto Sans TC', sans-serif;
    --mono: 'IBM Plex Mono', 'Cascadia Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--text);
    font: 13px/20px var(--sans);
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
ul { margin: 0; }
h1, h2, h3, p { margin: 0; }

.skip-link {
    position: absolute;
    left: 8px;
    top: -48px;
    z-index: 10;
    padding: 8px 12px;
    background: var(--side-bg);
    color: var(--side-text);
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.side :focus-visible { outline-color: var(--accent); }

.page {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    min-height: 100vh;
    max-width: 1180px;
    margin: 0 auto;
}

/* ───── 左欄 ───── */
.side {
    flex: 0 0 320px;
    max-width: 320px;
    align-self: stretch;
    padding: 48px 28px 48px 40px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    background: var(--side-bg);
    color: var(--side-text);
}

/* 個人照片：正方形裁切，臉部靠上，不變形 */
.monogram {
    display: block;
    width: 160px;
    height: 160px;
    margin-bottom: 18px;
    object-fit: cover;
    object-position: center;
    background: var(--accent);
}

.side h1 {
    font: 800 64px/64px var(--head);
    letter-spacing: -0.02em;
    color: var(--accent);
}

.role {
    margin-top: 6px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.side h2 {
    margin-bottom: 10px;
    font: 800 19px/24px var(--head);
    letter-spacing: 0.06em;
    color: var(--accent);
}

.stack {
    display: grid;
    gap: 8px;
    margin: 0;
    font: 14px/22px var(--mono);
    color: #c9d1d9;
}
.stack dt { color: var(--accent); font-weight: 600; }
.stack dd {
    display: flex;
    gap: 6px;
    margin: 0;
}
.stack dd::before { content: '├─'; flex: none; color: var(--side-muted); }
.stack dd:last-of-type::before { content: '└─'; }
/* 放在右欄（淺底）時的 TECH STACK：改用深色文字並依寬度自動分欄 */
.stack-wide {
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
    gap: 14px 24px;
    color: var(--text);
}
.stack-wide dt { color: var(--accent-ink); }
.stack-wide dd::before { color: var(--muted); }

.note-side {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 22px;
}
.note-side a { color: var(--side-text); }
.note-side a:hover { color: var(--accent); }

.activity { display: grid; gap: 8px; }
.activity a {
    display: block;
    border: 1px dashed var(--side-dashed);
    background: #0d1117;
}
.activity img {
    display: block;
    width: 100%;
    height: auto;
}
/* 貢獻圖：放在白底卡片上（圖內的空格是淺灰，直接放深色底會很刺眼），
   並以較大的比例只顯示最近的部分，方格才看得清楚 */
.activity .chart { padding: 8px; border: 0; background: #fff; }
.activity .chart img { height: 124px; object-fit: cover; object-position: right center; }

.contact {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.contact li { display: flex; align-items: center; gap: 12px; }
.contact svg { flex: none; width: 20px; height: 20px; }
.contact .stroke { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.contact .fill { fill: var(--accent); }

/* 下載 PDF 與中英文切換：合成一個膠囊，固定在右欄內容區的右下角。
   100% 是不含捲軸的視窗寬；1180px 是 .page 的最大寬度。 */
.float-actions {
    position: fixed;
    right: calc(max(0px, (100% - 1180px) / 2) + 16px);
    bottom: 16px;
    z-index: 20;
    display: flex;
    border: 1px solid var(--side-dashed);
    border-radius: 999px;
    background: var(--side-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.float-actions button {
    min-width: 48px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 999px 0 0 999px;
    background: transparent;
    color: var(--accent);
    font: 700 11px/1 var(--mono);
    letter-spacing: 0.02em;
    cursor: pointer;
}
.float-actions button + button {
    border-radius: 0 999px 999px 0;
    background: linear-gradient(var(--side-dashed), var(--side-dashed)) left center / 1px 20px no-repeat;
}
.float-actions button:hover { background-color: #161b22; }
.float-actions :focus-visible { outline-color: var(--accent); outline-offset: -4px; }
.print-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* 姓名列上的圖示連結：只在手機版顯示，取代最下方的 CONTACT 區塊 */
.top-links { display: none; }
.top-links .stroke { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.top-links .fill { fill: var(--accent); }

/* ───── 右欄 ───── */
.panel {
    flex: 999 1 560px;
    min-width: 0;
    max-width: 860px;
    align-self: stretch;
    margin: 0;
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
    /* 頁尾留白，讓固定在右下角的按鈕不蓋住最後的內容 */
    padding-bottom: 48px;
}

.panel h2.bar {
    padding: 12px 28px;
    background: var(--accent);
    font: 800 19px/28px var(--head);
    letter-spacing: 0.06em;
    color: var(--text);
}

.block { padding: 22px 28px 26px; display: flex; flex-direction: column; gap: 22px; }

.idx { font: 800 15px/24px var(--head); color: var(--accent-ink); }

.exp {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 10px;
}
.exp-body { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }

/* 經驗項目可收合：summary 固定顯示標題、標籤與一句成果，展開後才出現條列與架構圖。 */
.fold { min-width: 0; }
.fold > summary {
    position: relative;
    padding-right: 28px;
    list-style: none;
    cursor: pointer;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--accent-ink);
    border-bottom: 2px solid var(--accent-ink);
    transform: rotate(45deg);
}
.fold[open] > summary::after { top: 12px; transform: rotate(-135deg); }
.fold > summary:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 4px; }
.fold .tags, .fold .gist { display: block; }
.fold .gist { margin-top: 2px; font-size: 13px; line-height: 20px; }
.fold > .exp-body, .fold > .proj-body { margin-top: 10px; }
.exp-text { flex: 1 1 280px; min-width: 0; }

.title { font: 900 15px/24px var(--sans); }
.tags { font-size: 12px; line-height: 18px; font-weight: 700; color: var(--accent-ink); }
.exp ul, .proj ul { margin-top: 4px; padding-left: 18px; }
.lead { margin-top: 4px; }

/* 架構流程圖：由上往下的方塊流程 */
.flow {
    flex: 0 0 180px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    padding: 8px 10px;
    list-style: none;
    background: var(--soft);
    font-size: 12px;
    line-height: 16px;
    text-align: center;
}
.flow li {
    padding: 2px 6px;
    border: 1px solid var(--text);
    background: #fff;
    color: var(--text);
    font: inherit;
}
.flow li.end { background: var(--text); color: #fff; font-weight: 700; }
.flow > li:not(:last-child) { margin-bottom: 16px; position: relative; }
.flow > li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 100%;
    width: 7px;
    height: 7px;
    margin: 1px 0 0 -4px;
    border-right: 1.5px solid #4a4b57;
    border-bottom: 1.5px solid #4a4b57;
    transform: rotate(45deg);
}

/* 橫向管線圖：經驗區塊用，跨滿內容寬度，放在文字下方。
   .next 表示「這個節點右側接箭頭」；.aux 是掛在主線下方的輔助元件（虛線框）。
   窄螢幕改為由上往下的單欄，箭頭改指向下。 */
.pipe {
    flex: 0 0 100%;
    display: grid;
    gap: 14px 24px;
    align-items: center;
    margin: 0;
    padding: 14px 16px;
    list-style: none;
    background: var(--soft);
    font-size: 12px;
    line-height: 16px;
    text-align: center;
}
.pipe-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pipe-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pipe-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pipe-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pipe > li {
    position: relative;
    padding: 7px 4px;
    border: 1px solid var(--text);
    background: #fff;
    color: var(--text);
}
.pipe > li.end { background: var(--text); color: #fff; font-weight: 700; }
.pipe small { display: block; font-size: 12px; font-weight: 400; }
.pipe > li.next::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -17px;
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-top: 1.5px solid #4a4b57;
    border-right: 1.5px solid #4a4b57;
    transform: rotate(45deg);
}
.pipe > li.aux {
    grid-column: 4;
    grid-row: 2;
    border-style: dashed;
    background: transparent;
}
.pipe > li.aux.under-1 { grid-column: 1; }
.pipe > li.aux::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    height: 14px;
    border-left: 1.5px dashed #4a4b57;
}
.pipe > li.group { display: grid; gap: 4px; padding: 0; border: 0; background: transparent; }
.pipe > li.group > span { padding: 5px 2px; border: 1px solid var(--text); background: #fff; }
/* .duo：掛在某節點下方的兩個輔助元件（虛線框）；.under-2 表示掛在第 2 欄。 */
.pipe > li.duo { display: grid; gap: 4px; padding: 0; border: 0; background: transparent; }
.pipe > li.duo > span { padding: 5px 2px; border: 1px dashed var(--text); background: transparent; }
.pipe > li.duo.under-2 { grid-column: 2; grid-row: 2; }
.pipe > li.duo::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    height: 14px;
    border-left: 1.5px dashed #4a4b57;
}

/* 改寫前後對照：兩欄程式碼示意，中間以箭頭表示由左改為右；窄螢幕改上下排列。 */
.diff {
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 24px;
    padding: 14px 16px;
    background: var(--soft);
}
.diff-col { position: relative; min-width: 0; }
.diff-col:not(.after)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -17px;
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-top: 1.5px solid #4a4b57;
    border-right: 1.5px solid #4a4b57;
    transform: rotate(45deg);
}
.diff-h { display: block; margin-bottom: 4px; font-size: 12px; line-height: 16px; font-weight: 700; }
.diff pre {
    margin: 0;
    padding: 8px 10px;
    overflow-x: auto;
    border: 1px solid var(--text);
    background: #fff;
    font: 12px/18px var(--mono, ui-monospace, Consolas, monospace);
    white-space: pre;
}
.diff-col.after pre { background: var(--text); color: #fff; }
.diff-note { grid-column: 1 / -1; margin: 0; font-size: 12px; line-height: 16px; color: #4a4b57; }

.proj {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 10px;
}
.proj-body { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.proj-text { flex: 1 1 280px; min-width: 0; }
.proj h3 { font: 900 16px/24px var(--sans); }

/* 專案連結：強調色加底線與外開箭頭，一眼看得出可以點擊。 */
.proj h3 a, .others a {
    color: var(--accent-ink);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}
.proj h3 a::after, .others a::after {
    content: '';
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    margin-left: 0.3em;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3H3v10h10v-3M9 3h4v4M13 3L7 9'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3H3v10h10v-3M9 3h4v4M13 3L7 9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.proj h3 a:hover, .others a:hover { background: var(--soft); text-decoration-thickness: 3px; }
.proj-body > figure { margin: 0; flex: 0 0 180px; }
.proj-body > figure img { display: block; width: 180px; height: auto; border: 1px solid var(--rule); }

/* 截圖：預設收起成縮圖，點擊展開成大圖檢視 */
.shots { display: contents; }
.proj-text { order: 2; }
.proj-body > .pipe { order: 3; }
.shots-thumb { order: 1; }
/* 同一個專案有多組縮圖時，垂直堆疊在左欄 */
.proj-media { order: 1; flex: 0 0 180px; display: grid; gap: 12px; }
.proj-media .shots-thumb { width: 100%; }
.shots-thumb {
    position: relative;
    flex: 0 0 180px;
    padding: 0;
    border: 1px solid var(--rule);
    background: var(--soft);
    cursor: pointer;
    font: inherit;
}
.shots-thumb img { display: block; width: 100%; height: 96px; object-fit: cover; }
/* 架構圖縮圖：圖的比例接近正方形，完整顯示不裁切 */
.shots-thumb.fit img { height: 140px; object-fit: contain; background: #fff; }
.shots-thumb > span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 2px 6px;
    background: rgba(13, 17, 23, 0.82);
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    text-align: left;
}
/* 截圖大圖：用 <dialog> 的 showModal() 顯示在視窗正中央，背後蓋暗幕；Esc 可關閉 */
.shots-dialog {
    padding: 0;
    border: 0;
    background: transparent;
    max-width: none;
    max-height: none;
    overflow: visible;
}
.shots-dialog::backdrop { background: rgba(13, 17, 23, 0.82); }
/* 大圖以原始尺寸顯示；超過視窗時才等比縮小，不會有多餘的白框 */
.shots-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: fit-content;
    max-width: calc(100vw - 24px);
}
.shots-box figure { margin: 0; order: 2; }
.shots-box img {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 150px);
    max-height: calc(100vh - 150px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.shots-box img[src$='.gif'] {
    width: min(880px, calc(100vw - 150px));
    object-fit: contain;
    background: #fff;
}
.shots-box figcaption { padding-top: 8px; font-size: 13px; line-height: 20px; color: #fff; text-align: center; }
.shots-box [hidden] { display: none; }
.shots-box .prev { order: 1; }
.shots-box .next { order: 3; }
.shots-bar { order: 4; flex: 0 0 100%; display: flex; align-items: center; justify-content: space-between; color: #fff; }
.shots-count { font: 600 12px/18px var(--mono); }
.btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--text);
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
}
.btn:hover { background: #e4e5ea; }
.btn.icon { padding: 0; display: flex; align-items: center; justify-content: center; }
.btn.icon svg { width: 14px; height: 14px; fill: none; stroke: var(--text); stroke-width: 2; }

.others {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 14px 20px;
    padding-top: 16px;
    border-top: 1px solid var(--rule);
    font-size: 12px;
    line-height: 18px;
}
.others a { font-size: 14px; line-height: 22px; font-weight: 700; }

.note-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 4px 20px;
    margin: 0;
    padding-left: 18px;
}
.note-list a:hover { color: var(--accent-ink); }

.legacy-link { padding: 0 28px 28px; font-size: 12px; color: var(--muted); }

/* 視窗比內容（320 + 860）還窄時，右欄與視窗邊緣之間留一點空隙 */
@media screen and (max-width: 1240px) {
    .panel { margin-right: 24px; }
    .float-actions { right: calc(max(0px, (100% - 1180px) / 2) + 40px); }
}

/* ───── 窄螢幕：左欄疊到上方 ───── */
/* 限定 screen：A4 的可列印寬度小於 720px，列印不可套用手機版面 */
@media screen and (max-width: 720px) {
    /* 手機版順序：姓名與圖示連結 → TECH STACK／經驗／專案 → NOTE → ACTIVITY。
       左欄改為 display: contents，讓它的區塊可以和右欄一起用 order 重新排序。 */
    .side { display: contents; }
    .brand {
        order: 1;
        flex: 0 0 100%;
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 24px 20px;
        background: var(--side-bg);
        color: var(--side-text);
    }
    .monogram { flex: none; width: 56px; height: 56px; margin: 0; }
    .side h1 { font-size: 36px; line-height: 38px; }
    .role { margin-top: 2px; font-size: 12px; line-height: 18px; }
    .top-links { margin-left: auto; flex: none; display: flex; gap: 8px; }
    .top-links a {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--side-dashed);
    }
    .top-links a:hover { text-decoration: none; background: #161b22; }
    /* 手機版：落在內容卡片（左右 12px 外距）內側，按鈕加高到 44px 方便點擊 */
    .float-actions { right: 24px; bottom: 12px; }
    .float-actions button { min-width: 52px; height: 44px; }
    /* ACTIVITY 是手機版最後一區，底部留白給浮動按鈕 */
    .side > section[aria-labelledby="activity-title"] { padding-bottom: 72px; }
    .top-links svg { width: 20px; height: 20px; }
    .panel { order: 2; margin: 12px; flex-basis: 100%; padding-bottom: 0; }
    .side > section { flex: 0 0 100%; padding: 24px 20px; background: var(--side-bg); color: var(--side-text); }
    .side > section[aria-labelledby="note-title"] { order: 3; padding-bottom: 8px; }
    .side > section[aria-labelledby="activity-title"] { order: 4; }
    .side > section[aria-labelledby="contact-title"] { display: none; }
    .note-side { grid-template-columns: 1fr 1fr; gap: 4px 16px; font-size: 13px; }
    .panel h2.bar { padding: 10px 16px; font-size: 17px; line-height: 26px; }
    .block { padding: 16px; gap: 18px; }
    .stack-wide { grid-template-columns: 1fr 1fr; gap: 14px 12px; font-size: 12px; }
    .fold > summary { min-height: 44px; }
    /* 專案的縮圖與流程圖：電腦版一直顯示，手機版和經驗一樣收在折疊裡，展開後才出現 */
    .proj-body:not(:has(details[open])) > :not(.proj-text) { display: none; }
    .proj-text { order: 0; flex-basis: 100%; }
    .fold .tags { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    /* 放大視窗：圖滿版，上一張／下一張／關閉放在圖下方並加大到 48px */
    .shots-box {
        width: calc(100vw - 32px);
        max-width: none;
        display: grid;
        grid-template-columns: 48px 1fr 48px;
        gap: 12px;
        align-items: center;
    }
    .shots-box figure { grid-column: 1 / -1; grid-row: 1; order: 0; }
    .shots-box img, .shots-box img[src$='.gif'] { width: 100%; max-width: none; max-height: calc(100vh - 220px); }
    .shots-box .prev { grid-column: 1; grid-row: 2; order: 0; }
    .shots-box .next { grid-column: 3; grid-row: 2; order: 0; }
    .shots-bar { display: contents; }
    .shots-count { grid-column: 2; grid-row: 2; text-align: center; }
    .shots-bar .close { grid-column: 1 / -1; grid-row: 3; min-height: 48px; }
    .shots-box .btn.icon { min-width: 48px; min-height: 48px; }
    .legacy-link { padding-left: 16px; padding-right: 16px; }
    .flow, .shots-thumb, .proj-media, .proj-body > figure { flex-basis: 100%; }
    .pipe-7, .pipe-5, .pipe-4, .pipe-3 { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .pipe > li.duo.under-2 { grid-column: auto; grid-row: auto; }
    .pipe > li.duo::before { content: none; }
    .pipe > li.next::after {
        top: 100%;
        right: auto;
        left: 50%;
        margin: 5px 0 0 -4px;
        transform: rotate(135deg);
    }
    .pipe > li.aux, .pipe > li.aux.under-1 { grid-column: auto; grid-row: auto; }
    .pipe > li.aux::before { content: none; }
    .pipe > li.group { gap: 6px; }
    .diff { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .diff-col:not(.after)::after {
        top: 100%;
        right: auto;
        left: 50%;
        margin: 5px 0 0 -4px;
        transform: rotate(135deg);
    }
    .proj-body > figure img { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* ───── 列印／另存 PDF：A4 單欄，個人資訊在頁首，NOTE 在最後 ───── */
@page { size: A4; margin: 10mm; }

@media print {
    /* 沒勾「背景圖形」時仍保留標題色帶與流程圖底色 */
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body { background: #fff; font-size: 12px; line-height: 18px; }
    .skip-link, .float-actions, .top-links, .shots, .proj-media,
    .side > section[aria-labelledby="activity-title"], .fold > summary::after { display: none; }

    .page { display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; min-height: 0; max-width: none; }
    .side { display: contents; }
    .brand { order: 1; display: flex; align-items: center; gap: 16px; color: var(--text); }
    .monogram { width: 72px; height: 72px; margin: 0; }
    .side h1 { font-size: 34px; line-height: 38px; color: var(--accent-ink); }
    .role { margin-top: 0; }
    .side > section { color: var(--text); }
    .side h2 { margin-bottom: 4px; font-size: 14px; color: var(--accent-ink); }
    .side > section[aria-labelledby="contact-title"] { order: 2; margin: 8px 0 10px; }
    .side > section[aria-labelledby="contact-title"] h2 { display: none; }
    .contact { display: flex; flex-wrap: wrap; gap: 4px 24px; }
    .contact .stroke { stroke: var(--accent-ink); }
    .contact .fill { fill: var(--accent-ink); }
    .panel { order: 3; flex: none; max-width: none; margin: 0; padding: 0; border: 0; }
    .side > section[aria-labelledby="note-title"] { order: 4; margin-top: 8px; break-inside: avoid; }
    .note-side { grid-template-columns: repeat(3, 1fr); font-size: 12px; line-height: 18px; }
    .note-side a { color: var(--text); }

    .panel h2.bar { padding: 4px 10px; font-size: 14px; line-height: 22px; break-after: avoid; }
    .block { display: block; padding: 10px 0 4px; }
    .block > * { margin-bottom: 10px; }
    .others { padding-top: 10px; }
    .stack-wide { grid-template-columns: repeat(4, 1fr); gap: 8px 10px; font-size: 10px; line-height: 15px; }
    .stack > div, .exp, .proj, .others > div, .pipe, .diff { break-inside: avoid; }

    /* 七節點流程圖要塞進紙寬：縮小間距與字級，長單字允許換行 */
    .pipe { gap: 12px 12px; padding: 10px 6px; font-size: 9.5px; line-height: 13px; overflow-wrap: anywhere; }
    .pipe small { font-size: 9px; }
    .pipe > li.next::after { right: -9px; width: 5px; height: 5px; margin-top: -3px; }
    .pipe > li.aux::before, .pipe > li.duo::before { height: 12px; }
    .diff { gap: 10px 24px; padding: 10px; }
    .diff pre { font-size: 10px; line-height: 14px; white-space: pre-wrap; }
}
