:root{
  /* 科技島 — 深海藍 + 白 + 胡蘿蔔暖點（logo 藍主調） */
  --deep:#040a14;
  --ocean:#08172b;
  --blue:#1271c8;
  --blue2:#2e9bff;
  --cyan:#8fd4ff;
  --jade:#a9c8e8;
  --carrot:#ff8a2a;
  --warm:#f2f6fb;
  --muted:#8aa4c2;

  /* accent driven by agent state */
  --accent:#5cc4ff;
  --accent-soft:rgba(92,196,255,.16);
  --glass:rgba(10,24,44,.55);
  --line:rgba(150,195,240,.16);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth; background:var(--deep)}
body{
  margin:0;
  min-height:100vh;
  font-family:Inter,"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;
  color:#eaf6ff;
  background:var(--deep);
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

/* ---------- background ---------- */
.bg{position:fixed; inset:0; z-index:0; pointer-events:none; overflow:hidden}
.bg-aurora{
  position:absolute; inset:-20% -10%;
  background:
    radial-gradient(42% 52% at 72% 18%, rgba(46,155,255,.30), transparent 70%),
    radial-gradient(38% 46% at 20% 80%, rgba(18,113,200,.22), transparent 70%),
    radial-gradient(46% 50% at 50% 52%, rgba(92,196,255,.14), transparent 70%),
    linear-gradient(155deg,#040a14 0%,#071427 46%,#0a1c33 100%);
  filter:saturate(1.08);
  animation:drift 24s ease-in-out infinite alternate;
}
@keyframes drift{from{transform:translate3d(-1.5%,-1%,0) scale(1.02)}to{transform:translate3d(2%,1.5%,0) scale(1.08)}}
.bg-grid{
  position:absolute; inset:0; opacity:.30;
  background-image:
    linear-gradient(rgba(160,220,255,.05) 1px,transparent 1px),
    linear-gradient(90deg,rgba(160,220,255,.05) 1px,transparent 1px);
  background-size:46px 46px;
  mask-image:radial-gradient(circle at 50% 42%,black,transparent 72%);
}
.bg-vignette{position:absolute; inset:0; background:radial-gradient(circle at 50% 40%,transparent 52%,rgba(2,8,16,.7) 100%)}

/* ---------- topbar ---------- */
.topbar{
  position:relative; z-index:6;
  width:min(1200px,calc(100% - 48px)); margin:0 auto; padding:22px 0;
  display:flex; align-items:center; justify-content:space-between;
}
.brand{display:flex; align-items:center; gap:13px; text-decoration:none; color:#fff}
.brand img{width:42px; height:42px; object-fit:cover; border-radius:11px}
.brand b{display:block; font-size:16px; letter-spacing:.03em}
.brand small{display:block; color:var(--muted); font-size:11px; letter-spacing:.14em; text-transform:uppercase; margin-top:3px}
.topbar-right{display:flex; align-items:center; gap:10px}
.sound-toggle{
  display:grid; place-items:center; width:38px; height:38px; border-radius:50%; cursor:pointer;
  border:1px solid var(--line); background:rgba(255,255,255,.04); color:#cfeaff; transition:.2s ease;
}
.sound-toggle:hover{background:rgba(255,255,255,.1)}
.sound-toggle .ic-off{display:none}
.sound-toggle[aria-pressed="false"]{color:#7d97ad}
.sound-toggle[aria-pressed="false"] .ic-on{display:none}
.sound-toggle[aria-pressed="false"] .ic-off{display:block}
.sound-toggle{position:relative}
.hist-count{
  position:absolute; top:-4px; right:-4px; min-width:16px; height:16px; padding:0 4px;
  display:grid; place-items:center; font-size:10px; font-weight:800; line-height:1;
  color:#04130f; background:var(--carrot); border-radius:999px;
}
.hist-count[hidden]{display:none}
.online{display:flex; align-items:center; gap:8px; font-size:13px; color:#cfeaff; padding:8px 14px; border-radius:999px; border:1px solid var(--line); background:rgba(255,255,255,.04)}

/* ---------- 提問紀錄抽屜 ---------- */
.hist-scrim{position:fixed; inset:0; z-index:40; background:rgba(2,12,10,.5); backdrop-filter:blur(2px); animation:fade .25s ease}
.history{
  position:fixed; top:0; right:0; z-index:41; height:100vh; width:min(380px,90vw);
  display:flex; flex-direction:column;
  background:linear-gradient(180deg,#06231d,#041713);
  border-left:1px solid var(--line); box-shadow:-30px 0 90px rgba(0,0,0,.5);
  transform:translateX(100%); transition:transform .32s cubic-bezier(.2,.7,.2,1);
}
.history.open{transform:none}
.history-head{display:flex; align-items:center; justify-content:space-between; padding:20px 20px 14px; border-bottom:1px solid var(--line)}
.history-head strong{font-size:16px; letter-spacing:.04em}
.history-head-btns{display:flex; align-items:center; gap:6px}
.hist-clear{cursor:pointer; font-size:12px; color:var(--muted); background:transparent; border:1px solid var(--line); border-radius:999px; padding:6px 11px; transition:.2s}
.hist-clear:hover{color:#ffd2a6; border-color:var(--carrot)}
.hist-x{cursor:pointer; width:34px; height:34px; border-radius:50%; border:1px solid var(--line); background:rgba(255,255,255,.04); color:#fff; font-size:20px}
.hist-x:hover{background:rgba(255,255,255,.1)}
.history-list{list-style:none; margin:0; padding:10px; overflow:auto; flex:1}
.history-list li{margin:0 0 8px}
.history-item{
  width:100%; text-align:left; cursor:pointer; display:block;
  background:rgba(255,255,255,.04); border:1px solid var(--line); border-radius:14px; padding:12px 14px; transition:.18s ease;
}
.history-item:hover{background:rgba(92,196,255,.1); border-color:var(--accent); transform:translateX(-3px)}
.history-item .q{display:block; color:#eafff7; font-size:14px; line-height:1.5; margin-bottom:6px; word-break:break-word}
.history-item .meta{display:flex; align-items:center; gap:8px; font-size:11px; color:var(--muted)}
.history-item .tag{padding:2px 8px; border-radius:999px; background:rgba(92,196,255,.12); color:#bfe0ff; border:1px solid rgba(92,196,255,.2)}
.history-item .tag.out{background:rgba(255,138,42,.12); color:#ffc093; border-color:rgba(255,138,42,.22)}
.history-empty{padding:30px 24px; color:var(--muted); font-size:13px; line-height:1.7; text-align:center}
.online i{width:8px; height:8px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 0 var(--accent); animation:beacon 2.4s ease-out infinite}
@keyframes beacon{0%{box-shadow:0 0 0 0 var(--accent-soft)}70%{box-shadow:0 0 0 8px transparent}100%{box-shadow:0 0 0 0 transparent}}

/* ---------- nav ---------- */
.nav{display:flex; gap:6px; align-items:center}
.nav a{color:#cfeaff; text-decoration:none; font-size:14px; padding:9px 13px; border-radius:999px; border:1px solid transparent; transition:.2s}
.nav a:hover{background:rgba(255,255,255,.06); border-color:var(--line)}

/* ---------- hero（大 Agent 嵌入） ---------- */
main{position:relative; z-index:5}
.hero{
  width:min(1200px,calc(100% - 48px)); margin:0 auto;
  min-height:calc(100vh - 120px);
  display:grid; grid-template-columns:0.92fr 1.08fr; gap:clamp(24px,4vw,56px);
  align-items:center; padding:18px 0 40px;
}
.hero-copy .eyebrow{color:var(--jade); letter-spacing:.18em; text-transform:uppercase; font-size:12px; font-weight:700; margin:0 0 16px}
.hero-copy h1{font-size:clamp(38px,5vw,64px); line-height:1.05; letter-spacing:-.04em; margin:0; color:#fff}
.hero-copy .lead{font-size:16.5px; line-height:1.85; color:#cfe7df; margin:24px 0 0; max-width:560px}
.hero-actions{display:flex; gap:12px; flex-wrap:wrap; margin:28px 0 0}
.status-strip{display:flex; gap:8px; flex-wrap:wrap; margin-top:24px}
.status-strip span{font-size:12px; color:#bfe6da; padding:8px 12px; border:1px solid var(--line); background:rgba(255,255,255,.03); border-radius:999px}
.agent-card{display:flex; flex-direction:column; gap:16px; min-width:0}

/* ---------- stage / orb ---------- */
.stage{display:flex; flex-direction:column; align-items:center; gap:18px; text-align:center}
.orb-wrap{
  position:relative; width:clamp(200px,32vh,320px); aspect-ratio:1;
  display:grid; place-items:center;
  animation:breathe 6s ease-in-out infinite;
}
body[data-mode="thinking"] .orb-wrap{animation-duration:2.4s}
body[data-mode="listening"] .orb-wrap{animation-duration:3s}
@keyframes breathe{0%,100%{transform:scale(1)}50%{transform:scale(1.035)}}
#voiceCanvas{width:100%; height:100%; display:block}
.orb-ring{
  position:absolute; inset:-6%; border-radius:50%;
  border:1px solid var(--accent-soft);
  box-shadow:0 0 60px var(--accent-soft), inset 0 0 50px var(--accent-soft);
  opacity:.55; transition:.5s ease;
}
body[data-mode="thinking"] .orb-ring{animation:spin 6s linear infinite; border-style:dashed; border-color:rgba(255,138,42,.4)}
@keyframes spin{to{transform:rotate(360deg)}}

.stage-label{display:flex; flex-direction:column; align-items:center; gap:5px}
.stage-label small{color:var(--jade); letter-spacing:.2em; text-transform:uppercase; font-size:10.5px; font-weight:700; margin-bottom:2px}
.stage-label .dot{width:7px; height:7px; border-radius:50%; background:var(--accent); box-shadow:0 0 14px var(--accent); transition:.4s}
.stage-label strong{font-size:18px; letter-spacing:.04em; color:#fff; transition:.3s}
.stage-label em{font-style:normal; font-size:13px; color:var(--muted); letter-spacing:.02em}

/* ---------- console ---------- */
.console{
  width:100%;
  background:var(--glass);
  border:1px solid var(--line);
  border-radius:26px;
  padding:18px;
  box-shadow:0 30px 90px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
.reply{
  color:#eaf6ff; line-height:1.75; font-size:16px;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.08);
  border-left:3px solid var(--accent);
  border-radius:16px; padding:16px 18px; min-height:60px;
  transition:border-color .4s ease;
}
.reply.fresh{animation:replyIn .45s ease both}
@keyframes replyIn{from{opacity:0; transform:translateY(8px)}to{opacity:1; transform:none}}
.reply .caret{display:inline-block; width:.5ch; animation:blink 1s steps(1) infinite; color:var(--accent)}
@keyframes blink{50%{opacity:0}}

.chips{display:flex; gap:8px; flex-wrap:wrap; margin:14px 2px}
.chips button{
  cursor:pointer; font-size:13px; color:#d7f1ff;
  background:rgba(51,167,255,.08); border:1px solid rgba(134,233,255,.2);
  border-radius:999px; padding:8px 13px; transition:.2s ease;
}
.chips button:hover{background:rgba(51,167,255,.2); border-color:var(--accent); transform:translateY(-1px)}

.ask{
  display:flex; align-items:center; gap:8px;
  background:rgba(2,10,20,.55); border:1px solid rgba(255,255,255,.12);
  border-radius:999px; padding:7px 7px 7px 16px; transition:.25s ease;
}
.ask:focus-within{border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft)}
.ask-glyph{color:var(--accent); font-size:18px; flex:0 0 auto; transition:.3s}
.ask input{
  flex:1 1 auto; min-width:0; border:0; outline:0; background:transparent;
  color:#fff; font-size:15px; padding:8px 0;
}
.ask input::placeholder{color:#6f8aa3}
.icon-btn,.send-btn{
  flex:0 0 auto; display:grid; place-items:center; cursor:pointer;
  width:44px; height:44px; border-radius:50%; border:0; transition:.2s ease;
}
.icon-btn{background:rgba(255,255,255,.08); color:#cfeaff}
.icon-btn:hover{background:rgba(255,255,255,.16)}
.icon-btn.listening{background:var(--carrot); color:#1a0e04; animation:pulse 1s infinite}
.send-btn{background:linear-gradient(135deg,var(--blue2),#6fc4ff); color:#021326}
.send-btn:hover{transform:scale(1.06)}
@keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.1)}}

.footnote{margin:14px 4px 2px; font-size:11.5px; color:#7d97ad; letter-spacing:.02em; text-align:center; line-height:1.6}

/* ---------- 留資表單 ---------- */
.lead-open{
  display:block; width:100%; margin-top:12px; cursor:pointer;
  background:rgba(92,196,255,.1); border:1px solid var(--accent-soft); color:var(--cyan);
  border-radius:14px; padding:11px 14px; font:inherit; font-size:13.5px; transition:.2s ease;
}
.lead-open:hover{background:rgba(92,196,255,.18); border-color:var(--accent)}
.lead-open[hidden]{display:none}

.lead-form{
  margin-top:14px; padding:16px; border-radius:18px;
  background:rgba(92,196,255,.06); border:1px solid var(--accent-soft);
  animation:replyIn .35s ease both;
}
.lead-form[hidden]{display:none}
.lead-title{margin:0 0 12px; font-size:14px; color:#eaf6ff; font-weight:600}
.lead-fields{display:grid; grid-template-columns:1fr 1fr; gap:8px}
.lead-fields input{
  min-width:0; border:1px solid rgba(255,255,255,.12); background:rgba(2,10,20,.5);
  color:#fff; border-radius:11px; padding:11px 13px; font:inherit; font-size:14px; outline:none; transition:.2s;
}
.lead-fields input:focus{border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft)}
.lead-fields input::placeholder{color:#6f8aa3}
.lead-error{margin:10px 2px 0; font-size:12.5px; color:#ff9b8a}
.lead-error[hidden]{display:none}
.lead-actions{display:flex; gap:8px; margin-top:12px}
.lead-actions .primary{flex:0 0 auto; padding:10px 22px}
.lead-actions .ghost{flex:0 0 auto; padding:10px 16px}
.lead-done{
  margin-top:14px; padding:14px 16px; border-radius:16px; text-align:center;
  background:rgba(92,196,255,.08); border:1px solid var(--accent-soft); color:#dff0ff; font-size:14px;
}
.lead-done[hidden]{display:none}
@media (max-width:480px){ .lead-fields{grid-template-columns:1fr} }

/* 留資 modal */
.lead-modal{
  width:min(440px,100%); position:relative; border-radius:26px; padding:30px 28px 26px;
  background:linear-gradient(150deg,#081326,#0c1f3a);
  border:1px solid rgba(120,175,235,.22);
  box-shadow:0 40px 130px rgba(0,0,0,.6);
  animation:rise .35s cubic-bezier(.2,.7,.2,1) both;
}
.lead-kicker{color:var(--jade); letter-spacing:.18em; text-transform:uppercase; font-size:11px; font-weight:700; margin:0 0 10px}
#leadModalTitle{margin:0 0 8px; font-size:21px; line-height:1.35; color:#fff; letter-spacing:-.01em}
.lead-modal-sub{margin:0 0 18px; font-size:13.5px; color:var(--muted); line-height:1.6}
.lead-modal .lead-form{margin:0; padding:0; background:none; border:0; animation:none}

/* ---------- 內容區塊 ---------- */
.section{width:min(1080px,calc(100% - 48px)); margin:0 auto; padding:clamp(48px,9vh,96px) 0}
.section .eyebrow{color:var(--jade); letter-spacing:.18em; text-transform:uppercase; font-size:12px; font-weight:700; margin:0 0 12px}
.section h2{font-size:clamp(28px,3.6vw,44px); line-height:1.15; letter-spacing:-.03em; margin:0; color:#fff}
.section-head{text-align:center; margin-bottom:34px}
.section-sub{color:var(--muted); margin:14px 0 0; font-size:15px}

.service-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:14px}
.service-card{
  text-align:left; cursor:pointer; min-height:210px; padding:24px; border-radius:24px;
  background:linear-gradient(150deg,rgba(255,255,255,.07),rgba(255,255,255,.025));
  border:1px solid var(--line); transition:.24s ease; position:relative; overflow:hidden; color:inherit; font:inherit;
}
.service-card:before{content:""; position:absolute; inset:-70px -70px auto auto; width:140px; height:140px; border-radius:50%; background:radial-gradient(circle,var(--accent-soft),transparent 70%)}
.service-card:hover{transform:translateY(-6px); border-color:var(--accent); box-shadow:0 22px 60px rgba(0,0,0,.3)}
.service-card .icon{display:inline-grid; place-items:center; width:42px; height:42px; border-radius:13px; background:rgba(92,196,255,.14); color:var(--jade); margin-bottom:26px; font-size:20px}
.service-card h3{font-size:20px; margin:0 0 9px; color:#fff}
.service-card p{font-size:14px; color:#a9c6bd; line-height:1.7; margin:0}

.method{display:grid; grid-template-columns:.95fr 1.05fr; gap:clamp(28px,4vw,52px); align-items:center}
.method-visual{min-height:300px; border:1px solid var(--line); border-radius:28px; background:radial-gradient(circle at 50% 50%,var(--accent-soft),transparent 48%),rgba(255,255,255,.03); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; padding:28px}
.flow-node{min-width:210px; text-align:center; padding:13px 18px; border-radius:16px; background:rgba(255,255,255,.06); border:1px solid var(--line); color:#e3f8ff; font-size:14.5px}
.flow-node.core{background:linear-gradient(135deg,rgba(46,155,255,.4),rgba(92,196,255,.22)); border-color:var(--accent); color:#fff; font-weight:700}
.flow-line{height:30px; width:1px; background:linear-gradient(transparent,var(--accent),transparent)}
.method-copy h2{margin-bottom:16px}
.method-copy p{color:#bcd9cf; line-height:1.85; font-size:16px; margin:0 0 22px}

.contact{text-align:center; max-width:760px}
.contact p{color:#bcd9cf; line-height:1.8; font-size:16px; margin:14px 0 26px}

.site-footer{text-align:center; color:var(--muted); font-size:12.5px; line-height:2; padding:30px 24px 44px; border-top:1px solid var(--line); margin-top:30px}
.site-footer a{color:var(--cyan); text-decoration:none}
.site-footer a:hover{text-decoration:underline}

/* ---------- state theming (accent swap) ---------- */
body[data-mode="thinking"]{--accent:#ff8a2a; --accent-soft:rgba(255,138,42,.18)}
body[data-mode="listening"]{--accent:#8fd4ff; --accent-soft:rgba(143,212,255,.18)}
body[data-mode="answering"]{--accent:#2e9bff; --accent-soft:rgba(46,155,255,.20)}
body[data-mode="error"]{--accent:#ff6b6b; --accent-soft:rgba(255,107,107,.18)}

/* ---------- modal ---------- */
.modal-backdrop{
  position:fixed; inset:0; z-index:50; display:none; padding:22px;
  align-items:center; justify-content:center;
  background:rgba(2,9,18,.74); backdrop-filter:blur(14px);
}
.modal-backdrop.show{display:flex; animation:fade .3s ease}
@keyframes fade{from{opacity:0}to{opacity:1}}
.modal{
  width:min(960px,100%); max-height:calc(100vh - 44px); overflow:auto;
  display:grid; grid-template-columns:.92fr 1.08fr;
  border-radius:30px; position:relative;
  background:linear-gradient(150deg,#081326,#0c1f3a);
  border:1px solid rgba(120,175,235,.20);
  box-shadow:0 40px 130px rgba(0,0,0,.6);
  animation:rise .35s cubic-bezier(.2,.7,.2,1) both;
}
@keyframes rise{0%{opacity:0; transform:translateY(26px) scale(.92)}55%{opacity:1; transform:translateY(-4px) scale(1.025,.975)}75%{transform:scale(.99,1.012)}90%{transform:scale(1.004,.997)}100%{opacity:1; transform:none}}
.modal-close{
  position:absolute; top:14px; right:14px; z-index:3;
  width:42px; height:42px; border-radius:50%; cursor:pointer; font-size:22px;
  border:1px solid rgba(255,255,255,.18); background:rgba(0,0,0,.3); color:#fff;
}
.modal-close:hover{background:rgba(255,255,255,.14)}
.modal-image{
  min-height:380px; padding:30px; display:grid; place-items:center;
  background:radial-gradient(circle at 42% 36%,rgba(46,155,255,.22),transparent 46%),rgba(255,255,255,.03);
}
.modal-image svg{width:100%; max-width:340px; height:auto; filter:drop-shadow(0 24px 60px rgba(0,0,0,.4))}
.modal-content{padding:48px 44px 40px}
.modal-content .kicker{color:var(--jade); letter-spacing:.18em; text-transform:uppercase; font-size:11px; font-weight:700; margin:0 0 12px}
.modal-content h2{font-size:clamp(26px,3.4vw,34px); margin:0 0 14px; letter-spacing:-.03em; line-height:1.15}
.modal-content p{color:#d3e8f6; line-height:1.8; margin:0; font-size:15.5px}
.modal-content ul{padding:0; margin:22px 0; list-style:none; display:grid; gap:9px}
.modal-content li{color:#e8f7ff; font-size:14.5px; padding:11px 14px; border-radius:13px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.08)}
.modal-content li:before{content:"↳"; color:var(--carrot); margin-right:8px}
.modal-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:22px}
.modal-actions a.primary{text-decoration:none; display:inline-flex; align-items:center}
.modal-actions a.primary[hidden]{display:none}
.primary,.ghost{border:0; border-radius:999px; padding:12px 20px; cursor:pointer; font:inherit; transition:.22s ease}
.primary{background:linear-gradient(135deg,var(--carrot),#ffbf68); color:#15100b; font-weight:800; box-shadow:0 14px 40px rgba(255,138,42,.24)}
.primary:hover{transform:translateY(-2px); box-shadow:0 18px 54px rgba(255,138,42,.32)}
.ghost{background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.16); color:#e9f7ff}
.ghost:hover{background:rgba(255,255,255,.14)}

/* ---------- responsive ---------- */
@media (max-width:980px){
  .hero{grid-template-columns:1fr; min-height:0; gap:30px; padding:8px 0 30px}
  .hero-copy{text-align:center}
  .hero-copy .lead{margin-left:auto; margin-right:auto}
  .hero-actions,.status-strip{justify-content:center}
  .agent-card{max-width:640px; margin:0 auto; width:100%}
  .service-grid{grid-template-columns:1fr 1fr}
  .method{grid-template-columns:1fr}
}
@media (max-width:720px){
  /* 手機版只留語言切換，其他導覽收起（英文是預設首頁，中文／日文訪客要能切過去） */
  .nav{gap:2px}
  .nav a:not(.lang-link){display:none}
  .nav a.lang-link{padding:6px 8px; font-size:12px; white-space:nowrap}
  .brand small{display:none}
  .modal{grid-template-columns:1fr}
  .modal-image{min-height:220px}
  .modal-content{padding:30px 22px}
}
@media (max-width:560px){
  .service-grid{grid-template-columns:1fr}
  .hero-copy h1{font-size:34px}
}
@media (max-width:420px){
  .topbar{width:calc(100% - 28px)}
}
@media (prefers-reduced-motion:reduce){
  .bg-aurora,.orb-wrap,.orb-ring,.online i{animation:none !important}
}

/* ---------- 首次訪問：詢問要不要開聲音 ---------- */
.sound-ask{
  position:fixed; z-index:40; top:84px; right:max(16px, calc((100vw - 1200px) / 2));
  width:min(320px, calc(100vw - 32px)); padding:18px 18px 16px; border-radius:18px;
  background:linear-gradient(150deg,#081326,#0c1f3a); border:1px solid rgba(120,175,235,.22);
  box-shadow:0 24px 70px rgba(0,0,0,.55); color:var(--warm);
  opacity:0; transform:translateY(-8px); transition:opacity .25s ease, transform .25s ease;
}
.sound-ask.show{opacity:1; transform:none}
.sound-ask-title{margin:0 0 6px; font-size:16px; font-weight:700; color:#fff}
.sound-ask-sub{margin:0 0 14px; font-size:13px; line-height:1.6; color:var(--muted)}
.sound-ask-actions{display:flex; gap:10px}
.sound-ask-actions button{
  flex:1; padding:9px 12px; border-radius:999px; font:inherit; font-size:14px; cursor:pointer;
  border:1px solid var(--line); background:rgba(255,255,255,.04); color:var(--warm);
}
.sound-ask-actions .sound-ask-yes{background:var(--carrot); border-color:var(--carrot); color:#1a0d02; font-weight:700}
.sound-ask-actions button:hover{filter:brightness(1.08)}
.sound-ask-actions button:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
@media (max-width:560px){ .sound-ask{top:auto; bottom:16px; right:16px; left:16px; width:auto} }
@media (prefers-reduced-motion:reduce){ .sound-ask{transition:none} }

/* ============================================================
   手機版版面（三種語言共用）：讓 GI 顧問的對話框出現在第一個畫面，
   服務卡改成 2×2、說明段落收短，捲過對話框後右下角出現「問 GI」按鈕
   ============================================================ */
@media (max-width:720px){
  /* 首屏：標題縮小，介紹段落、標籤、次要按鈕收起（顧問的開場白已經介紹公司） */
  .topbar{padding:12px 0}
  .hero{gap:10px; padding:0 0 18px}
  .hero-copy .eyebrow{font-size:10px; letter-spacing:.14em; margin:0 0 8px}
  .hero-copy h1{font-size:24px; line-height:1.15; letter-spacing:-.02em}
  .hero-copy h1 br{display:none}
  .hero-copy .lead,.status-strip,.hero-actions{display:none}

  /* 顧問：球縮小、狀態文字排成一行 */
  .agent-card{gap:10px}
  .stage{gap:6px}
  .orb-wrap{width:clamp(96px,15vh,140px)}
  .stage-label{flex-direction:row; flex-wrap:wrap; justify-content:center; gap:6px 8px}
  .stage-label small{margin:0}
  .stage-label strong{font-size:15px}
  .stage-label em{display:none}

  /* 對話框 */
  .console{padding:12px; border-radius:20px}
  .reply{font-size:15px; line-height:1.65; padding:12px 14px; max-height:42vh; overflow-y:auto}
  .chips{flex-wrap:nowrap; overflow-x:auto; margin:10px -12px; padding:0 12px; scrollbar-width:none; -webkit-overflow-scrolling:touch}
  .chips::-webkit-scrollbar{display:none}
  .chips::after{content:""; flex:0 0 4px}   /* 最後一顆後面留點空，捲到底不會貼邊 */
  .console .chips{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent); mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent)}   /* 右邊淡出，看得出還能往右滑 */
  .chips button{flex:0 0 auto; white-space:nowrap}
  .ask input{font-size:16px} /* 16px 以上 iOS 點輸入框才不會自動放大畫面 */

  /* 區塊間距 */
  .section{padding:40px 0}
  .section-head{margin-bottom:18px}
  .section h2{font-size:23px}
  .section-sub{font-size:13.5px}

  /* 服務卡：2×2，只留圖示與標題，點了打開完整介紹 */
  .service-grid{grid-template-columns:1fr 1fr; gap:10px}
  .service-card{padding:16px 14px; min-height:0; text-align:left}
  .service-card .icon{width:34px; height:34px; font-size:16px; margin-bottom:10px; border-radius:10px}
  .service-card h3{font-size:15px; margin:0}
  .service-card p{display:none}

  /* 方法：拿掉流程圖 */
  .method-visual{display:none}
  .method-copy p{font-size:15px; line-height:1.75}

  .contact p{font-size:15px}
}

/* 捲過對話框後出現的「問 GI」按鈕（只在手機） */
.ask-fab{
  position:fixed; right:16px; bottom:calc(16px + env(safe-area-inset-bottom)); z-index:30;
  display:none; align-items:center; gap:8px; padding:12px 16px; border-radius:999px;
  background:var(--carrot); color:#1a0d02; font:inherit; font-size:14px; font-weight:700;
  border:0; box-shadow:0 12px 30px rgba(0,0,0,.45); cursor:pointer;
  opacity:0; transform:translateY(10px); transition:opacity .2s ease, transform .2s ease;
}
.ask-fab.show{opacity:1; transform:none}
@media (max-width:720px){ .ask-fab{display:inline-flex} }
@media (prefers-reduced-motion:reduce){ .ask-fab{transition:none} }

/* ============================================================
   聊天模式（送出第一句後）：一問一答的泡泡。
   電腦：留在原位、對話框拉高可捲動；手機：展開成全螢幕聊天視窗。
   ============================================================ */
.chat-head{display:none}
.console.chatting{position:relative}   /* 讓老電視的掃描線蓋在對話框上 */
.chat-log{
  display:flex; flex-direction:column; gap:10px;
  overflow-y:auto; overscroll-behavior:contain;
  padding:2px 2px 4px; scrollbar-width:thin;
}
.console.chatting .chat-log{height:min(52vh,460px)}   /* 固定高度：對話變長只捲中間，不把整頁往下擠 */
.chat-log > *{flex-shrink:0}   /* 不然對話一長，泡泡會被壓扁、文字溢出疊到下一則 */
.console.chatting .chat-log .reply{
  align-self:flex-start; max-width:92%; min-height:0; max-height:none; overflow:visible;
  border-radius:18px 18px 18px 6px; padding:12px 15px; white-space:pre-wrap; word-break:break-word;
}
.bubble.user{
  align-self:flex-end; max-width:85%;
  background:linear-gradient(135deg,var(--blue),#2e9bff); color:#fff;
  padding:10px 14px; border-radius:18px 18px 6px 18px;
  font-size:15px; line-height:1.6; white-space:pre-wrap; word-break:break-word;
  animation:replyIn .3s ease both;
}
.chat-avatar{
  width:34px; height:34px; border-radius:50%; flex:0 0 auto;
  background:radial-gradient(circle, #fff 0 13%, var(--accent) 30%, rgba(92,196,255,.16) 60%, transparent 72%);
  box-shadow:0 0 18px var(--accent-soft); animation:breathe 3s ease-in-out infinite; transition:background .4s;
}
body[data-mode="thinking"] .chat-avatar{animation-duration:.9s}
.chat-title{flex:1 1 auto; min-width:0; display:flex; flex-direction:column; line-height:1.3}
.chat-title strong{color:#fff; font-size:15px}
.chat-title small{color:var(--muted); font-size:12px}
.chat-close{
  flex:0 0 auto; width:40px; height:40px; border-radius:50%; cursor:pointer;
  border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.06); color:#fff; font-size:22px; line-height:1;
}
@media (max-width:720px){
  .console.chatting .chat-log{height:42vh}
  body.chat-full{overflow:hidden}
  body.chat-full main{z-index:45}        /* 蓋過頂端列和浮動按鈕，但留在展示／留資視窗（z-index 50）底下 */
  body.chat-full .ask-fab{display:none}
  body.chat-full .console{
    position:fixed; left:0; right:0; top:0; height:100vh; height:100dvh; z-index:45;
    display:flex; flex-direction:column;
    border:0; border-radius:0; box-shadow:none;
    padding:0 12px calc(10px + env(safe-area-inset-bottom));
    background:linear-gradient(180deg,#071a33 0%,#040a14 100%);
    backdrop-filter:none; -webkit-backdrop-filter:none;
  }
  body.chat-full .chat-head{
    display:flex; align-items:center; gap:10px; flex:0 0 auto;
    margin:0 -12px; padding:calc(10px + env(safe-area-inset-top)) 10px 10px 14px;
    border-bottom:1px solid var(--line); background:rgba(4,10,20,.6);
  }
  body.chat-full .console.chatting .chat-log{flex:1 1 auto; height:auto; min-height:0; padding:14px 2px 8px}
  body.chat-full .chips{flex:0 0 auto; flex-wrap:wrap; overflow:visible; margin:4px 0 10px; padding:0; -webkit-mask-image:none; mask-image:none}   /* 全螢幕空間夠，選項換行，不會被切到 */
  body.chat-full .chips button{white-space:normal; text-align:left}
  body.chat-full .ask{flex:0 0 auto}
  body.chat-full .lead-open,body.chat-full .lead-done{flex:0 0 auto; margin-top:8px}
}

/* ============================================================
   果凍效果：按下去會壓扁再彈回來；泡泡、按鈕、視窗出現時帶一點彈性
   ============================================================ */
@keyframes jelly{
  0%{transform:scale(1,1)}
  25%{transform:scale(1.14,.86)}
  40%{transform:scale(.9,1.1)}
  55%{transform:scale(1.06,.94)}
  70%{transform:scale(.97,1.03)}
  85%{transform:scale(1.015,.985)}
  100%{transform:scale(1,1)}
}
.jelly{animation:jelly .6s cubic-bezier(.3,.7,.4,1) both !important}
.service-card:hover .icon{animation:jelly .7s ease both}

/* 泡泡：從角落彈出來 */
@keyframes popUser{
  0%{opacity:0; transform:translate(12px,14px) scale(.4)}
  55%{opacity:1; transform:scale(1.08,.94)}
  72%{transform:scale(.96,1.04)}
  86%{transform:scale(1.02,.98)}
  100%{opacity:1; transform:none}
}
@keyframes popAgent{
  0%{opacity:0; transform:translate(-10px,14px) scale(.55)}
  55%{opacity:1; transform:scale(1.04,.96)}
  72%{transform:scale(.98,1.02)}
  86%{transform:scale(1.01,.99)}
  100%{opacity:1; transform:none}
}
.bubble.user{animation:popUser .55s cubic-bezier(.3,.8,.4,1) both; transform-origin:100% 100%}
.console.chatting .chat-log .reply.fresh{animation:popAgent .55s cubic-bezier(.3,.8,.4,1) both; transform-origin:0 100%}
.chat-log .restored{animation:none !important}

/* 浮動按鈕出現時彈一下 */
@keyframes popIn{0%{transform:scale(.3)}55%{transform:scale(1.15,.9)}75%{transform:scale(.95,1.05)}100%{transform:none}}
.ask-fab.show{animation:popIn .55s cubic-bezier(.3,.8,.4,1) both}

/* 進入聊天：sci-fi 掃描轉場（角框鎖定＋掃描光束＋全像網格） */
.console.chatting{overflow:hidden}
.fx-frame{
  position:fixed; z-index:61; pointer-events:none; --c:rgba(143,212,255,.95); --l:22px;
  background:
    linear-gradient(var(--c),var(--c)) top left/var(--l) 2px, linear-gradient(var(--c),var(--c)) top left/2px var(--l),
    linear-gradient(var(--c),var(--c)) top right/var(--l) 2px, linear-gradient(var(--c),var(--c)) top right/2px var(--l),
    linear-gradient(var(--c),var(--c)) bottom left/var(--l) 2px, linear-gradient(var(--c),var(--c)) bottom left/2px var(--l),
    linear-gradient(var(--c),var(--c)) bottom right/var(--l) 2px, linear-gradient(var(--c),var(--c)) bottom right/2px var(--l);
  background-repeat:no-repeat;
  outline:1px solid rgba(143,212,255,.12); outline-offset:-1px;
  filter:drop-shadow(0 0 6px rgba(92,196,255,.7));
}
.fx-beam{
  position:fixed; left:0; right:0; top:0; height:2px; z-index:62; pointer-events:none;
  background:linear-gradient(90deg, transparent, rgba(143,212,255,.9) 18%, #fff 50%, rgba(143,212,255,.9) 82%, transparent);
  box-shadow:0 0 14px 2px rgba(92,196,255,.85), 0 0 40px 6px rgba(46,155,255,.35);
}
.fx-beam::before{
  content:""; position:absolute; left:0; right:0; bottom:2px; height:110px;
  background:linear-gradient(to top, rgba(92,196,255,.22), rgba(92,196,255,.06) 45%, transparent);
}
.fx-beam.up::before{bottom:auto; top:2px; background:linear-gradient(to bottom, rgba(92,196,255,.22), rgba(92,196,255,.06) 45%, transparent)}
.fx-beam.local{position:absolute; z-index:6}
.fx-grid{
  position:absolute; inset:0; z-index:5; pointer-events:none;
  background:
    linear-gradient(rgba(92,196,255,.12) 1px, transparent 1px) 0 0/100% 22px,
    linear-gradient(90deg, rgba(92,196,255,.12) 1px, transparent 1px) 0 0/22px 100%;
  -webkit-mask-image:radial-gradient(ellipse at 50% 40%, #000 30%, transparent 85%);
          mask-image:radial-gradient(ellipse at 50% 40%, #000 30%, transparent 85%);
  animation:gridFade 1.2s ease-out both;
}
@keyframes gridFade{0%{opacity:0}25%{opacity:1}100%{opacity:0}}
@keyframes headDrop{0%{opacity:0; transform:translateY(-18px)}60%{opacity:1; transform:translateY(3px)}100%{opacity:1; transform:none}}
@media (max-width:720px){
  body.chat-full .chat-head{animation:headDrop .5s .28s cubic-bezier(.3,.8,.4,1) both}
}

@media (prefers-reduced-motion:reduce){
  .jelly,.bubble.user,.console.chatting .chat-log .reply.fresh,.ask-fab.show,.service-card:hover .icon,body.chat-full .chat-head{animation:none !important}
  .fx-frame,.fx-beam,.fx-grid{display:none}
}
