/* =========================================================
   home.css｜課程首頁（index.html）
   版型共用 digi05.css 的 .d5-page 設計語彙＋ shell.css 的外框
   ========================================================= */

/* ---------- Hero（深色，接續 header） ---------- */
.d5-page .h-hero { position: relative; overflow: hidden; color: #F4F1EB; padding: calc(var(--hdr-h, 68px) + 56px) 0 64px;
	background: radial-gradient(circle at 88% 8%, rgba(139,108,255,.34), transparent 40%), radial-gradient(circle at 6% 96%, rgba(217,119,87,.3), transparent 42%), radial-gradient(circle at 60% 110%, rgba(34,193,182,.22), transparent 40%), #141311; }
.h-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1.2px) 0 0 / 22px 22px; pointer-events: none; }
.h-hero .d5-wrap { position: relative; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); gap: 48px; align-items: center; }
.h-kicker { font: 700 12px var(--d-font-mono); letter-spacing: .16em; text-transform: uppercase; color: #F2B28F; display: flex; align-items: center; gap: 10px; margin: 0; }
.h-kicker::before { content: ""; width: 26px; height: 2px; background: currentColor; }
.h-hero h1 { font: 900 clamp(38px, 5.6vw, 66px)/1.08 var(--d-font-display); color: #fff; margin: 18px 0 0; letter-spacing: -.01em; }
.h-hero h1 span { display: block; font: 700 clamp(13px, 1.4vw, 16px)/1.4 var(--d-font-mono); letter-spacing: .2em; text-transform: uppercase; margin-top: 12px; background: linear-gradient(120deg, #F2B28F, #C9B8FF 55%, #8EEDE4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.h-hero .lead { font-size: 16.5px; line-height: 1.9; color: #CFCAC1; margin: 22px 0 0; max-width: 40em; }
.h-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.h-cta a { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 800; border-radius: 12px; padding: 12px 18px; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s; }
.h-cta a.pri { color: #141311; background: #fff; box-shadow: 0 14px 30px -16px rgba(255,255,255,.6); }
.h-cta a.pri:hover { transform: translateY(-2px); }
.h-cta a.sec { color: #fff; border: 1px solid rgba(255,255,255,.3); }
.h-cta a.sec:hover { background: rgba(255,255,255,.08); }
.h-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); margin-top: 34px; border-top: 1px solid rgba(255,255,255,.18); }
.h-stats div { padding: 14px 10px 0 0; }
.h-stats b { display: block; font: 900 clamp(26px, 3vw, 36px)/1 var(--d-font-display); color: #fff; font-variant-numeric: tabular-nums; }
.h-stats span { display: block; font-size: 12.5px; color: #A8A39A; margin-top: 6px; line-height: 1.5; }

.h-visual { position: relative; }
.h-visual .img { border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3.3; box-shadow: 0 40px 70px -40px rgba(0,0,0,.9); border: 1px solid rgba(255,255,255,.12); }
.h-visual .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.next-card { position: relative; margin: -64px 18px 0; background: rgba(255,255,255,.96); color: #1F1E1B; border-radius: 18px; padding: 16px 18px; box-shadow: 0 24px 50px -28px rgba(0,0,0,.8); }
.next-card .lbl { display: flex; align-items: center; gap: 8px; font: 800 11px var(--d-font-mono); letter-spacing: .12em; text-transform: uppercase; color: #9E4A2E; }
.next-card .lbl i { width: 8px; height: 8px; border-radius: 50%; background: #E8590C; box-shadow: 0 0 0 4px rgba(232,89,12,.18); animation: hPulse 1.8s ease-in-out infinite; }
@keyframes hPulse { 50% { box-shadow: 0 0 0 7px rgba(232,89,12,.05); } }
.next-card b { display: block; font: 900 18px/1.35 var(--d-font-display); margin-top: 6px; }
.next-card .meta { font-size: 13px; color: #6B665E; margin-top: 4px; }
.next-card a { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 13px; font-weight: 800; color: #9E4A2E; text-decoration: none; }

/* ---------- 區塊共用 ---------- */
.h-sec { padding-top: 84px; }
.h-sec:first-child { padding-top: 64px; }
.h-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin-bottom: 24px; }
.h-head .d5-mono { color: var(--d-brand-strong); margin: 0 0 6px; }
.h-head h2 { font: 900 clamp(26px, 3vw, 36px)/1.25 var(--d-font-display); margin: 0; }
.h-head p { margin: 8px 0 0; max-width: 46em; }

/* ---------- 三階段 ---------- */
.phase-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.phase { position: relative; background: #fff; border: 1px solid var(--d-line); border-radius: 18px; padding: 20px 20px 18px; overflow: hidden; }
.phase::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--pc); }
.phase .ph { font: 800 11px var(--d-font-mono); letter-spacing: .14em; color: var(--pc); }
.phase h3 { font: 900 20px/1.3 var(--d-font-display); margin: 6px 0 0; }
.phase .wk { font: 700 12.5px var(--d-font-mono); color: var(--d-ink-3); margin-top: 4px; }
.phase p { font-size: 14px !important; margin: 10px 0 0 !important; line-height: 1.75 !important; }
.phase .chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.phase .chips a, .phase .chips span { font-size: 12px; font-weight: 700; border-radius: 99px; padding: 3px 10px; background: #F3EFE8; color: var(--d-ink-2); text-decoration: none; }
.phase .chips a:hover { background: var(--d-ink); color: #fff; }

/* ---------- 單元卡片 ---------- */
.unit-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.unit { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--d-line); border-radius: 18px; overflow: hidden; color: var(--d-ink); text-decoration: none; transition: transform .3s var(--d-ease), box-shadow .3s; }
.unit:hover { transform: translateY(-4px); box-shadow: 0 26px 44px -30px rgba(31,30,27,.55); color: var(--d-ink); }
.unit .pic { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #EFEAE2; }
.unit .pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--d-ease); }
.unit:hover .pic img { transform: scale(1.05); }
.unit .pic::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--c); }
.unit .no { position: absolute; left: 12px; top: 12px; min-width: 40px; height: 40px; padding: 0 8px; border-radius: 12px; display: grid; place-items: center; background: var(--c); color: #fff; font: 800 15px/1 var(--d-font-mono); box-shadow: 0 8px 18px -8px rgba(0,0,0,.6); }
.unit .st { position: absolute; right: 12px; top: 12px; font-size: 11.5px; font-weight: 800; border-radius: 99px; padding: 3px 10px; background: rgba(255,255,255,.94); color: #2B8A5E; }
.unit .st.new { color: #fff; background: var(--c); }
.unit .st.soon { color: #8A857C; }
.unit .body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.unit .wk { font: 700 11.5px var(--d-font-mono); color: var(--d-ink-3); letter-spacing: .04em; }
.unit h3 { font: 900 17px/1.4 var(--d-font-display); margin: 4px 0 0; }
.unit p { font-size: 13.5px !important; line-height: 1.7 !important; margin: 6px 0 0 !important; }
.unit .go { margin-top: auto; padding-top: 10px; font-size: 13px; font-weight: 800; color: var(--c); }
.unit.is-soon { pointer-events: none; }
.unit.is-soon .pic img { filter: grayscale(1) opacity(.55); }
.unit.exam { background: #1F1E1B; border-color: #1F1E1B; color: #F4F1EB; }
.unit.exam:hover { color: #fff; }
.unit.exam h3 { color: #fff; }
.unit.exam p { color: #CFCAC1 !important; }
.unit.exam .wk { color: #A8A39A; }

/* ---------- 18 週時程 ---------- */
.week-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--d-line); border-radius: 18px; overflow: hidden; }
.week-list li { display: grid; grid-template-columns: 70px 108px 1fr auto; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--d-line); transition: background .2s; }
.week-list li:first-child { border-top: 0; }
.week-list li.is-hidden { display: none; }
.week-list li.is-now { background: #FFF6EF; box-shadow: inset 4px 0 0 #E8590C; }
.week-list li.is-past { opacity: .62; }
.week-list .w { font: 800 13px var(--d-font-mono); color: var(--d-ink); }
.week-list .w small { display: block; font-size: 10.5px; color: var(--d-ink-3); font-weight: 600; }
.week-list .d { font: 700 13px var(--d-font-mono); color: var(--d-ink-2); }
.week-list .t { font-size: 14.5px; color: var(--d-ink); line-height: 1.55; }
.week-list .t a { color: var(--d-ink); text-decoration: none; border-bottom: 1.5px solid var(--c, var(--d-brand)); }
.week-list .t a:hover { color: var(--c, var(--d-brand-strong)); }
.week-list .t small { display: block; font-size: 12.5px; color: var(--d-ink-3); margin-top: 2px; }
.week-list .tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.wtag { font-size: 11px; font-weight: 800; border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.wtag.unit { background: #F3EFE8; color: var(--d-ink-2); }
.wtag.review { background: #FFF0E6; color: #C2410C; }
.wtag.exam { background: #1F1E1B; color: #fff; }
.wtag.mentor { background: #E3EFEA; color: #2F5D50; }
.wtag.off { background: #F1F1F1; color: #9A9A9A; }
.wtag.now { background: #E8590C; color: #fff; }

/* ---------- 評分 ---------- */
.grade-bar { display: flex; height: 54px; border-radius: 14px; overflow: hidden; }
.grade-bar div { display: flex; align-items: center; justify-content: center; flex-direction: column; color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.grade-bar div b { font: 900 18px var(--d-font-display); }
.grade-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.grade-card { background: #fff; border: 1px solid var(--d-line); border-radius: 16px; padding: 16px 18px; }
.grade-card .k { font: 800 11px var(--d-font-mono); letter-spacing: .12em; color: var(--d-ink-3); }
.grade-card h4 { font: 900 17px/1.35 var(--d-font-display); margin: 4px 0 0; }
.grade-card p { font-size: 13.5px !important; margin: 6px 0 0 !important; line-height: 1.7 !important; }
.grade-card a { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 800; color: var(--d-brand-strong); text-decoration: none; }

/* ---------- 工具鏈 ---------- */
.tool-rows { display: grid; gap: 10px; }
.tool-row { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--d-line); border-radius: 14px; padding: 12px 16px; }
.tool-row b { font-size: 14px; color: var(--d-ink); }
.tool-row b small { display: block; font: 600 11px var(--d-font-mono); color: var(--d-ink-3); }
.tool-row .tl { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-row .tl a, .tool-row .tl span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--d-ink-2); background: #F7F4EF; border: 1px solid #EFE8DD; border-radius: 10px; padding: 5px 11px; text-decoration: none; }
.tool-row .tl a:hover { border-color: var(--d-ink); color: var(--d-ink); }
.tool-row .tl i { font-size: 10px; color: var(--d-ink-3); }

/* ---------- 示範案例 ---------- */
.case-band { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: center; background: #141311; color: #F4F1EB; border-radius: 22px; padding: 26px; overflow: hidden; position: relative; }
.case-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1.2px) 0 0 / 22px 22px; pointer-events: none; }
.case-band .poster { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1414 / 2000; box-shadow: 0 24px 40px -24px rgba(0,0,0,.9); transform: rotate(-2deg); }
.case-band .poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.case-band > div { position: relative; }
.case-band .d5-mono { color: #F2B28F; margin: 0; }
.case-band h3 { font: 900 clamp(22px, 2.6vw, 30px)/1.3 var(--d-font-display); color: #fff; margin: 8px 0 0; }
.case-band p { color: #CFCAC1 !important; margin: 10px 0 0 !important; }
.case-steps { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 18px; }
.case-steps a { display: block; border-radius: 14px; padding: 12px 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #F4F1EB; text-decoration: none; transition: background .2s, transform .2s; }
.case-steps a:hover { background: rgba(255,255,255,.12); transform: translateY(-2px); color: #fff; }
.case-steps .n { font: 800 11px var(--d-font-mono); color: var(--c); letter-spacing: .1em; }
.case-steps b { display: block; font-size: 14.5px; margin-top: 2px; }
.case-steps span { display: block; font-size: 12.5px; color: #A8A39A; margin-top: 2px; line-height: 1.5; }

@media (max-width: 991px) {
	.h-hero .d5-wrap { grid-template-columns: 1fr; gap: 36px; }
	.unit-grid, .grade-grid { grid-template-columns: 1fr 1fr; }
	.phase-grid { grid-template-columns: 1fr; }
	.case-band { grid-template-columns: 1fr; }
	.case-band .poster { max-width: 200px; }
}
@media (max-width: 640px) {
	.h-hero { padding-top: calc(var(--hdr-h, 68px) + 36px); }
	.h-stats { grid-template-columns: 1fr 1fr; row-gap: 10px; }
	.unit-grid, .grade-grid, .case-steps { grid-template-columns: 1fr; }
	.week-list li { grid-template-columns: 52px 1fr; gap: 4px 10px; padding: 12px 14px; }
	.week-list .d { grid-column: 2; grid-row: 1; }
	.week-list .t { grid-column: 1 / -1; }
	.week-list .tags { grid-column: 1 / -1; justify-content: flex-start; }
	.tool-row { grid-template-columns: 1fr; gap: 8px; }
	.grade-bar div { font-size: 11px; }
}
