/* 小黃老師 3D 自學館 */
@property --p { syntax: "<number>"; inherits: true; initial-value: 0; }
:root {
  --bg: #080c1a; --bg2: #10172b; --card: #11192f; --card2: #162040; --line: rgba(148, 163, 196, .14); --line2: rgba(148, 163, 196, .3);
  --tx: #e8edf8; --mut: #96a3bd; --acc: #ff7a45; --acc-2: #f59e0b; --acc2: #2dd4bf; --ok: #4ade80; --warn: #fbbf24; --bad: #f87171;
  --x: #f87171; --y: #4ade80; --z: #60a5fa;
  --glow1: rgba(255, 122, 69, .16); --glow2: rgba(45, 212, 191, .12); --gridline: rgba(148, 163, 196, .07);
  --r: 18px; --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -28px rgba(0, 0, 0, .9);
  --shadow-hi: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 28px 50px -24px rgba(0, 0, 0, .95);
  --font: "Noto Sans TC", system-ui, -apple-system, "PingFang TC", sans-serif; --display: "Space Grotesk", var(--font);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6fa; --bg2: #eceff6; --card: #fff; --card2: #f8f9fc; --line: rgba(30, 41, 70, .1); --line2: rgba(30, 41, 70, .22);
    --tx: #131a2c; --mut: #56627c; --acc: #e8590c; --acc-2: #d97706; --acc2: #0d9488; --ok: #16a34a; --warn: #b45309; --bad: #dc2626;
    --glow1: rgba(255, 122, 69, .14); --glow2: rgba(13, 148, 136, .1); --gridline: rgba(30, 41, 70, .06);
    --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 14px 30px -22px rgba(20, 30, 60, .35);
    --shadow-hi: 0 2px 4px rgba(20, 30, 60, .06), 0 24px 44px -22px rgba(20, 30, 60, .4); color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f6fa; --bg2: #eceff6; --card: #fff; --card2: #f8f9fc; --line: rgba(30, 41, 70, .1); --line2: rgba(30, 41, 70, .22);
  --tx: #131a2c; --mut: #56627c; --acc: #e8590c; --acc-2: #d97706; --acc2: #0d9488; --ok: #16a34a; --warn: #b45309; --bad: #dc2626;
  --glow1: rgba(255, 122, 69, .14); --glow2: rgba(13, 148, 136, .1); --gridline: rgba(30, 41, 70, .06);
  --shadow: 0 1px 2px rgba(20, 30, 60, .05), 0 14px 30px -22px rgba(20, 30, 60, .35);
  --shadow-hi: 0 2px 4px rgba(20, 30, 60, .06), 0 24px 44px -22px rgba(20, 30, 60, .4); color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--tx); font: 16px/1.75 var(--font); -webkit-font-smoothing: antialiased; padding-bottom: 72px; position: relative; overflow-x: hidden; }
body::before { content: ""; position: absolute; inset: 0 0 auto; height: 1100px; z-index: -1; pointer-events: none;
  background: radial-gradient(600px 420px at 85% 80px, var(--glow1), transparent 70%), radial-gradient(520px 380px at 5% 380px, var(--glow2), transparent 70%),
    linear-gradient(var(--gridline) 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, var(--gridline) 1px, transparent 1px) 0 0 / 40px 40px;
  -webkit-mask: linear-gradient(#000 40%, transparent); mask: linear-gradient(#000 40%, transparent); }
a { color: var(--acc2); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; letter-spacing: .01em; }
button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--acc2); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--acc) 35%, transparent); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--acc); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.muted { color: var(--mut); }
.small { font-size: .86rem; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 6px; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 6px; font: 600 .74rem/1.6 var(--display); color: var(--mut); text-align: center; }

/* 頂列 */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px max(16px, calc(50% - 600px));
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--tx); text-decoration: none; font-weight: 900; letter-spacing: .02em; flex: none; }
.brand-mark { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font: 700 14px var(--display); color: #fff;
  background: linear-gradient(135deg, var(--acc), var(--acc-2) 55%, var(--acc2)); box-shadow: 0 6px 18px -6px var(--acc); transition: transform .3s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.top-nav { display: flex; gap: 6px; align-items: center; }
.top-nav a { color: var(--tx); text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: .94rem; white-space: nowrap; transition: background .2s; }
.top-nav a:hover { background: var(--bg2); }
.search-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px 0 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); color: var(--mut); cursor: pointer; font-size: .9rem; transition: border-color .2s, color .2s; }
.search-btn:hover { border-color: var(--acc2); color: var(--tx); }
.search-btn svg, .icon-btn svg, .search-box svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); cursor: pointer; transition: transform .3s var(--ease), border-color .2s; }
.icon-btn:hover { border-color: var(--acc2); transform: rotate(30deg); }
.icon-btn .fill { fill: currentColor; stroke: none; }
.pill { display: inline-block; min-width: 3em; text-align: center; padding: 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--acc2) 18%, transparent); color: var(--acc2); font: 700 .8rem/1.75 var(--display); }

main { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.eyebrow { margin: 0 0 8px; color: var(--acc); font-weight: 700; font-size: .84rem; letter-spacing: .1em; }
.lead { font-size: 1.08rem; color: var(--mut); max-width: 46em; }
.band { margin: 72px 0; }
.band > h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); font-weight: 900; }
.band > h2::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 12px; border-radius: 3px; vertical-align: .18em; background: linear-gradient(135deg, var(--acc), var(--acc2)); }

/* 進場動畫 */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* 按鈕 */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 22px; border-radius: 13px; border: 1px solid var(--line2);
  background: var(--card); color: var(--tx); text-decoration: none; font-weight: 700; cursor: pointer; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); border-color: var(--acc2); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--acc), var(--acc-2)); color: #1a0f05; border: 0; box-shadow: 0 10px 26px -10px var(--acc); overflow: hidden; }
.btn.primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn.primary:hover::after { transform: translateX(120%); }
.btn.primary:hover { box-shadow: 0 16px 34px -12px var(--acc); }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: .88rem; border-radius: 10px; }

/* 首頁 hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 40px; align-items: center; padding: 64px 0 12px; }
.hero h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 900; letter-spacing: .005em; line-height: 1.18; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--acc), var(--acc-2), var(--acc2), var(--acc)); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 8s linear infinite; }
@keyframes shine { to { background-position: 300% 0; } }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0; }
.stats { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 12px; color: var(--mut); font-size: .88rem; }
.stats li { padding: 10px 16px; border-radius: 14px; background: color-mix(in srgb, var(--card) 70%, transparent); border: 1px solid var(--line); }
.stats b { display: block; font: 700 1.6rem/1.15 var(--display); color: var(--tx); }
.hero-vis { position: relative; }
.hero-glow { position: absolute; inset: 10% 8%; border-radius: 50%; background: radial-gradient(closest-side, var(--glow1), transparent); filter: blur(20px); }
.printer { position: relative; width: 100%; height: auto; display: block; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .35)); }
.pr-frame { fill: color-mix(in srgb, var(--card) 85%, transparent); stroke: var(--line2); stroke-width: 1.5; }
.pr-rail { stroke: var(--mut); stroke-width: 5; stroke-linecap: round; opacity: .55; }
.pr-bed { fill: var(--bg2); stroke: var(--line2); }
.pr-grid { stroke: var(--line2); stroke-width: 1; }
.pr-layer { fill: url(#prg); }
.pr-fil { fill: none; stroke: var(--acc); stroke-width: 2.5; stroke-dasharray: 4 3; opacity: .7; }
.pr-head { fill: var(--card2); stroke: var(--line2); stroke-width: 1.5; }
.pr-tip { fill: var(--mut); }
.pr-led { fill: var(--acc2); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.chip { position: absolute; padding: 4px 12px; border-radius: 999px; font: 600 .78rem/1.6 var(--display); color: var(--tx); background: color-mix(in srgb, var(--card) 85%, transparent);
  border: 1px solid var(--line2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: var(--shadow); animation: float 6s ease-in-out infinite; }
.chip.c1 { left: -4%; top: 18%; } .chip.c2 { right: -2%; top: 40%; animation-delay: -2s; color: var(--acc2); } .chip.c3 { left: 6%; bottom: 10%; animation-delay: -4s; color: var(--acc); }
@keyframes float { 50% { transform: translateY(-8px); } }
.hero-card { position: relative; margin-top: -40px; margin-left: auto; width: min(320px, 92%); background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line2); border-radius: var(--r); padding: 16px;
  box-shadow: var(--shadow-hi); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.hero-card a { color: var(--tx); text-decoration: none; }
.hero-card b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.rthumb { position: relative; display: block; margin-bottom: 10px; }
.rthumb img { border-radius: 10px; aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.rthumb .bar { position: absolute; left: 8px; right: 8px; bottom: 8px; margin: 0; height: 4px; background: rgba(0, 0, 0, .5); }

/* 圖解 */
.diagram-wrap { margin: 0; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; box-shadow: var(--shadow); }
.diagram-wrap figcaption { color: var(--mut); font-size: .9rem; margin-top: 8px; text-align: center; }
.diagram { width: 100%; min-width: 620px; height: auto; display: block; }
.diagram-sm { min-width: 0; max-width: 420px; margin: 0 auto; }
.diagram text { font-family: var(--font); fill: var(--tx); }
.s-box { fill: var(--bg2); stroke: var(--line2); transition: fill .2s; }
.diagram g:hover > .s-box { fill: color-mix(in srgb, var(--acc) 12%, var(--bg2)); }
.s-h { font-size: 22px; font-weight: 900; }
.s-sub { font-size: 13px; fill: var(--mut) !important; }
.s-tag { font-size: 12px; font-weight: 700; fill: var(--acc) !important; }
.s-arrow { fill: none; stroke: var(--acc2); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 6 5; animation: flow 1.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -22; } }
.s-face { fill: color-mix(in srgb, var(--acc2) 16%, transparent); }
.s-edge { fill: none; stroke: var(--acc2); stroke-width: 2.5; stroke-linejoin: round; }
.s-vert circle, circle.s-vert { fill: var(--acc); }
.s-normal { fill: none; stroke: var(--acc); stroke-width: 2.5; stroke-dasharray: 5 4; stroke-linecap: round; }
.s-cube { fill: none; stroke: var(--mut); stroke-width: 2; stroke-linejoin: round; }
.ax-x, .ax-y, .ax-z { stroke-width: 3; stroke-linecap: round; fill: none; }
.ax-x { stroke: var(--x); } .ax-y { stroke: var(--y); } .ax-z { stroke: var(--z); }
.ax-xt { fill: var(--x) !important; font-weight: 900; } .ax-yt { fill: var(--y) !important; font-weight: 900; } .ax-zt { fill: var(--z) !important; font-weight: 900; }
.s-keys rect { fill: var(--bg2); stroke: var(--line2); } .s-keys text { font-size: 15px; font-weight: 700; }
.s-bed { fill: var(--mut); opacity: .5; }
.s-layer { fill: color-mix(in srgb, var(--acc) 70%, transparent); }
.s-over { fill: var(--acc); }
.s-support { stroke: var(--mut); stroke-width: 2; stroke-dasharray: 3 3; }

/* 課程地圖 */
.lane { display: flex; align-items: center; gap: 12px; font-size: .9rem; color: var(--mut); letter-spacing: .14em; margin: 28px 0 14px; }
.lane::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line2), transparent); }
.path, .grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.mcard { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: var(--r); background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line);
  color: var(--tx); text-decoration: none; box-shadow: var(--shadow); transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; isolation: isolate; overflow: hidden; }
.mcard::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(400px 160px at var(--mx, 50%) -20%, color-mix(in srgb, var(--acc) 16%, transparent), transparent 70%); opacity: 0; transition: opacity .3s; }
.mcard:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--acc) 60%, transparent); box-shadow: var(--shadow-hi); }
.mcard:hover::before { opacity: 1; }
.mcard.elective { border-style: dashed; background: var(--card); }
.mcard.is-done { border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.mcard.is-here { border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 20%, transparent), var(--shadow-hi); }
.here { position: absolute; right: 70px; top: 22px; padding: 0 8px; border-radius: 6px; font-size: .74rem; font-weight: 700; background: var(--acc); color: #1a0f05; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--acc) 0%, transparent); } 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acc) 45%, transparent); } }
.step { font: 700 .72rem/1 var(--display); letter-spacing: .14em; color: var(--mut); margin-bottom: 6px; }
.ring { --p: 0; position: absolute; right: 16px; top: 16px; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: conic-gradient(var(--acc2) calc(var(--p) * 1%), var(--bg2) 0); transition: --p .6s; }
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.ring b { position: relative; font: 700 .7rem var(--display); color: var(--mut); }
.mcard.is-done .ring { background: conic-gradient(var(--ok) 100%, var(--bg2) 0); }
.ring.big { position: relative; right: auto; top: auto; width: 96px; height: 96px; }
.ring.big::before { inset: 8px; }
.ring.big b { font-size: 1.4rem; color: var(--tx); }
.mid { display: inline-block; width: max-content; padding: 0 8px; border-radius: 6px; font: 700 .82rem/1.75 var(--display); color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, transparent); }
.mid.big { font-size: 1rem; margin-right: 10px; vertical-align: middle; }
.mtitle { font-size: 1.18rem; font-weight: 900; }
.msub { color: var(--mut); font-size: .9rem; min-height: 2.9em; line-height: 1.6; }
.mmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--mut); font-size: .84rem; margin-top: 8px; }
.mpct { color: var(--mut); font-size: .82rem; }
.bar { display: block; height: 6px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--acc2), var(--ok)); border-radius: inherit; transition: width .8s var(--ease); }
.lv { display: inline-flex; gap: 3px; vertical-align: middle; }
.lv i { width: 8px; height: 8px; border-radius: 2px; background: var(--line2); }
.lv i.on { background: linear-gradient(135deg, var(--acc), var(--acc-2)); }
.steps { list-style: none; counter-reset: s; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.steps li { counter-increment: s; position: relative; padding: 52px 20px 20px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--mut); }
.steps li::before { content: "0" counter(s); position: absolute; left: 20px; top: 16px; font: 700 1.3rem var(--display); color: var(--acc); }
.steps b { display: block; color: var(--tx); font-size: 1.05rem; margin-bottom: 4px; }
.note { padding: 26px 28px; background: linear-gradient(135deg, color-mix(in srgb, var(--acc2) 10%, var(--card)), var(--card)); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.note > h2::before { background: var(--acc2); }

/* 路徑 */
.crumb { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; font-size: .88rem; color: var(--mut); }
.crumb a { color: var(--mut); text-decoration: none; }
.crumb a:hover { color: var(--acc2); }

/* 單元頁 */
.mhead { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; margin: 18px 0 28px; align-items: start; }
.mhead h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 900; }
.mprog { display: flex; align-items: center; gap: 12px; color: var(--mut); font-size: .9rem; margin-top: 18px; }
.mprog .bar { flex: 1; max-width: 320px; margin: 0; height: 8px; }
.goals { background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); }
.goals h2 { font-size: .95rem; color: var(--acc); letter-spacing: .06em; }
.goals ul { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 6px; }
.goals li { position: relative; padding-left: 22px; }
.goals li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 10px; height: 6px; border-left: 2px solid var(--acc2); border-bottom: 2px solid var(--acc2); transform: rotate(-45deg); }
.goals p { margin: 0; }
.toolbar { position: sticky; top: 57px; z-index: 10; margin: 28px -16px 0; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.toc { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.toc::-webkit-scrollbar { display: none; }
.toc a { flex: none; padding: 5px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--mut); text-decoration: none; font-size: .86rem; transition: all .2s; }
.toc a:hover { color: var(--tx); border-color: var(--line2); }
.toc a.is-active { color: #04201c; background: var(--acc2); border-color: var(--acc2); font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--card); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 3px 11px; border-radius: 8px; font-size: .84rem; color: var(--mut); cursor: pointer; transition: all .2s; }
.seg button[aria-pressed="true"] { background: var(--bg2); color: var(--tx); font-weight: 700; box-shadow: 0 1px 0 var(--line2); }
.fcount { color: var(--mut); font-size: .84rem; margin-left: auto; }
.unit { margin: 44px 0; padding-top: 12px; scroll-margin-top: 150px; }
.unit-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.unit-h h2 { margin: 0; font-size: 1.4rem; font-weight: 900; }
.uid { font: 700 .95rem var(--display); color: var(--acc2); padding: 2px 8px; border-radius: 6px; background: color-mix(in srgb, var(--acc2) 12%, transparent); }
.ucount { margin-left: auto; color: var(--mut); font-size: .86rem; display: inline-flex; align-items: center; gap: 8px; }
.mini-bar { display: inline-block; width: 60px; height: 5px; border-radius: 99px; background: var(--bg2); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--ok); }
.unit.is-filtered-empty .vgrid::after { content: "沒有符合篩選條件的影片"; grid-column: 1/-1; color: var(--mut); font-size: .9rem; padding: 14px; border: 1px dashed var(--line2); border-radius: 12px; text-align: center; }
.vgrid { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.vgrid > li[hidden] { display: none; }
.vcard { display: flex; flex-direction: column; height: 100%; border-radius: 16px; overflow: hidden; background: var(--card); border: 1px solid var(--line); color: var(--tx); text-decoration: none; box-shadow: var(--shadow);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.vcard:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--acc2) 60%, transparent); box-shadow: var(--shadow-hi); }
.vcard.is-done { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.vcard.is-done img { opacity: .55; filter: saturate(.6); }
.thumb { position: relative; aspect-ratio: 16/9; background: var(--bg2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.vcard:hover .thumb img { transform: scale(1.06); }
.hover-play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; transform: translate(-50%, -50%) scale(.7); opacity: 0; background: color-mix(in srgb, var(--acc) 92%, transparent);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .45); transition: all .3s var(--ease); }
.hover-play::after { content: ""; position: absolute; left: 21px; top: 16px; border-left: 15px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.vcard:hover .hover-play, .vcard:focus-visible .hover-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.dur { position: absolute; right: 8px; bottom: 8px; padding: 0 7px; border-radius: 6px; background: rgba(0, 0, 0, .78); color: #fff; font: 700 .76rem/1.7 var(--display); }
.st:not(:empty) { position: absolute; left: 8px; top: 8px; padding: 0 8px; border-radius: 6px; font-size: .76rem; font-weight: 700; background: var(--warn); color: #1a1205; }
.is-done .st { background: var(--ok); color: #052010; }
.vbody { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; flex: 1; }
.vtitle { font-weight: 700; font-size: .95rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.vmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--mut); font-size: .84rem; margin-top: auto; }
.tag { display: inline-block; padding: 0 8px; border-radius: 6px; background: var(--bg2); color: var(--mut); font-size: .76rem; font-style: normal; font-weight: 700; }
.tag.ok { color: var(--ok); }
.task { padding: 20px; border-radius: 16px; border: 1px dashed var(--line2); margin: 16px 0; background: repeating-linear-gradient(-45deg, transparent 0 12px, color-mix(in srgb, var(--acc) 4%, transparent) 12px 24px); }
.task p { margin: 4px 0 0; color: var(--mut); }
.check { display: grid; gap: 12px; padding: 18px 20px; border-radius: 16px; background: var(--bg2); border: 1px solid var(--line); transition: border-color .3s, background .3s; }
.unit.is-passed .check { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 7%, var(--bg2)); }
.crit { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.crit input, .todo input { appearance: none; -webkit-appearance: none; display: grid; place-items: center; width: 22px; height: 22px; margin: 3px 0 0; border-radius: 7px; border: 2px solid var(--line2);
  background: var(--card); flex: none; cursor: pointer; transition: all .2s var(--ease); }
.crit input::after, .todo input::after { content: ""; width: 9px; height: 5px; margin-top: -3px; border-left: 2.5px solid #052010; border-bottom: 2.5px solid #052010; transform: rotate(-45deg) scale(0); transition: transform .25s var(--ease); }
.crit input:checked, .todo input:checked { background: var(--ok); border-color: var(--ok); }
.crit input:checked::after, .todo input:checked::after { transform: rotate(-45deg) scale(1); }
.work span { display: block; font-size: .86rem; color: var(--mut); margin-bottom: 4px; }
textarea, input[type="text"], input[type="search"] { width: 100%; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line2); background: var(--card); resize: vertical; transition: border-color .2s, box-shadow .2s; }
textarea:focus, input[type="text"]:focus { outline: none; border-color: var(--acc2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc2) 20%, transparent); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 56px 0; }
.pager > a { padding: 14px 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--tx); text-decoration: none; font-weight: 700; box-shadow: var(--shadow); transition: transform .3s var(--ease), border-color .3s; }
.pager > a:hover { transform: translateY(-2px); border-color: var(--acc2); }

/* 影片頁 */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; margin: 18px 0; align-items: start; }
.player { position: relative; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden; background: #000; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9); outline: 1px solid var(--line); }
.player iframe, .player > div { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player.is-loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .2); border-top-color: var(--acc); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.facade { position: absolute; inset: 0; padding: 0; border: 0; background: #000; cursor: pointer; }
.facade img { width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: opacity .3s, transform .6s var(--ease); }
.facade:hover img { opacity: 1; transform: scale(1.02); }
.play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--acc); box-shadow: 0 12px 34px rgba(0, 0, 0, .5); transition: transform .3s var(--ease); }
.play::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--acc) 70%, transparent); animation: ripple 2s ease-out infinite; }
@keyframes ripple { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.play::after { content: ""; position: absolute; left: 34px; top: 27px; border-left: 24px solid #fff; border-top: 15px solid transparent; border-bottom: 15px solid transparent; }
.facade:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.resume-at { position: absolute; left: 50%; top: calc(50% + 62px); transform: translateX(-50%); padding: 3px 14px; border-radius: 99px; background: rgba(0, 0, 0, .75); color: #fff; font-size: .88rem; white-space: nowrap; }
.vh1 { font-size: clamp(1.25rem, 2.6vw, 1.65rem); margin: 20px 0 8px; font-weight: 900; }
.status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }
.status button { min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); cursor: pointer; font-weight: 700; transition: all .2s var(--ease); }
.status button:hover { border-color: var(--acc2); }
.status button:active { transform: scale(.96); }
.status button[aria-pressed="true"] { background: var(--acc2); border-color: var(--acc2); color: #04201c; }
.status button[data-set="done"][aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #052010; box-shadow: 0 8px 22px -10px var(--ok); }
.status .yt { margin-left: auto; font-size: .9rem; }
.nudge { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); font-weight: 700; }
.nextup { display: grid; gap: 8px; padding: 14px; margin-bottom: 16px; border-radius: var(--r); background: linear-gradient(135deg, color-mix(in srgb, var(--ok) 12%, var(--card)), var(--card)); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); animation: pop .5s var(--ease); }
.nx-k { font-weight: 700; color: var(--ok); }
.nx { display: grid; grid-template-columns: 140px 1fr auto; gap: 14px; align-items: center; color: var(--tx); text-decoration: none; }
.nx img { border-radius: 10px; aspect-ratio: 16/9; object-fit: cover; }
.nx b { line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nx-go { padding: 8px 14px; border-radius: 10px; background: var(--ok); color: #052010; font-weight: 700; white-space: nowrap; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel h2 { display: flex; align-items: center; gap: 10px; font-size: 1.02rem; color: var(--acc); letter-spacing: .04em; }
.panel p { margin: 0 0 10px; }
.review { padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 13%, transparent); color: var(--warn); font-size: .92rem; }
.chapters { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; counter-reset: c; }
.chapters button { position: relative; display: flex; gap: 12px; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; line-height: 1.55; transition: background .2s; }
.chapters button:hover { background: var(--bg2); }
.chapters button.is-active { background: color-mix(in srgb, var(--acc2) 14%, transparent); }
.chapters button.is-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--acc2); }
.chapters time { font: 700 .88rem/1.75 var(--display); color: var(--acc2); flex: none; min-width: 3.4em; }
.res-h { font-size: .9rem; margin: 14px 0 6px; color: var(--mut); }
.res { margin: 0 0 10px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.res a { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line2); text-decoration: none; font-size: .86rem; word-break: break-all; }
.res a:hover { border-color: var(--acc2); }
.watch-side { position: sticky; top: 76px; }
.notes textarea { font-size: .95rem; line-height: 1.7; }
.row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.saved { color: var(--ok); font-size: .86rem; }
.todo { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.todo label { display: flex; gap: 10px; cursor: pointer; }
.stepmeter { --n: 0; display: inline-flex; gap: 3px; margin-left: auto; }
.stepmeter i { width: 16px; height: 5px; border-radius: 3px; background: var(--bg2); transition: background .3s; }
.stepmeter i:nth-child(1) { background: color-mix(in srgb, var(--ok) calc(min(var(--n), 1) * 100%), var(--bg2)); }
.stepmeter i:nth-child(2) { background: color-mix(in srgb, var(--ok) calc(clamp(0, var(--n) - 1, 1) * 100%), var(--bg2)); }
.stepmeter i:nth-child(3) { background: color-mix(in srgb, var(--ok) calc(clamp(0, var(--n) - 2, 1) * 100%), var(--bg2)); }
.pv-pager .pv { display: flex; gap: 12px; align-items: center; max-width: 48%; padding: 10px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--tx); text-decoration: none; font-size: .9rem; font-weight: 700; line-height: 1.5; box-shadow: var(--shadow); transition: transform .3s var(--ease), border-color .3s; }
.pv-pager .pv:hover { transform: translateY(-2px); border-color: var(--acc2); }
.pv img { width: 120px; border-radius: 9px; flex: none; aspect-ratio: 16/9; object-fit: cover; }
.pv small { display: block; color: var(--acc); }
.back { margin: -28px 0 40px; }

/* 搜尋 */
.search { width: min(640px, calc(100% - 32px)); max-height: min(620px, 80vh); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line2); border-radius: 20px; background: var(--card); color: var(--tx); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .7); overflow: hidden; }
.search[open] { display: flex; flex-direction: column; animation: pop .25s var(--ease); }
.search::backdrop { background: rgba(4, 7, 15, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.search-box { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--mut); }
.search-box input { border: 0; background: transparent; padding: 6px 0; font-size: 1.05rem; color: var(--tx); }
.search-box input:focus { outline: none; box-shadow: none; }
.search-res { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.search-res li a { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; color: var(--tx); text-decoration: none; }
.search-res li a img { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; }
.search-res li a b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .92rem; line-height: 1.5; }
.search-res li a small { display: block; color: var(--mut); font-size: .8rem; }
.search-res li[aria-selected="true"] a, .search-res li a:hover { background: var(--bg2); }
.search-res mark { background: color-mix(in srgb, var(--acc) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-res .empty { padding: 18px 12px; color: var(--mut); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-res .empty button { padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; font-size: .86rem; }
.search-res .group { padding: 6px 10px; color: var(--mut); font-size: .78rem; letter-spacing: .1em; }
.search-hint { margin: 0; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--mut); font-size: .8rem; }

/* 通知與慶祝 */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 10px; width: min(340px, calc(100% - 32px)); pointer-events: none; }
.toast-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow-hi); font-size: .9rem; line-height: 1.5; animation: tin .4s var(--ease); pointer-events: auto; }
.toast-item.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.toast-item.badge-toast { border-color: color-mix(in srgb, var(--acc-2) 60%, transparent); }
.toast-item.out { opacity: 0; transform: translateY(10px); transition: all .4s; }
@keyframes tin { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.confetti { position: fixed; z-index: 60; width: 8px; height: 12px; border-radius: 2px; pointer-events: none; animation: burst 1.05s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes burst { to { transform: translate(var(--dx), calc(var(--dy) + 80px)) rotate(var(--rot)); opacity: 0; } }

/* 我的紀錄 */
.mehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 44px 0 22px; }
.mehead h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 900; }
.nick { display: block; font-size: .86rem; color: var(--mut); max-width: 320px; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; }
.warn, .toast { padding: 12px 16px; border-radius: 12px; }
.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.toast { background: color-mix(in srgb, var(--acc2) 14%, transparent); color: var(--acc2); font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; }
.kpi { padding: 18px 20px; border-radius: var(--r); background: linear-gradient(180deg, var(--card2), var(--card)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.kpi span { color: var(--mut); font-size: .86rem; }
.kpi b { display: block; font: 700 2rem/1.2 var(--display); margin-top: 4px; }
.kpi small { font-size: .9rem; color: var(--mut); font-weight: 500; }
.kpi-ring { display: flex; align-items: center; gap: 14px; grid-row: span 1; }
.kpi-ring .ring b { margin: 0; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 18px 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); opacity: .55; filter: grayscale(1); transition: transform .3s var(--ease); }
.badge.got { opacity: 1; filter: none; box-shadow: var(--shadow); }
.badge.got:hover { transform: translateY(-3px) rotate(-1deg); }
.badge b { font-size: .95rem; }
.badge small { color: var(--mut); font-size: .78rem; line-height: 1.5; }
.medal { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 50%; font: 700 .95rem var(--display); color: #1a0f05;
  background: radial-gradient(circle at 35% 30%, #ffe1b0, var(--acc-2) 45%, var(--acc)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--acc-2) 25%, transparent), 0 8px 18px -6px var(--acc); }
.badge:not(.got) .medal { background: var(--bg2); color: var(--mut); box-shadow: 0 0 0 4px var(--line); }
.medal.sm { width: 40px; height: 40px; margin: 0; flex: none; font-size: .8rem; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 15px); gap: 4px; overflow-x: auto; padding: 16px; width: max-content; max-width: 100%; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.heat i { width: 15px; height: 15px; border-radius: 4px; background: var(--bg2); }
.heat .h1 { background: color-mix(in srgb, var(--acc2) 30%, var(--bg2)); } .heat .h2 { background: color-mix(in srgb, var(--acc2) 55%, var(--bg2)); }
.heat .h3 { background: color-mix(in srgb, var(--acc2) 80%, var(--bg2)); } .heat .h4 { background: var(--acc2); }
.heat .today { outline: 2px solid var(--acc); outline-offset: 1px; }
.heat .fut { opacity: .3; }
.mlist { display: grid; gap: 8px; }
.mrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(80px, 220px) auto; gap: 14px; align-items: center; padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--tx); text-decoration: none; transition: border-color .2s, transform .2s var(--ease); }
.mrow:hover { border-color: var(--acc2); transform: translateX(3px); }
.mrow .bar { margin: 0; }
.mrow-t { font-weight: 700; }
.nitem { padding: 16px 20px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); margin-bottom: 10px; break-inside: avoid; }
.nitem h3 { font-size: 1rem; }
.nitem h3 a { color: var(--tx); }
.nitem pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: .94rem/1.7 var(--font); color: var(--mut); }
.print-name { display: none; }

.foot { max-width: 1200px; margin: 48px auto 0; padding: 26px 16px; border-top: 1px solid var(--line); color: var(--mut); font-size: .86rem; }

@media (max-width: 900px) {
  .hero, .mhead, .watch { grid-template-columns: 1fr; }
  .hero-vis { max-width: 440px; margin: 0 auto; width: 100%; }
  .watch-side { position: static; }
  .hero { padding-top: 36px; gap: 20px; }
}
@media (max-width: 720px) {
  .search-btn span, .search-btn kbd, .nav-map { display: none; }
  .search-btn { width: 38px; padding: 0; justify-content: center; }
}
@media (max-width: 560px) {
  .brand-t { font-size: .95rem; }
  .nav-me-t { display: none; }
  .top-nav a { padding: 6px 8px; }
  .mrow { grid-template-columns: 48px minmax(0, 1fr); }
  .mrow .bar, .mrow .small { grid-column: 2; }
  .pv-pager { flex-direction: column; }
  .pv-pager .pv { max-width: 100%; }
  .status .yt { margin-left: 0; }
  .nx { grid-template-columns: 110px 1fr; }
  .nx-go { grid-column: 1/-1; text-align: center; }
  .fcount { margin-left: 0; width: 100%; }
  .chip.c1 { left: 0; } .chip.c2 { right: 0; }
  .here { right: 16px; top: auto; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  :root { --bg: #fff; --card: #fff; --card2: #fff; --bg2: #f1f3f7; --tx: #111; --mut: #444; --line: #ccc; --line2: #bbb; }
  body { padding: 0; } body::before { display: none; }
  .top, .foot, .tools, .nick, .pk-dock, .skip, .toast, .warn, .toasts, .search { display: none !important; }
  .print-name { display: block; }
  .nitem, .kpi, .mrow, .badge { box-shadow: none; }
  .js .reveal { opacity: 1; transform: none; }
}
.kpi-ring > span:last-child { white-space: nowrap; }
@media (max-width: 560px) { .stats { display: grid; grid-template-columns: repeat(2, 1fr); } }
