/* Victor Chuang 作品集 — 共用樣式 */
:root {
  --ink: #1e293b; --ink-dim: #475569; --muted: #94a3b8;
  --teal: #0f766e; --teal-soft: #ccfbf1; --teal-bg: #f0fdfa;
  --bg: #f8fafc; --card: #ffffff; --line: #e2e8f0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang TC", "Noto Sans TC", "Helvetica Neue", sans-serif; color: var(--ink); background: var(--bg); line-height: 1.75; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 導覽 */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: 1080px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav .brand { font-weight: 800; font-size: 16px; color: var(--ink); }
.nav .brand span { color: var(--teal); }
.nav a.item { font-size: 13.5px; color: var(--ink-dim); }
.nav a.item.active { color: var(--teal); font-weight: 700; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 36px 24px 64px; }

/* 頁首 hero */
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--teal); text-transform: uppercase; }
h1 { font-size: 30px; line-height: 1.35; margin: 6px 0 10px; }
.lead { font-size: 16px; color: var(--ink-dim); max-width: 800px; }
.tags { margin: 14px 0 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 12px; font-weight: 600; color: var(--teal); background: var(--teal-soft); border-radius: 999px; padding: 3px 12px; }
.meta { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* 區段 */
h2 { font-size: 20px; margin: 40px 0 12px; padding-left: 12px; border-left: 4px solid var(--teal); }
h3 { font-size: 16px; margin: 20px 0 8px; }
p { margin-bottom: 10px; }
.section-note { font-size: 13.5px; color: var(--ink-dim); background: var(--teal-bg); border: 1px solid var(--teal-soft); border-radius: 10px; padding: 12px 16px; margin: 12px 0; }

/* 流程步驟 */
.flow { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.flow .step { flex: 1 1 150px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--teal); border-radius: 10px; padding: 12px 14px; }
.flow .step b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.flow .step small { font-size: 12.5px; color: var(--ink-dim); line-height: 1.6; display: block; }
.flow .step .no { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 22px; margin-bottom: 6px; }

/* 圖片 */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin: 16px 0; }
.shots.narrow { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
figure { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
figure img { width: 100%; height: 230px; object-fit: contain; display: block; background: #fff; padding: 6px; cursor: zoom-in; }
figure.wide img { height: auto; max-height: 620px; }
figcaption { font-size: 12.5px; color: var(--ink-dim); padding: 10px 14px; border-top: 1px solid var(--line); line-height: 1.6; }
figure.wide { grid-column: 1 / -1; }
video { width: 100%; border-radius: 12px; border: 1px solid var(--line); background: #000; }

/* 角色與成果 */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.panel h4 { font-size: 14px; color: var(--teal); margin-bottom: 8px; }
.panel ul { padding-left: 18px; }
.panel li { font-size: 13.5px; margin-bottom: 5px; color: var(--ink-dim); }
.result { background: var(--teal-bg); border: 1px solid var(--teal-soft); }
.result li { color: var(--ink); }

/* 首頁卡片 */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(15,118,110,.12); }
.card .thumb { height: 168px; background: #eef2f7; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.card .body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.card .body h3 { margin: 0 0 6px; font-size: 16.5px; }
.card .body p { font-size: 13.5px; color: var(--ink-dim); flex: 1; }
.card .go { font-size: 13px; font-weight: 700; color: var(--teal); margin-top: 10px; }
.card a { color: inherit; text-decoration: none; }

/* 頁尾 */
.footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 18px 24px; font-size: 12.5px; color: var(--muted); text-align: center; }
.pagenav { display: flex; justify-content: space-between; margin-top: 40px; font-size: 14px; }

@media (max-width: 720px) { .duo { grid-template-columns: 1fr; } h1 { font-size: 24px; } }


/* ====== Lightbox ====== */
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(15,23,42,.92); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 40px 70px; }
.lb.open { display: flex; }
.lb img { max-width: 100%; max-height: calc(100% - 70px); object-fit: contain; border-radius: 8px; background: #fff; }
.lb .lb-cap { color: #e2e8f0; font-size: 14px; margin-top: 14px; text-align: center; max-width: 860px; line-height: 1.6; }
.lb .lb-count { color: #94a3b8; font-size: 12px; margin-top: 4px; }
.lb button { position: absolute; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); color: #fff; cursor: pointer; border-radius: 50%; width: 46px; height: 46px; font-size: 20px; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.lb button:hover { background: rgba(255,255,255,.28); }
.lb .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb .lb-close { right: 16px; top: 16px; font-size: 24px; }

/* ====== UML 流程圖(mermaid) ====== */
.uml { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 12px 8px; margin: 14px 0; overflow-x: auto; }
.uml .uml-title { font-size: 13px; font-weight: 700; color: var(--teal); padding: 0 8px 8px; }
pre.mermaid { display: flex; justify-content: center; background: transparent; }

/* 摺疊的技術時序圖 */
details.seq { margin: 14px 0; }
details.seq summary { cursor: pointer; font-size: 13.5px; color: var(--ink-dim); padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; user-select: none; }
details.seq summary:hover { color: var(--teal); }
details.seq[open] summary { border-radius: 10px 10px 0 0; color: var(--teal); font-weight: 600; }
details.seq .uml { margin-top: 0; border-radius: 0 0 12px 12px; border-top: none; }
