/* =========================================================
   環點科技 UIT — 前台樣式
   色彩取自 Logo：橘 #F08300、紅 #CF000E、炭灰 #3E3A39
   ========================================================= */
:root {
  --orange: #f08300;
  --orange-600: #d97400;
  --orange-050: #fff4e6;
  --red: #cf000e;
  --ink: #3e3a39;
  --ink-soft: #595757;
  --muted: #847b77;
  --bg: #fffbf6;
  --surface: #ffffff;
  --surface-2: #fdf3e7;
  --line: #f0e3d4;
  --shadow: 0 1px 2px rgba(62, 58, 57, .06), 0 8px 24px rgba(62, 58, 57, .07);
  --shadow-lg: 0 2px 6px rgba(62, 58, 57, .08), 0 24px 60px rgba(62, 58, 57, .14);
  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --art-dark: #2b2726;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-display: "Nunito", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --orange: #ff9a2e; --orange-600: #ffad55; --orange-050: #33251a; --red: #ff4b53;
    --ink: #f6efe8; --ink-soft: #ddd2c8; --muted: #b0a59c;
    --bg: #171413; --surface: #211d1b; --surface-2: #2a2421; --line: #3a322d; --art-dark: #4d4440;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.4), 0 24px 60px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --orange: #ff9a2e; --orange-600: #ffad55; --orange-050: #33251a; --red: #ff4b53;
  --ink: #f6efe8; --ink-soft: #ddd2c8; --muted: #b0a59c;
  --bg: #171413; --surface: #211d1b; --surface-2: #2a2421; --line: #3a322d; --art-dark: #4d4440;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.4), 0 24px 60px rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.8 var(--font); letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--orange); }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5em; letter-spacing: .03em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 1.5em; border-radius: 999px; border: 2px solid transparent;
  font: 700 15px/1 var(--font); letter-spacing: .06em; cursor: pointer;
  transition: transform .2s, background-color .2s, color .2s, box-shadow .2s, border-color .2s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 6px 18px rgba(240, 131, 0, .35); }
.btn-primary:hover { background: var(--orange-600); color: #fff; transform: translateY(-2px); }
.btn-ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn-ghost:hover { border-color: var(--orange); color: var(--orange); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-dark:hover { color: var(--bg); transform: translateY(-2px); }
.btn-sm { min-height: 38px; padding: 0 1.1em; font-size: 14px; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }

/* ---------- 頁首 ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  border-bottom: 1px solid transparent; transition: border-color .3s, box-shadow .3s;
}
/* 毛玻璃放在偽元素上：若直接加在 header，會讓手機選單的 position: fixed 改以 header 為基準而跑版 */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 20px rgba(62,58,57,.05); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 76px; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { height: 46px; width: auto; }
:root[data-theme="dark"] .brand img, :root[data-theme="dark"] .footer-brand img { filter: brightness(1.6) saturate(1.1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img, :root:not([data-theme="light"]) .footer-brand img { filter: brightness(1.6) saturate(1.1); } }
.nav { margin-left: auto; }
.nav > ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav li { position: relative; }
.nav > ul > li > a {
  display: flex; align-items: center; gap: 4px; padding: 10px 16px; border-radius: 999px;
  font-weight: 500; font-size: 15px;
}
.nav > ul > li > a.is-active { color: var(--orange); background: var(--orange-050); }
.nav .chev { width: 14px; height: 14px; opacity: .6; transition: transform .2s; }
.nav .sub {
  position: absolute; top: calc(100% + 6px); left: 50%; translate: -50% 0; min-width: 200px;
  list-style: none; margin: 0; padding: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  /* 滑鼠離開後先停留 0.4 秒再收合，避免移動稍慢或稍微偏離時選單就消失 */
  transition: opacity .2s .4s, transform .2s .4s, visibility 0s .6s;
}
/* 透明的「橋」：填滿主選單與子選單之間的空隙，讓滑鼠慢慢移動也不會中斷 */
.nav .sub::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.nav li:hover > .sub, .nav li:focus-within > .sub { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; z-index: 2; }
.nav li:hover .chev { transform: rotate(180deg); }
.nav .sub a { display: block; padding: 9px 14px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.nav .sub a:hover { background: var(--orange-050); }
.header-cta { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { color: var(--orange); border-color: var(--orange); }
.menu-toggle { display: none; }
.nav .mobile-cta { display: none; }

@media (max-width: 960px) {
  .menu-toggle { display: inline-grid; }
  .header-cta { margin-left: auto; }
  .header-cta .btn { display: none; }
  .menu-toggle[aria-expanded="true"] { background: var(--orange); border-color: var(--orange); color: #fff; }

  /* 手機選單：從頁首下方展開的整頁面板，項目做成與網站一致的圓角卡片 */
  .nav {
    position: fixed; inset: 76px 0 0; z-index: 49; margin: 0;
    padding: 20px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px));
    background: radial-gradient(circle at 110% 105%, var(--orange-050), transparent 45%), var(--bg);
    overflow-y: auto; overscroll-behavior: contain;
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity .25s, transform .25s, visibility 0s .25s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .25s; }
  .nav > ul { flex-direction: column; gap: 10px; }
  .nav > ul > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; }
  .nav > ul > li > a { padding: 13px 14px; font-size: 17px; font-weight: 700; border-radius: 9px; }
  .nav > ul > li > a::before { content: ""; width: 8px; height: 8px; margin-right: 6px; border-radius: 50% 50% 50% 0; background: var(--line); flex-shrink: 0; }
  .nav > ul > li > a.is-active { background: var(--orange-050); }
  .nav > ul > li > a.is-active::before { background: var(--orange); }
  .nav .chev { display: none; }
  .nav .sub {
    position: static; translate: none; opacity: 1; visibility: visible; transform: none; transition: none;
    min-width: 0; box-shadow: none; border: 0; border-top: 1px dashed var(--line); border-radius: 0;
    background: none; padding: 8px 6px 6px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  }
  .nav .sub::before { display: none; }
  .nav .sub a { padding: 10px 12px; font-size: 15px; white-space: normal; background: var(--bg); border-radius: 9px; line-height: 1.4; }
  .nav .sub a:hover, .nav .sub a:focus-visible { background: var(--orange-050); color: var(--orange); }
  .nav .mobile-cta { display: grid; gap: 10px; margin-top: 20px; }
  .nav .mobile-cta .btn { width: 100%; justify-content: center; }
  body.menu-open { overflow: hidden; }
  body.menu-open .chat-fab { opacity: 0; visibility: hidden; pointer-events: none; }
}
@media (max-width: 360px) { .nav .sub { grid-template-columns: 1fr; } }

/* ---------- 共用區塊 ---------- */
.section { padding-block: clamp(64px, 9vw, 120px); }
.section-alt { background: var(--surface-2); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font: 800 13px/1 var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: var(--orange);
}
.eyebrow::before { content: ""; width: 14px; height: 14px; background: var(--drop) center/contain no-repeat; }
/* Logo 中「i」的點（對話泡泡造型），作為全站與 AI 顧問的識別符號 */
:root { --drop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='4 3.5 47.5 40'%3E%3Cpath fill='%23f08300' d='M22.7,7.19A18.71,18.71,0,1,1,40.84,39.91c-9,5-35.69-1.61-35.69-1.61S13.67,12.2,22.7,7.19Z'/%3E%3C/svg%3E"); }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { text-align: center; margin-inline: auto; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 900; }
.section-head p { color: var(--muted); font-size: 17px; }
.section-head.split { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.section-head.split > div { max-width: 640px; }
.section.pt-0 { padding-top: 0; }
.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 3vw, 32px); box-shadow: var(--shadow);
}
.more-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--orange); }
.more-link svg { width: 16px; height: 16px; transition: transform .2s; }
.more-link:hover svg { transform: translateX(4px); }
.tag {
  display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px;
  background: var(--orange-050); color: var(--orange-600); font-size: 13px; font-weight: 700; letter-spacing: .04em;
}
.tag-soft { background: var(--surface-2); color: var(--ink-soft); font-weight: 500; }

/* ---------- 首頁 Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(48px, 7vw, 96px) clamp(64px, 9vw, 120px); }
.hero-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.hero-bg .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.hero-bg .b1 { width: 520px; height: 520px; background: #ffd7a8; right: -120px; top: -160px; }
.hero-bg .b2 { width: 380px; height: 380px; background: #ffe6c7; left: -140px; bottom: -120px; }
:root[data-theme="dark"] .hero-bg .blob { opacity: .14; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero-bg .blob { opacity: .14; } }
.hero-letters {
  position: absolute; right: -2vw; bottom: -6vw; font: 900 clamp(160px, 28vw, 420px)/1 var(--font-display);
  letter-spacing: -.04em; color: transparent; -webkit-text-stroke: 2px var(--line); user-select: none;
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(38px, 6.2vw, 72px); font-weight: 900; line-height: 1.18; letter-spacing: .02em; margin-bottom: 24px; }
.hero h1 .accent { color: var(--orange); }
.hero h1 .dot { color: var(--red); }
.hero-lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-soft); max-width: 34em; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 44px); }
.hero-meta div { display: flex; flex-direction: column; }
.hero-meta strong { font: 900 clamp(28px, 3.4vw, 40px)/1.1 var(--font-display); color: var(--ink); }
.hero-meta strong small { font-size: .5em; margin-left: 2px; color: var(--orange); }
.hero-meta span { font-size: 14px; color: var(--muted); }
@media (max-width: 960px) { .hero-inner { grid-template-columns: 1fr; } }

/* AI 預覽卡 */
.ai-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: 28px; box-shadow: var(--shadow-lg); padding: 22px; isolation: isolate;
}
.ai-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; z-index: -1;
  background: linear-gradient(140deg, var(--orange), transparent 40%, transparent 60%, var(--red));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.ai-card-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px dashed var(--line); margin-bottom: 16px; }
.ai-avatar {
  width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--drop) center/contain no-repeat; color: #fff;
}
.ai-avatar svg { width: 18px; height: 18px; margin: -2px 0 0 4px; }
.ai-card-head strong { display: block; font-size: 16px; }
.ai-card-head span { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #2bb673; box-shadow: 0 0 0 3px rgba(43,182,115,.2); }
.bubble { max-width: 88%; padding: 12px 16px; border-radius: 18px; font-size: 15px; line-height: 1.7; margin-bottom: 10px; }
.bubble.me { margin-left: auto; background: var(--orange); color: #fff; border-bottom-right-radius: 6px; }
.bubble.bot { background: var(--surface-2); border-bottom-left-radius: 6px; }
.typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-ask { display: flex; gap: 8px; margin-top: 16px; }
.ai-ask input {
  flex: 1; min-width: 0; height: 50px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 15px;
}
.ai-ask input:focus { outline: none; border-color: var(--orange); }
.ai-ask button { width: 50px; height: 50px; padding: 0; border-radius: 50%; flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-soft); font: inherit; font-size: 13px; cursor: pointer; transition: .2s;
}
.chip:hover { border-color: var(--orange); color: var(--orange); }

/* ---------- 服務 ---------- */
.service-card { position: relative; display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s, border-color .25s; }
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--orange) 40%, var(--line)); color: inherit; }
.service-icon {
  width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 20px;
  background: var(--orange-050); color: var(--orange);
}
.service-icon svg { width: 30px; height: 30px; }
.service-card h3 { font-size: 20px; font-weight: 900; }
.service-card p { color: var(--muted); font-size: 15px; flex: 1; }
.service-num { position: absolute; top: 22px; right: 26px; font: 900 15px/1 var(--font-display); color: var(--line); letter-spacing: .1em; }

/* 流程 */
.process { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.process li { position: relative; padding: 26px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.process li::before {
  counter-increment: step; content: "0" counter(step); display: block; margin-bottom: 14px;
  font: 900 34px/1 var(--font-display); color: var(--orange);
}
.process li:not(:last-child)::after {
  content: ""; position: absolute; top: 40px; right: -13px; width: 10px; height: 10px; z-index: 1;
  border-top: 2.5px solid var(--orange); border-right: 2.5px solid var(--orange); transform: rotate(45deg);
}
.process h3 { font-size: 18px; margin-bottom: 6px; }
.process p { font-size: 14px; color: var(--muted); margin: 0; }
@media (max-width: 960px) {
  .process { grid-template-columns: 1fr 1fr; }
  .process li::after { display: none; }
}
@media (max-width: 520px) { .process { grid-template-columns: 1fr; } }

/* ---------- 案例卡 ---------- */
.case-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; transition: transform .25s, box-shadow .25s; }
.case-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); color: inherit; }
.case-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.case-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.case-card:hover .case-thumb img { transform: scale(1.05); }
.case-thumb .tag { position: absolute; left: 14px; top: 14px; background: var(--surface); box-shadow: var(--shadow); }
.case-thumb-empty { display: grid; place-items: center; height: 100%; font: 900 44px var(--font-display); color: var(--line); }
.case-body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.case-client { font-size: 13px; color: var(--orange); font-weight: 700; letter-spacing: .08em; }
.case-body h3 { font-size: 19px; margin: 0; }
.case-body p { color: var(--muted); font-size: 14px; margin: 4px 0 8px; flex: 1; }
.tech { display: flex; flex-wrap: wrap; gap: 6px; }
.tech span { font: 700 12px/1 var(--font-display); padding: 6px 10px; border-radius: 8px; background: var(--surface-2); color: var(--ink-soft); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filters button {
  padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  font: 500 15px var(--font); color: var(--ink-soft); cursor: pointer; transition: .2s;
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.filters button:hover:not([aria-pressed="true"]) { border-color: var(--orange); color: var(--orange); }

/* ---------- 消息 ---------- */
.news-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.news-row { display: grid; grid-template-columns: 120px 90px 1fr 24px; align-items: center; gap: 20px; padding: 22px 8px; border-bottom: 1px solid var(--line); transition: background .2s; }
.news-row:hover { background: var(--surface); color: inherit; }
.news-row time { font: 800 15px var(--font-display); color: var(--muted); }
.news-row h3 { font-size: 17px; margin: 0; font-weight: 500; }
.news-row svg { width: 18px; height: 18px; color: var(--orange); }
@media (max-width: 640px) {
  .news-row { grid-template-columns: auto 1fr; gap: 6px 12px; }
  .news-row h3 { grid-column: 1 / -1; }
  .news-row svg { display: none; }
}
.news-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; transition: transform .25s, box-shadow .25s; }
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: inherit; }
.news-cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--orange-050), var(--surface-2)); overflow: hidden; display: grid; place-items: center; }
.news-cover img { width: 100%; height: 100%; object-fit: cover; }
.news-cover .ph { width: 64px; height: 64px; background: var(--drop) center/contain no-repeat; opacity: .5; }
.news-card .body { padding: 20px 24px 24px; }
.news-card .meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.news-card h3 { font-size: 18px; }
.news-card p { color: var(--muted); font-size: 14px; margin: 0; }

.pager { display: flex; justify-content: center; gap: 6px; margin-top: 40px; }
.pager a, .pager span { min-width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); font-weight: 700; }
.pager .current { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ---------- 內頁標題 ---------- */
.page-hero { position: relative; overflow: hidden; padding-block: clamp(48px, 7vw, 88px) clamp(40px, 5vw, 64px); background: var(--surface-2); }
.page-hero::after {
  content: ""; position: absolute; right: clamp(-80px, -4vw, -20px); top: 50%; translate: 0 -50%;
  width: clamp(180px, 26vw, 340px); aspect-ratio: 1; background: var(--drop) center/contain no-repeat; opacity: .12;
}
.page-hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 900; margin: 0; position: relative; z-index: 1; }
.page-hero p { color: var(--muted); font-size: 17px; margin: 12px 0 0; max-width: 40em; position: relative; z-index: 1; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 12px; list-style: none; padding: 0; position: relative; z-index: 1; }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 28px; position: relative; z-index: 1; }
.subnav a { padding: 8px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.subnav a.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- 文章 / 長文 ---------- */
.prose { font-size: 17px; line-height: 1.95; color: var(--ink-soft); max-width: 760px; }
.prose h2 { font-size: 24px; color: var(--ink); margin-top: 1.6em; }
.prose h3 { font-size: 20px; color: var(--ink); margin-top: 1.4em; }
.prose a { color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }
.prose ul { padding-left: 1.3em; }
.prose strong { color: var(--ink); }
.article-head { max-width: 760px; margin-bottom: 32px; }
.article-head h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 900; }
.article-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 36px; max-width: 760px; }
.article-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font: 800 15px var(--font-display); margin-bottom: 12px; }
.case-detail { display: grid; grid-template-columns: 1fr 380px; gap: clamp(24px, 4vw, 48px); align-items: start; }
.case-detail .article-cover { max-width: none; box-shadow: var(--shadow-lg); }
.case-detail aside { position: sticky; top: 100px; }
@media (max-width: 900px) { .case-detail { grid-template-columns: 1fr; } .case-detail aside { position: static; } }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.check-list li { position: relative; padding-left: 26px; color: var(--ink-soft); }
.check-list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 14px; background: var(--drop) center/contain no-repeat; }
.svc-text { color: var(--ink-soft); }

/* ---------- 服務頁 ---------- */
.svc-card { position: relative; display: flex; flex-direction: column; gap: 4px; transition: transform .25s, box-shadow .25s, border-color .25s; }
.svc-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--orange) 40%, var(--line)); color: inherit; }
.svc-card .eyebrow { margin: 0; }
.svc-card h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 900; margin: 0; }
.svc-card p { color: var(--muted); flex: 1; }
.svc-card .tech { margin-bottom: 18px; }
.svc-intro { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 860px) { .svc-intro { grid-template-columns: 1fr; } }
.svc-title { font-size: clamp(24px, 3vw, 32px); font-weight: 900; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 18px; align-items: flex-start; padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.steps b { font: 900 26px/1 var(--font-display); color: var(--orange); min-width: 40px; }
.steps h3 { font-size: 17px; margin-bottom: 4px; }
.steps p { font-size: 14px; color: var(--muted); margin: 0; }
.svc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(40px, 6vw, 64px); }
.svc-pager a { display: flex; flex-direction: column; padding: 20px 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-weight: 900; font-size: 18px; }
.svc-pager a.next { text-align: right; }
.svc-pager small { font-size: 13px; color: var(--muted); font-weight: 500; }
.svc-pager a:hover { border-color: var(--orange); }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.point { padding: 20px 22px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.point h3 { font-size: 16px; display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.point h3::before { content: ""; width: 10px; height: 10px; background: var(--drop) center/contain no-repeat; flex-shrink: 0; }
.point p { font-size: 14px; color: var(--muted); margin: 0; }
@media (max-width: 860px) { .svc-block { grid-template-columns: 1fr; } .svc-block aside { position: static; } }

.plan-card { display: flex; gap: 18px; align-items: flex-start; }
.plan-card .service-icon { margin: 0; flex-shrink: 0; width: 52px; height: 52px; border-radius: 16px; }
.plan-card .service-icon svg { width: 26px; height: 26px; }
.plan-card h3 { font-size: 18px; margin-bottom: 4px; }
.plan-card p { font-size: 14px; color: var(--muted); margin: 0; }

/* ---------- 沿革 ---------- */
.timeline-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 40px; position: sticky; top: 76px; z-index: 5; padding-block: 12px; background: var(--bg); }
.timeline-nav a { font: 800 14px var(--font-display); padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.timeline-nav a:hover { border-color: var(--orange); }
.year { display: grid; grid-template-columns: 180px 1fr; gap: 32px; padding-block: 36px; border-top: 1px solid var(--line); scroll-margin-top: 150px; }
.year h2 { font: 900 clamp(40px, 5vw, 56px)/1 var(--font-display); color: var(--orange); position: sticky; top: 150px; align-self: start; }
.year h2 small { display: block; font-size: 14px; color: var(--muted); letter-spacing: .2em; margin-top: 8px; font-family: var(--font); font-weight: 500; }
.events { list-style: none; margin: 0; padding: 0 0 0 28px; border-left: 2px dashed var(--line); }
.events li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 10px 0; }
.events li::before { content: ""; position: absolute; left: -36px; top: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--orange); }
.events .m { font: 800 15px/1.8 var(--font-display); color: var(--ink); }
.events .m.repeat { visibility: hidden; }
@media (max-width: 720px) { .year { grid-template-columns: 1fr; gap: 16px; } .year h2 { position: static; } }

/* ---------- 理念 ---------- */
.value-card h3 { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 900; }
.value-card h3 b { font: 900 14px var(--font-display); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--orange); color: #fff; }
.value-card p { color: var(--muted); font-size: 15px; margin: 0; }
.manifesto { font-size: clamp(22px, 3vw, 32px); font-weight: 900; line-height: 1.6; max-width: 900px; }
.manifesto em { font-style: normal; color: var(--orange); }
.about-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat strong { font: 900 clamp(36px, 4vw, 48px)/1.1 var(--font-display); color: var(--orange); }
.stat strong small { font-size: .45em; margin-left: 2px; color: var(--ink); }
.stat span { color: var(--muted); font-size: 14px; }

/* ---------- 聯絡 ---------- */
.contact-grid { display: grid; grid-template-columns: 360px 1fr; gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 960px) { .contact-grid { grid-template-columns: 1fr; } }
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.info-list li { display: flex; gap: 14px; }
.info-list .service-icon { width: 46px; height: 46px; border-radius: 14px; margin: 0; flex-shrink: 0; }
.info-list .service-icon svg { width: 22px; height: 22px; }
.info-list small { display: block; font-size: 13px; color: var(--muted); }
.info-list strong { font-size: 17px; word-break: break-all; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field label .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 180px; resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 18%, transparent); }
.field .err { color: var(--red); font-size: 13px; margin-top: 4px; }
.field.has-err input, .field.has-err textarea { border-color: var(--red); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--orange); }
.hp { position: absolute; left: -9999px; }
.alert { padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-size: 15px; }
.alert-error { background: color-mix(in srgb, var(--red) 10%, var(--surface)); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }

.ai-brief {
  position: relative; border-radius: var(--radius); padding: 22px; margin-bottom: 24px;
  background: linear-gradient(135deg, var(--orange-050), var(--surface)); border: 1.5px dashed color-mix(in srgb, var(--orange) 45%, var(--line));
}
.ai-brief h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 4px; }
.ai-brief h3 .ai-avatar { width: 32px; height: 32px; }
.ai-brief h3 .ai-avatar svg { width: 13px; height: 13px; }
.ai-brief > p { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.ai-brief textarea { min-height: 96px; }
.ai-brief .row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.ai-brief .status { font-size: 14px; color: var(--muted); }
.brief-out { margin-top: 16px; padding: 18px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.brief-out h4 { margin: 0 0 6px; font-size: 16px; }
.brief-out ul { margin: 6px 0 12px; padding-left: 1.2em; }

/* ---------- CTA ---------- */
.cta {
  position: relative; overflow: hidden; border-radius: 32px; padding: clamp(36px, 6vw, 72px);
  background: var(--ink); color: #fff; display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
}
:root[data-theme="dark"] .cta { background: #2d2624; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cta { background: #2d2624; } }
.cta::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 300px; aspect-ratio: 1; background: var(--drop) center/contain no-repeat; opacity: .9; }
.cta h2 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 900; color: #fff; }
.cta p { color: #d9d0ca; margin: 0; }
.cta .actions { position: relative; z-index: 1; display: flex; gap: 12px; flex-wrap: wrap; }
.cta .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.cta .btn-ghost:hover { border-color: #fff; color: #fff; }
@media (max-width: 760px) { .cta { grid-template-columns: 1fr; } .cta::after { width: 180px; right: -50px; bottom: -60px; opacity: .5; } }

/* ---------- 頁尾 ---------- */
.site-footer { margin-top: clamp(64px, 9vw, 120px); padding-block: 64px calc(32px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand img { height: 52px; width: auto; margin-bottom: 16px; }
.footer-brand p { color: var(--muted); font-size: 14px; }
.site-footer h4 { font-size: 15px; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--muted); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ---------- AI 顧問浮動視窗 ---------- */
.chat-fab {
  position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  width: 68px; height: 68px; border: 0; padding: 0; cursor: pointer; background: none;
  filter: drop-shadow(0 10px 22px rgba(240,131,0,.45)); transition: transform .25s;
}
.chat-fab:hover { transform: scale(1.06) rotate(-4deg); }
.chat-fab .drop { position: absolute; inset: 0; background: var(--drop) center/contain no-repeat; }
.chat-fab svg { position: relative; width: 26px; height: 26px; color: #fff; margin: 2px 0 0 6px; }
.chat-fab .label {
  position: absolute; right: 78px; top: 50%; translate: 0 -50%; white-space: nowrap;
  background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.chat-fab:hover .label, .chat-fab.hint .label { opacity: 1; }
.chat-panel {
  position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(100px + env(safe-area-inset-bottom, 0px)); z-index: 81;
  width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 140px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg);
  transform-origin: bottom right; transition: transform .25s, opacity .25s;
}
.chat-panel[hidden] { display: flex !important; transform: scale(.9) translateY(10px); opacity: 0; pointer-events: none; visibility: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, var(--orange-050), var(--surface)); }
.chat-head strong { display: block; font-size: 16px; }
.chat-head span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.chat-head .icon-btn { margin-left: auto; width: 36px; height: 36px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; scroll-behavior: smooth; }
.chat-log .bubble { font-size: 14.5px; }
.chat-log .bubble p { margin: 0 0 .5em; } .chat-log .bubble p:last-child { margin: 0; }
.chat-log .bubble ul { margin: .3em 0 .5em; padding-left: 1.2em; }
.chat-log .bubble a { color: var(--orange); text-decoration: underline; }
.chat-log .bubble.me a { color: #fff; }
.chat-log .bubble.err { background: color-mix(in srgb, var(--red) 10%, var(--surface)); color: var(--red); }
.chat-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
.chat-foot .chips { margin: 0 0 10px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea {
  flex: 1; min-width: 0; resize: none; max-height: 120px; padding: 12px 16px; border-radius: 22px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.5;
}
.chat-form textarea:focus { outline: none; border-color: var(--orange); }
.chat-form button { width: 46px; height: 46px; min-height: 0; padding: 0; border-radius: 50%; flex-shrink: 0; }
.chat-note { font-size: 11px; color: var(--muted); text-align: center; margin-top: 8px; }
@media (max-width: 520px) {
  .chat-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 100dvh; border-radius: 0; border: 0; }
  body.chat-open .chat-fab { display: none; }
}

/* ---------- 插圖（views/art/*.php） ---------- */
.art { display: block; width: 100%; height: auto; overflow: visible; }
.art .o { fill: var(--orange); } .art .r { fill: var(--red); } .art .k { fill: var(--ink); }
.art .s { fill: var(--orange-050); } .art .w { fill: var(--surface); } .art .b { fill: var(--surface-2); }
.art .l { fill: var(--line); } .art .m { fill: var(--muted); }
.art .d { fill: var(--art-dark); } .art .o2 { fill: #f7a94b; } .art .c1 { fill: #fff4e6; } .art .c2 { fill: #8a807a; }
.art .ln { stroke: var(--line); stroke-width: 2; }
.art .st { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.art .so { stroke: var(--orange); } .art .sk { stroke: var(--ink); } .art .sl { stroke: var(--line); }
.art .sw { stroke: var(--surface); } .art .sr { stroke: var(--red); } .art .sm { stroke: var(--muted); } .art .sd { stroke: var(--art-dark); }
.art .t { fill: var(--muted); font: 800 13px var(--font-display); letter-spacing: .1em; }
.art .ty { fill: var(--ink); font: 900 18px var(--font-display); }
.art .fl, .art .fl2, .art .spin, .art .spin-r, .art .pulse { transform-box: fill-box; transform-origin: center; }
.art .fl { animation: art-float 6s ease-in-out infinite; }
.art .fl2 { animation: art-float 6s ease-in-out -3s infinite; }
.art .spin { animation: art-spin 14s linear infinite; }
.art .spin-r { animation: art-spin 10s linear infinite reverse; }
.art .pulse { animation: art-pulse 3s ease-out infinite; }
.art .flow { stroke-dasharray: 2 10; animation: art-dash 1.2s linear infinite; }
.art .blink { animation: blink 1.1s steps(1) infinite; }
@keyframes art-float { 50% { transform: translateY(-8px); } }
@keyframes art-spin { to { transform: rotate(360deg); } }
@keyframes art-pulse { 0% { transform: scale(.85); opacity: .5; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes art-dash { to { stroke-dashoffset: -12; } }

.page-hero.has-art::after { display: none; }
.page-hero.has-art .wrap { display: grid; grid-template-columns: 1fr minmax(280px, 400px); gap: clamp(24px, 4vw, 56px); align-items: center; }
.page-hero .hero-art { position: relative; z-index: 1; }
@media (max-width: 860px) {
  .page-hero.has-art .wrap { grid-template-columns: 1fr; }
  .page-hero .hero-art { order: -1; width: min(300px, 80%); margin: 0 auto; }
}

/* ---------- 動畫 ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
