:root { --pri: #d7191f; --acc: #b3121a; --pri-d: #b0151a; --pri-l: #fdf3f3; --pri-l2: #f9dcdd; --ink: #23262d; --muted: #6b707a; --line: #ececef; --bg2: #fafafa;
  --shadow: rgba(140, 20, 25, .10); --r: 14px; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink); line-height: 1.75; font-size: 16px; background: #fff; }
a { color: var(--pri); text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; }
.wrap { width: min(1200px, 100% - 32px); margin: auto; }
.wrap.narrow { width: min(920px, 100% - 32px); }
.muted { color: var(--muted); } .small { font-size: 13px; } .nowrap { white-space: nowrap; } .center { text-align: center; } .mb { margin-bottom: 20px; }
.round { border-radius: var(--r); }
.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--pri); color: #fff; padding: 11px 22px; border-radius: 99px; font-weight: 600;
  border: 2px solid var(--pri); cursor: pointer; font-size: 15px; transition: .2s; font-family: inherit; }
.btn:hover { background: var(--pri-d); border-color: var(--pri-d); transform: translateY(-1px); }
.btn.ghost:hover { background: var(--pri-l); color: var(--pri); }
.btn.ghost { background: transparent; color: var(--pri); }
.btn.light { background: #fff; color: var(--pri); border-color: #fff; }
.btn.sm { padding: 5px 14px; font-size: 14px; }
.btn.full { width: 100%; justify-content: center; margin-top: 12px; }

/* 頁首 */
.hd { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); backdrop-filter: blur(8px); box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(0,0,0,.03); border-top: 4px solid var(--pri); }
.topbar { background: var(--bg2); color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 36px; flex-wrap: wrap; }
.topbar a { color: var(--ink); }
.topbar a:hover { color: var(--pri); }
.tb-r { display: flex; align-items: center; gap: 14px; }
.hsearch { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.hsearch input { border: 0; background: transparent; color: var(--ink); padding: 3px 12px; width: 180px; font: inherit; outline: none; }
.hsearch input::placeholder { color: #a3a7af; }
.hsearch button { border: 0; background: transparent; color: var(--pri); cursor: pointer; }
.nav-row { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 20px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.logo img { height: var(--logo-h, 48px); width: auto; max-width: 260px; object-fit: contain; }
.logo .mark { width: 46px; height: 46px; border-radius: 12px; background: var(--pri); color: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 24px; font-weight: 800; }
.logo .lt b { display: block; font-size: 20px; letter-spacing: 1px; }
.logo .lt small { color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--ink); padding: 8px 11px; border-radius: 8px; font-weight: 500; font-size: 15px; position: relative; }
.nav a:hover, .nav a.on { color: var(--pri); }
.nav a.on::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 2px; height: 3px; background: var(--acc); border-radius: 3px; }
.burger { display: none; font-size: 26px; background: none; border: 0; cursor: pointer; color: var(--ink); }

/* 首頁 Banner */
.banner { position: relative; height: clamp(340px, 62vh, 620px); overflow: hidden; background: var(--pri-l); }
.slide { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1s; display: flex; align-items: center; }
.slide.on { opacity: 1; }
.slide::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.94) 0%, rgba(255,255,255,.8) 40%, rgba(255,255,255,0) 72%); }
.slide.dflt { background: radial-gradient(circle at 85% 30%, var(--pri-l2), transparent 45%), linear-gradient(135deg, #fff, var(--pri-l)); }
.sl-txt { position: relative; color: var(--ink); max-width: 1200px; }
.sl-txt h2 { font-size: clamp(30px, 5vw, 56px); margin-bottom: 10px; }
.sl-txt h2::before { content: ""; display: block; width: 64px; height: 5px; background: var(--pri); border-radius: 5px; margin-bottom: 18px; }
.sl-txt p { font-size: clamp(16px, 2vw, 22px); color: #4a4f58; max-width: 640px; }
.sl-txt .btn { margin-top: 12px; box-shadow: 0 8px 20px var(--shadow); }
.dots { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.dots button { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--pri); background: #fff; cursor: pointer; padding: 0; }
.dots button.on { background: var(--pri); }

/* 內頁標題 */
.phero { background: radial-gradient(circle at 90% 0%, var(--pri-l2), transparent 40%), linear-gradient(120deg, #fff, var(--pri-l)); color: var(--ink); padding: 46px 0 36px; border-bottom: 1px solid var(--line); }
.phero h1::before { content: ""; display: inline-block; width: 6px; height: .9em; background: var(--pri); border-radius: 3px; margin-right: 12px; vertical-align: -2px; }
.phero h1 { font-size: clamp(26px, 3.4vw, 38px); margin: 0 0 6px; }
.crumb { font-size: 14px; color: var(--muted); }
.crumb a { color: var(--pri); }

/* 區塊 */
.sec { padding: 64px 0; }
.sec.alt { background: var(--bg2); }
.sec-h { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; flex-wrap: wrap; }
.sec-h h2 { font-size: clamp(24px, 2.6vw, 32px); margin: 0; }
.sec-h > a { margin-left: auto; font-weight: 600; }
.kicker { display: block; width: 100%; color: var(--acc); font-weight: 700; letter-spacing: 3px; font-size: 13px; }
.two { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: start; }
.side { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.side.left { grid-template-columns: 240px minmax(0, 1fr); }
.lead { font-size: 18px; color: #444851; }
.rich { font-size: 16.5px; }
.rich img { border-radius: 10px; margin: 14px 0; height: auto; }
.rich h2, .rich h3 { margin-top: 1.4em; }
.rich table { border-collapse: collapse; width: 100%; }
.rich td, .rich th { border: 1px solid var(--line); padding: 8px; }
.rich iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; }
.rich .ql-align-center { text-align: center; } .rich .ql-align-right { text-align: right; }
.rich blockquote { border-left: 4px solid var(--acc); margin: 1em 0; padding: 4px 16px; background: var(--bg2); }

.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); transition: .25s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px var(--shadow); border-color: var(--pri-l2); }
.ci { position: relative; aspect-ratio: 4/3; background: var(--bg2); overflow: hidden; }
.ci img { width: 100%; height: 100%; object-fit: cover; transition: .4s; }
.card:hover .ci img { transform: scale(1.05); }
.noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--pri); opacity: .55; font-weight: 800;
  background: linear-gradient(135deg, var(--pri-l), var(--pri-l2)); }
.noimg.big { aspect-ratio: 4/3; border-radius: var(--r); }
.cbadge { position: absolute; left: 12px; top: 12px; background: var(--acc); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 99px; }
.cb { padding: 16px 18px 20px; }
.cb h3 { font-size: 18px; margin-bottom: 6px; }
.cb p { color: var(--muted); font-size: 14.5px; margin: 0; }
.cmeta { color: var(--muted); font-size: 13.5px; margin-bottom: 4px; }
.tag { display: inline-block; background: var(--pri-l); color: var(--pri); font-size: 12px; padding: 1px 10px; border-radius: 99px; font-weight: 600; vertical-align: middle; }
.tag.hot { background: #fdecea; color: #c0392b; } .tag.ok { background: #e6f4ea; color: #1a7f37; } .tag.warn { background: #fff4e0; color: #b26a00; }

.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.svc { background: #fff; border-radius: var(--r); padding: 26px 22px; color: var(--ink); border: 1px solid var(--line); transition: .25s; }
.svc:hover { border-color: var(--pri); box-shadow: 0 10px 26px var(--shadow); }
.svc h3 { font-size: 18px; } .svc p { color: var(--muted); font-size: 14.5px; margin: 0; }
.ico { width: 54px; height: 54px; border-radius: 14px; background: var(--pri-l); display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 14px; }
.ico.big { width: 100%; height: 100%; aspect-ratio: 4/3; font-size: 54px; margin: 0; }
.svc-list { display: grid; gap: 22px; }
.svc-row { display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: center; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; padding-right: 24px; }
.svc-row img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.svc-row .more { font-weight: 600; color: var(--pri); }
.svc-row:hover { box-shadow: 0 10px 26px var(--shadow); border-color: var(--pri-l2); }

.nlist { list-style: none; padding: 0; margin: 0; }
.nlist li { border-bottom: 1px dashed var(--line); }
.nlist a { display: flex; gap: 12px; align-items: center; padding: 12px 2px; color: var(--ink); flex-wrap: wrap; }
.nlist a:hover { color: var(--pri); }
.nlist time { color: var(--muted); font-size: 14px; min-width: 96px; font-variant-numeric: tabular-nums; }
.news-list { display: grid; gap: 16px; }
.news-row { display: grid; grid-template-columns: 200px 1fr; gap: 20px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); }
.news-row:not(:has(img)) { grid-template-columns: 1fr; }
.news-row img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.news-row h3 { font-size: 19px; margin: 4px 0; } .news-row p { color: var(--muted); margin: 0; font-size: 15px; }
.news-row:hover { border-color: var(--pri); }
.prevnext { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 40px; padding-top: 18px; font-size: 15px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chips a { padding: 5px 16px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink); font-size: 14.5px; }
.chips a.on, .chips a:hover { background: var(--pri); color: #fff; border-color: var(--pri); }
.filters { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
select, input, textarea { font: inherit; border: 1px solid #cfd6e1; border-radius: 10px; padding: 9px 12px; background: #fff; color: var(--ink); width: 100%; }
.filters select { width: auto; }
input:focus, textarea:focus, select:focus { outline: 3px solid var(--pri-l2); border-color: var(--pri); }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.pager a { padding: 6px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); }
.pager a.on { background: var(--pri); color: #fff; border-color: var(--pri); }

.sidebox { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; position: sticky; top: 130px; }
.sidebox h4 { margin-bottom: 10px; }
.sidebox > a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); }
.sidebox > a.on, .sidebox > a:hover { background: #fff; color: var(--pri); font-weight: 600; }
.sidebox.info > div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sidebox.info span { display: block; color: var(--muted); font-size: 13px; }
.gallery .thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery .thumbs img { aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .8; }
.gallery .thumbs img:hover { opacity: 1; }
.gallery #gmain { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.ptitle { font-size: 30px; }
.spec { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15px; }
.spec caption { text-align: left; font-weight: 700; margin-bottom: 6px; }
.spec th { width: 34%; background: var(--bg2); text-align: left; font-weight: 600; }
.spec th, .spec td { border: 1px solid var(--line); padding: 8px 12px; }
.dl-list { padding-left: 0; list-style: none; } .dl-list li { padding: 6px 0; }
.dl-table { width: 100%; border-collapse: collapse; }
.dl-table th, .dl-table td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.dl-table th { font-size: 14px; color: var(--muted); }

.course-list { display: grid; gap: 16px; }
.course { display: grid; grid-template-columns: 90px 1fr; gap: 20px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); }
.course:hover { border-color: var(--pri); box-shadow: 0 8px 20px var(--shadow); }
.cdate { background: var(--pri); color: #fff; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 90px; }
.cdate b { font-size: 24px; line-height: 1.1; } .cdate span { font-size: 13px; opacity: .85; }
.course h3 { margin: 0 0 4px; font-size: 19px; } .course p { margin: 6px 0; color: var(--muted); font-size: 15px; }

.formbox { background: var(--bg2); border-radius: var(--r); padding: 28px; margin-top: 40px; }
.two .formbox { margin-top: 0; }
.form label { display: block; margin-bottom: 14px; font-size: 14.5px; font-weight: 600; }
.form label input, .form label textarea, .form label select { margin-top: 4px; font-weight: 400; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form .chk { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.form .chk input { width: 18px; height: 18px; margin-top: 4px; flex-shrink: 0; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: var(--pri-l); }
.alert.ok { background: #e6f4ea; color: #155d2b; } .alert.warn { background: #fff4e0; color: #8a5300; } .alert.err { background: #fdecea; color: #a32a1d; }
.contact-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 20px 0; }
.contact-cards.one { grid-template-columns: 1fr; }
.contact-cards > div { background: var(--bg2); border-radius: 12px; padding: 16px; }
.contact-cards span { font-size: 22px; margin-right: 6px; }
.contact-cards > div { border-left: 3px solid var(--pri); }
.contact-cards p { margin: 4px 0 0; color: #444851; }
.map iframe { width: 100%; height: 440px; border: 0; border-radius: var(--r); }
.bigsearch { display: flex; gap: 10px; margin-bottom: 20px; }
.cta { background: var(--pri); color: #fff; padding: 54px 0; position: relative; overflow: hidden; }
.cta::after { content: ""; position: absolute; right: -80px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: rgba(255,255,255,.08); }
.cta .wrap { position: relative; z-index: 1; }
.cta .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.cta h2 { margin: 0; }

/* 頁尾 */
.ft { background: var(--bg2); color: var(--muted); padding: 54px 0 0; margin-top: 0; font-size: 14.5px; border-top: 4px solid var(--pri); }
.ft a { color: #3a3f48; }
.ft a:hover { color: var(--pri); }
.ft h4 { color: var(--ink); }
.ft h4::after { content: ""; display: block; width: 28px; height: 3px; background: var(--pri); border-radius: 3px; margin-top: 6px; }
.ft-grid { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr; gap: 36px; }
.ft-logo { font-size: 20px; color: var(--ink); font-weight: 700; margin-bottom: 8px; }
.ft-logo img { height: 44px; width: auto; }
.ft-links { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.social { display: flex; gap: 14px; flex-wrap: wrap; }
.copy { border-top: 1px solid var(--line); margin-top: 36px; padding: 18px 0; text-align: center; font-size: 13px; color: var(--muted); background: #fff; }
.totop { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; background: var(--pri); color: #fff; display: flex;
  align-items: center; justify-content: center; font-size: 20px; opacity: 0; pointer-events: none; transition: .3s; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.scrolled .totop { opacity: 1; pointer-events: auto; }

@media (max-width: 1080px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; flex-direction: column; padding: 10px 16px 18px; box-shadow: 0 12px 24px rgba(0,0,0,.1); }
  .nav.open { display: flex; }
  .nav a { padding: 11px 8px; border-bottom: 1px solid var(--line); }
  .nav a.on::after { display: none; }
  .nav-row { position: relative; }
}
@media (max-width: 860px) {
  .two, .side, .side.left { grid-template-columns: 1fr; gap: 28px; }
  .sidebox { position: static; }
  .svc-row { grid-template-columns: 1fr; padding: 0 0 18px; } .svc-row > div { padding: 0 18px; }
  .news-row { grid-template-columns: 1fr; }
  .ft-grid { grid-template-columns: 1fr; }
  .fgrid, .contact-cards { grid-template-columns: 1fr; }
  .hide-m { display: none; }
  .sec { padding: 44px 0; }
  .hsearch input { width: 120px; }
}
/* Quill 2 清單格式 */
.rich li[data-list="bullet"] { list-style-type: disc; }
.rich li[data-list="ordered"] { list-style-type: decimal; }
.rich .ql-ui { display: none; }
.rich .ql-size-small { font-size: .85em; } .rich .ql-size-large { font-size: 1.3em; }
.rich .ql-video { width: 100%; aspect-ratio: 16/9; }

/* 區塊標題紅色小線 */
.sec-h h2::after { content: ""; display: block; width: 40px; height: 4px; background: var(--pri); border-radius: 4px; margin-top: 8px; }
.kicker { color: var(--pri); }
.spec th { background: var(--pri-l); }
.formbox { border: 1px solid var(--line); }
@media (max-width: 860px) { .slide::before { background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.92) 70%); } .slide { align-items: flex-end; padding-bottom: 60px; } }

/* ===== 首頁廣告動畫（主廣告輪播） ===== */
.hero { position: relative; overflow: hidden; background: var(--pri-l); }
.hero.h-large { height: clamp(360px, 64vh, 680px); }
.hero.h-full { height: calc(100vh - 116px); min-height: 420px; }
.hero.h-medium { height: clamp(280px, 44vh, 480px); }
.hero.fit { width: 100%; max-height: 82vh; }
.hs { position: absolute; inset: 0; display: flex; align-items: center; visibility: hidden; z-index: 1; }
.hs.on { visibility: visible; z-index: 2; }
.hs.leave { visibility: visible; z-index: 1; }
.hs .hm { position: absolute; inset: 0; width: 100%; height: 100%; }
.hs .hm img, .hs video.hm { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero.fit .hs .hm img, .hero.fit .hs video.hm { object-fit: contain; background: #fff; }
.hs .yt { overflow: hidden; pointer-events: none; }
.hs .yt iframe { position: absolute; top: 50%; left: 50%; width: 177.78vh; height: 56.25vw; min-width: 100%; min-height: 100%; transform: translate(-50%, -50%); border: 0; }
.hs-link { position: absolute; inset: 0; z-index: 3; }
.hs.ov-light::before, .hs.ov-dark::before { content: ""; position: absolute; inset: 0; z-index: 1; }
.hs.ov-light::before { background: linear-gradient(90deg, rgba(255,255,255,.94) 0%, rgba(255,255,255,.78) 40%, rgba(255,255,255,0) 72%); }
.hs.ov-dark::before { background: linear-gradient(90deg, rgba(10,10,12,.72), rgba(10,10,12,.15) 75%); }
.hs.dflt { background: radial-gradient(circle at 85% 30%, var(--pri-l2), transparent 45%), linear-gradient(135deg, #fff, var(--pri-l)); }
.hs-txt { position: relative; z-index: 4; color: var(--ink); }
.ov-dark .hs-txt { color: #fff; }
.ov-dark .hs-txt p { color: rgba(255,255,255,.9); }
.hs-txt h2 { font-size: clamp(28px, 4.8vw, 56px); margin-bottom: 10px; max-width: 760px; }
.hs-txt h2::before { content: ""; display: block; width: 64px; height: 5px; background: var(--pri); border-radius: 5px; margin-bottom: 18px; }
.hs-txt p { font-size: clamp(16px, 2vw, 22px); color: #4a4f58; max-width: 640px; }
.hs-txt .btn { margin-top: 12px; box-shadow: 0 8px 20px var(--shadow); }
/* 轉場 */
.hs.tr-fade, .hs.tr-zoom, .hs.tr-kenburns { opacity: 0; transition: opacity 1s ease, visibility 0s 1s; }
.hs.tr-fade.on, .hs.tr-zoom.on, .hs.tr-kenburns.on { opacity: 1; transition: opacity 1s ease; }
.hs.tr-zoom .hm { transform: scale(1.12); transition: transform 1.4s cubic-bezier(.2,.7,.2,1); }
.hs.tr-zoom.on .hm { transform: scale(1); }
.hs.tr-kenburns.on .hm { animation: kenburns var(--dur, 8s) linear forwards; }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.15) translate(-2%, -1%); } }
.hs.tr-slide { transform: translateX(100%); transition: transform .9s cubic-bezier(.7,0,.3,1), visibility 0s .9s; }
.hs.tr-slide.on { transform: translateX(0); transition: transform .9s cubic-bezier(.7,0,.3,1); }
.hs.tr-slide.leave { transform: translateX(-100%); }
.hero.back .hs.tr-slide:not(.on):not(.leave) { transform: translateX(-100%); }
.hero.back .hs.tr-slide.leave { transform: translateX(100%); }
.hs.tr-none { transition: none; }
/* 文字依序進場 */
.hs .a1, .hs .a2, .hs .a3 { opacity: 0; }
.hs.on .a1, .hs.on .a2, .hs.on .a3 { animation: .9s cubic-bezier(.2,.7,.2,1) forwards; }
.hs.on .a1 { animation-delay: .35s; } .hs.on .a2 { animation-delay: .6s; } .hs.on .a3 { animation-delay: .85s; }
.ta-up.on .a1, .ta-up.on .a2, .ta-up.on .a3 { animation-name: inUp; }
.ta-left.on .a1, .ta-left.on .a2, .ta-left.on .a3 { animation-name: inLeft; }
.ta-zoom.on .a1, .ta-zoom.on .a2, .ta-zoom.on .a3 { animation-name: inZoom; }
.ta-none .a1, .ta-none .a2, .ta-none .a3 { opacity: 1; animation: none !important; }
@keyframes inUp { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
@keyframes inLeft { from { opacity: 0; transform: translateX(-60px); } to { opacity: 1; transform: none; } }
@keyframes inZoom { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.harr { position: absolute; top: 50%; transform: translateY(-50%); z-index: 6; width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.85); color: var(--pri); font-size: 30px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.12); opacity: 0; transition: .3s; }
.hero:hover .harr { opacity: 1; }
.harr.prev { left: 18px; } .harr.next { right: 18px; }
.harr:hover { background: var(--pri); color: #fff; }
.hero .dots { z-index: 6; }
.hprog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 6; background: rgba(0,0,0,.05); }
.hprog i { display: block; height: 100%; width: 0; background: var(--pri); }
.dots { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }

/* 跑馬燈 */
.marquee { background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,.03); }
.mq-in { display: flex; align-items: center; gap: 14px; height: 48px; }
.mq-label { background: var(--pri); color: #fff; font-weight: 700; font-size: 14px; padding: 4px 14px; border-radius: 99px; white-space: nowrap; }
.mq-view { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.mq-track { display: inline-flex; gap: 48px; white-space: nowrap; animation: mq var(--mq-speed, 40s) linear infinite; }
.mq-view:hover .mq-track { animation-play-state: paused; }
.mq-track a, .mq-track span { color: var(--ink); font-size: 15px; }
.mq-track a:hover { color: var(--pri); }
.mq-track time { color: var(--pri); margin-right: 8px; font-size: 13px; }
@keyframes mq { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* 中段橫幅廣告 */
.mid-ad { padding: 40px 0 0; }
.mid-track { position: relative; border-radius: var(--r); overflow: hidden; aspect-ratio: 1200 / 300; background: var(--pri-l); box-shadow: 0 10px 30px var(--shadow); }
.mid-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .9s; display: block; color: #fff; }
.mid-slide.on { opacity: 1; z-index: 1; }
.mid-slide .hm { position: absolute; inset: 0; width: 100%; height: 100%; }
.mid-slide .hm img, .mid-slide video.hm { width: 100%; height: 100%; object-fit: cover; display: block; }
.mid-cap { position: absolute; left: 0; bottom: 0; right: 0; padding: 18px 24px; background: linear-gradient(0deg, rgba(0,0,0,.55), transparent); }
.mid-cap b { display: block; font-size: 22px; }
.mid-track .dots { bottom: 10px; z-index: 3; }

/* 產品滾動輪播 */
.pscroll { position: relative; }
.pview { overflow: hidden; }
.ptrack { display: flex; gap: 22px; transition: transform .6s cubic-bezier(.4,0,.2,1); }
.pitem { flex: 0 0 calc((100% - 66px) / 4); }
.pitem .card { height: 100%; }
.pa { position: absolute; top: 38%; z-index: 3; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--pri);
  font-size: 26px; cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.pa.prev { left: -20px; } .pa.next { right: -20px; }
.pa:hover { background: var(--pri); color: #fff; }

/* 合作夥伴 Logo 牆 */
.partners { padding-bottom: 50px; }
.logo-wall { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.lw-track { display: inline-flex; gap: 26px; animation: mq 40s linear infinite; padding: 6px 0; }
.logo-wall:hover .lw-track { animation-play-state: paused; }
.lw-item { flex: 0 0 auto; width: 180px; height: 90px; border: 1px solid var(--line); border-radius: 12px; background: #fff; display: flex; align-items: center;
  justify-content: center; padding: 12px; color: var(--ink); filter: grayscale(1); opacity: .75; transition: .3s; }
.lw-item:hover { filter: none; opacity: 1; border-color: var(--pri-l2); box-shadow: 0 6px 16px var(--shadow); }
.lw-item img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* 彈出式廣告 */
.popad { position: fixed; inset: 0; z-index: 200; background: rgba(20,20,24,.55); display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadeIn .3s; }
.popad[hidden] { display: none; }
.pop-box { position: relative; background: #fff; border-radius: 16px; overflow: hidden; width: min(560px, 100%); max-height: 92vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.3); animation: popIn .45s cubic-bezier(.2,.9,.3,1.2); border-top: 5px solid var(--pri); }
.pop-box .hm { display: block; position: relative; }
.pop-box .hm img, .pop-box video.hm { width: 100%; display: block; }
.pop-box .yt { aspect-ratio: 16/9; position: relative; } .pop-box .yt iframe { width: 100%; height: 100%; border: 0; }
.pop-txt { padding: 16px 20px 4px; } .pop-txt b { font-size: 20px; } .pop-txt p { margin: 6px 0 12px; color: var(--muted); }
.pop-x { position: absolute; top: 10px; right: 10px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); cursor: pointer;
  font-size: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.pop-x:hover { background: var(--pri); color: #fff; }
.pop-no { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 10px 16px; font-size: 13px; color: var(--muted); cursor: pointer; }
.pop-no input { width: auto; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(30px) scale(.92); } }

/* 側邊浮動廣告 */
.side-ads { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.side-ad { position: relative; width: 104px; background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); overflow: hidden; border-top: 3px solid var(--pri);
  animation: sideIn .6s cubic-bezier(.2,.9,.3,1.1) both; }
.side-ad:nth-child(2) { animation-delay: .15s; } .side-ad:nth-child(3) { animation-delay: .3s; }
.side-ad a { display: block; color: var(--ink); text-align: center; }
.side-ad img { width: 100%; display: block; }
.side-ad span { display: block; padding: 6px 8px 8px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.side-ad span b { display: block; color: var(--pri); font-size: 13px; }
.sa-x { position: absolute; top: 2px; right: 2px; z-index: 2; border: 0; background: rgba(255,255,255,.9); width: 20px; height: 20px; border-radius: 50%; font-size: 11px; cursor: pointer; }
@keyframes sideIn { from { opacity: 0; transform: translateX(140px); } }
@media (prefers-reduced-motion: reduce) {
  .hs, .hs .hm, .mq-track, .lw-track, .ptrack { transition: none !important; animation: none !important; }
  .hs .a1, .hs .a2, .hs .a3 { opacity: 1; }
}
@media (max-width: 1080px) { .pitem { flex-basis: calc((100% - 44px) / 3); } }
@media (max-width: 860px) {
  .hs.ov-light::before { background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,.92) 70%); }
  .hs { align-items: flex-end; padding-bottom: 56px; }
  .hero.fit .hs { padding-bottom: 0; }
  .harr { display: none; }
  .pitem { flex-basis: calc((100% - 22px) / 2); }
  .pa.prev { left: -6px; } .pa.next { right: -6px; }
  .mid-track { aspect-ratio: 16 / 7; }
  .side-ads { top: auto; bottom: 74px; transform: none; right: 10px; }
  .side-ad { width: 64px; border-radius: 10px; border-top-width: 2px; }
  .side-ad span { display: none; }
  .side-ads { gap: 8px; }
  .side-ad span { display: none; }
  .mq-label { display: none; }
}
