/* ===== TriaGeek — 生理監視器風格 ===== */
:root {
  --bg: #04070d;
  --bg-2: #081120;
  --panel: rgba(12, 22, 40, .72);
  --line: rgba(120, 180, 255, .14);
  --line-2: rgba(120, 180, 255, .28);
  --text: #e6eef9;
  --dim: #8496b3;
  --cyan: #3ee6ff;
  --violet: #a77bff;
  --green: #39ff9a;
  --yellow: #ffd23f;
  /* 檢傷五級色 */
  --t1: #ff3b5c;
  --t2: #ff8a3d;
  --t3: #ffd23f;
  --t4: #39d98a;
  --t5: #3d8bff;
  --grad: linear-gradient(100deg, var(--cyan), var(--violet));
  --radius: 14px;
  --font: "Noto Sans TC", system-ui, sans-serif;
  --display: "Chakra Petch", "Noto Sans TC", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
/* 掃描線質感 */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); letter-spacing: .04em; }
.dim { color: var(--dim); }
b { font-weight: 700; }

/* 語言切換：一次只顯示一種 */
.lang-zh .en, .lang-en .zh { display: none !important; }
.lang-en body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans TC", sans-serif; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ===== 狀態列 ===== */
.statusbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  height: 56px; padding: 0 20px;
  background: rgba(4, 7, 13, .78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.sb-brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; letter-spacing: .12em; }
.sb-brand img { width: 40px; height: auto; }
.sb-live { font-family: var(--mono); font-size: 11px; color: var(--t1); display: flex; align-items: center; gap: 6px; }
.sb-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--t1); box-shadow: 0 0 8px var(--t1); animation: blink 1.2s infinite; }
.sb-nav { display: flex; gap: 4px; margin-left: auto; }
.sb-nav a { font-size: 14px; color: var(--dim); padding: 6px 12px; border-radius: 8px; transition: color .2s, background .2s; }
.sb-nav a:hover, .sb-nav a.active { color: var(--text); background: rgba(62, 230, 255, .08); }
.sb-clock { font-size: 13px; color: var(--green); min-width: 70px; text-align: right; }
.lang-toggle {
  background: transparent; color: var(--dim); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px;
}
.lang-toggle .sep { margin: 0 4px; opacity: .4; }
.lang-zh .lang-toggle [data-l="zh"], .lang-en .lang-toggle [data-l="en"] { color: var(--cyan); font-weight: 600; }
.lang-toggle:hover { border-color: var(--cyan); }

@keyframes blink { 50% { opacity: .25; } }

/* ===== Hero ===== */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: 1fr 1.05fr; gap: 48px; align-items: center;
  padding: 96px max(16px, calc((100vw - 1180px) / 2)) 64px;
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 80% 40%, rgba(167, 123, 255, .12), transparent 70%),
    radial-gradient(50% 50% at 10% 80%, rgba(62, 230, 255, .10), transparent 70%);
}
.hero-grid {
  position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.ch-label { font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.hero-logo { width: 150px; height: auto; margin-bottom: 20px; filter: drop-shadow(0 0 24px rgba(62, 230, 255, .35)); }
.hero-title { font-family: var(--display); font-size: clamp(36px, 5.4vw, 72px); line-height: 1.05; font-weight: 700; letter-spacing: -.01em; }
.hero-title .line { display: block; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin-top: 22px; color: #b9c6db; font-size: 17px; max-width: 34em; }
.hero-cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 10px; font-weight: 600; transition: transform .2s, box-shadow .2s, border-color .2s; }
.btn-primary { background: var(--grad); color: #04121a; box-shadow: 0 0 30px rgba(62, 230, 255, .25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(62, 230, 255, .45); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--text); }
.btn-ghost:hover { border-color: var(--cyan); }

/* 監視器 */
.monitor {
  border: 1px solid var(--line-2); border-radius: 18px;
  background: linear-gradient(180deg, #060c18, #03060c);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255,255,255,.03), 0 0 60px rgba(62, 230, 255, .06);
  overflow: hidden;
}
.mon-head, .mon-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; font-size: 11px; color: var(--dim); border-bottom: 1px solid var(--line); }
.mon-foot { border-bottom: 0; border-top: 1px solid var(--line); justify-content: flex-start; gap: 22px; }
.mon-foot span:nth-child(1) { color: var(--green); }
.mon-foot span:nth-child(2) { color: var(--cyan); }
.mon-foot span:nth-child(3) { color: var(--yellow); }
.mon-msg { margin-left: auto; color: var(--dim) !important; }
.mon-alarm { color: var(--green); animation: blink 2s infinite; }
.mon-body { display: grid; grid-template-columns: 1fr 150px; height: 340px; }
#vitals { width: 100%; height: 100%; display: block; }
.mon-readouts { display: grid; grid-template-rows: repeat(3, 1fr); border-left: 1px solid var(--line); }
.ro { padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--line); }
.ro:last-child { border-bottom: 0; }
.ro b { font-size: 10px; font-weight: 400; opacity: .8; }
.ro strong { font-size: 38px; line-height: 1.1; font-weight: 600; }
.ro em { font-style: normal; font-size: 10px; opacity: .7; }
.ro-green { color: var(--green); } .ro-cyan { color: var(--cyan); } .ro-yellow { color: var(--yellow); }
.ro-green strong { font-size: 30px; }

.scroll-hint { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--dim); animation: bob 2s infinite; }
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* ===== 通用區塊 ===== */
.section { padding: 120px 0; position: relative; border-top: 1px solid var(--line); }
.section h2 { font-family: var(--display); font-size: clamp(28px, 3.8vw, 46px); line-height: 1.2; font-weight: 700; margin-bottom: 18px; }
.lang-zh .section h2 { font-family: var(--font); font-weight: 900; }
.lead { color: #b9c6db; font-size: 17px; max-width: 46em; margin-bottom: 48px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; backdrop-filter: blur(6px); }
.panel .mono.dim { font-size: 11px; margin-bottom: 10px; }

.tri { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.tri-1 { background: var(--t1); box-shadow: 0 0 10px var(--t1); }
.tri-2 { background: var(--t2); box-shadow: 0 0 10px var(--t2); }
.tri-3 { background: var(--t3); box-shadow: 0 0 10px var(--t3); }
.tri-4 { background: var(--t4); box-shadow: 0 0 10px var(--t4); }
.tri-5 { background: var(--t5); box-shadow: 0 0 10px var(--t5); }

/* 進場動畫 */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ===== 關於 ===== */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; margin-top: 40px; }
.principles { grid-column: 1 / -1; }
.name-eq { display: flex; align-items: center; gap: 16px; margin: 6px 0 20px; flex-wrap: wrap; }
.tok { display: flex; flex-direction: column; padding: 10px 18px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(62, 230, 255, .05); }
.tok b { font-family: var(--display); font-size: 30px; line-height: 1; }
.tok:first-child b { color: var(--cyan); } .tok:nth-child(3) b { color: var(--violet); }
.tok small { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 4px; }
.op { font-family: var(--mono); font-size: 24px; color: var(--dim); }
.big { font-size: 20px; font-weight: 500; margin-bottom: 24px; }
.big:last-child { margin-bottom: 0; }
.principles ul { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; }
.principles li { padding-left: 22px; position: relative; color: #c9d4e6; }
.principles li::before { content: "▸"; position: absolute; left: 0; color: var(--green); }

/* ===== 產品 ===== */
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 40px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 28px; position: relative; overflow: hidden; }
.product::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.product-main::before { background: var(--green); box-shadow: 0 0 18px var(--green); }
.product-origin::before { background: var(--violet); box-shadow: 0 0 18px var(--violet); }
.product-origin { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.prod-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tag { font-size: 11px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--dim); }
.tag-live { color: var(--green); border-color: rgba(57, 255, 154, .4); }
.tag-origin { color: var(--violet); border-color: rgba(167, 123, 255, .4); }
.prod-title { display: flex; align-items: center; gap: 16px; }
.prod-title img { width: 64px; height: auto; border-radius: 12px; background: #fff3; padding: 4px; }
.product h3 { font-size: 30px; font-weight: 900; line-height: 1.2; }
.prod-pitch { margin: 18px 0 22px; color: #c9d4e6; }
.feat { list-style: none; display: grid; gap: 10px; }
.feat li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.feat b { color: var(--green); font-size: 12px; padding-top: 3px; }
.note { margin-top: 18px; font-size: 12px; color: var(--green); opacity: .85; }
.phones { display: flex; justify-content: center; gap: 14px; perspective: 1200px; }
.phone { flex: 0 1 31%; max-width: 170px; border-radius: 22px; padding: 6px; background: linear-gradient(160deg, #26324a, #0b1220); box-shadow: 0 20px 50px rgba(0,0,0,.5); transition: transform .5s; }
.phone img { border-radius: 17px; }
.phone:nth-child(1) { transform: translateY(24px) rotate(-3deg); }
.phone:nth-child(3) { transform: translateY(24px) rotate(3deg); }
.phones:hover .phone { transform: none; }
.quad { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.quad div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13px; display: flex; gap: 10px; }
.quad b { color: var(--violet); }
.screens { position: relative; height: 380px; }
.screen { position: absolute; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 24px 60px rgba(0,0,0,.55); background: #fff; }
.screen figcaption { position: absolute; top: 8px; right: 8px; font-size: 10px; background: rgba(4,7,13,.85); color: var(--cyan); padding: 3px 8px; border-radius: 6px; }
.s1 { width: 72%; left: 0; top: 0; }
.s2 { width: 72%; right: 0; bottom: 0; }

/* ===== 技術 ===== */
.pipeline { display: grid; grid-template-columns: 1fr 40px 1fr 40px 1fr 40px 1fr; align-items: stretch; margin-bottom: 28px; }
.node { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.node .mono.dim { font-size: 10px; margin-bottom: 8px; }
.node h4 { font-size: 18px; margin-bottom: 8px; }
.node p:last-child { font-size: 14px; color: #b9c6db; }
.node-neuro { border-color: rgba(62, 230, 255, .45); box-shadow: inset 0 0 30px rgba(62, 230, 255, .07); }
.node-neuro h4 { color: var(--cyan); }
.node-symbolic { border-color: rgba(167, 123, 255, .45); box-shadow: inset 0 0 30px rgba(167, 123, 255, .07); }
.node-symbolic h4 { color: var(--violet); }
.node-human { border-color: rgba(57, 255, 154, .4); }
.node-human h4 { color: var(--green); }
.link { position: relative; display: flex; align-items: center; }
.link span { position: relative; width: 100%; height: 2px; background: var(--line-2); overflow: hidden; }
.link span::after { content: ""; position: absolute; top: 0; left: -40%; width: 40%; height: 100%; background: var(--grad); animation: flow 1.6s linear infinite; }
@keyframes flow { to { left: 100%; } }
.fhir { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.fhir h4 { font-family: var(--display); font-size: 26px; margin-bottom: 10px; }
.fhir p { color: #b9c6db; }
.fhir-code { background: #03060c; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; font-size: 13px; line-height: 1.8; color: var(--dim); overflow-x: auto; }
.fhir-code .k { color: var(--violet); } .fhir-code .s { color: var(--green); }

/* ===== 心電圖時間軸 ===== */
.timeline { position: relative; padding: 20px 0; }
.tl-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.tl-base { fill: none; stroke: var(--line-2); stroke-width: 1.5; }
.tl-trace { fill: none; stroke: var(--green); stroke-width: 2.2; filter: drop-shadow(0 0 6px var(--green)); stroke-linejoin: round; }
.tl-item { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 90px; margin-bottom: 64px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-item::after { /* 節點 */
  content: ""; position: absolute; left: 50%; top: 22px; width: 14px; height: 14px; margin-left: -7px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--line-2); transition: all .4s; z-index: 2;
}
.tl-item.lit::after { border-color: var(--green); background: var(--green); box-shadow: 0 0 16px var(--green); }
.tl-date { text-align: right; font-size: 20px; font-weight: 600; color: var(--dim); padding-top: 12px; transition: color .4s; }
.tl-item.lit .tl-date { color: var(--green); }
.tl-item:nth-child(odd of .tl-item) .tl-date { order: 2; text-align: left; }
.tl-item:nth-child(odd of .tl-item) .tl-card { order: 1; }
.tl-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; opacity: .45; transform: translateY(12px); transition: all .6s ease; }
.tl-item.lit .tl-card { opacity: 1; transform: none; border-color: var(--line-2); }
.tl-card h4 { font-size: 18px; margin-bottom: 6px; }
.tl-card p { font-size: 15px; color: #b9c6db; }
.tl-major .tl-card { border-color: rgba(255, 59, 92, .5); box-shadow: 0 0 40px rgba(255, 59, 92, .12); }
.tl-major.lit::after { background: var(--t1); border-color: var(--t1); box-shadow: 0 0 20px var(--t1); }
.tl-next .tl-card { border-style: dashed; }
.badge { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 4px; margin: 0 6px 8px 0; color: #04070d; font-weight: 600; }
.b1 { background: var(--t1); } .b2 { background: var(--t2); } .b3 { background: var(--t3); } .b4 { background: var(--t4); } .b5 { background: var(--t5); color: #fff; }

/* ===== 獎項 ===== */
.awards-list { display: grid; gap: 10px; margin-bottom: 40px; }
.award { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 18px; padding: 14px 20px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--c); transition: transform .25s, background .25s; }
.award:hover { transform: translateX(6px); background: rgba(20, 34, 60, .8); }
.award .lv { font-size: 20px; font-weight: 600; color: var(--c); text-shadow: 0 0 12px var(--c); }
.award b { font-size: 17px; color: var(--c); }
.award p { color: #c9d4e6; font-size: 15px; }
.award time { color: var(--dim); font-size: 13px; }
.a1 { --c: var(--t1); } .a2 { --c: var(--t2); } .a3 { --c: var(--t3); } .a4 { --c: var(--t4); } .a5 { --c: var(--t5); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 210px; gap: 12px; }
.gallery figure { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.gallery .g-wide { grid-column: span 2; grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s, filter .6s; filter: saturate(.85); }
.gallery figure:hover img { transform: scale(1.05); filter: saturate(1.1); }
.gallery figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 10px; font-size: 13px; background: linear-gradient(transparent, rgba(4, 7, 13, .92)); }

/* ===== 團隊 ===== */
.team-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.member { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 20px; transition: border-color .3s, transform .3s; }
.member:hover { border-color: var(--cyan); transform: translateY(-4px); }
.photo { aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; margin-bottom: 14px; background: #03060c; border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.ph-empty {
  height: 100%; display: grid; place-items: center; font-size: 11px; color: var(--dim);
  background: repeating-linear-gradient(0deg, rgba(62,230,255,.04) 0 2px, transparent 2px 5px);
  animation: blink 3s infinite;
}
.role { font-size: 12px; color: var(--cyan); }
.mname { font-size: 18px; font-weight: 700; margin: 2px 0 6px; }
.skills { font-size: 13px; color: var(--dim); line-height: 1.6; }

/* ===== 聯絡 ===== */
.contact-box { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; padding: 48px; border-radius: 22px; border: 1px solid var(--line-2); background: radial-gradient(80% 120% at 0% 0%, rgba(62, 230, 255, .10), transparent 60%), var(--panel); }
.contact-box .lead { margin-bottom: 28px; }
.mail { font-family: var(--mono); }
.partners .mono.dim { font-size: 11px; margin-bottom: 10px; }
.partners ul { list-style: none; margin-bottom: 26px; }
.partners li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 15px; color: #c9d4e6; }

.footer { border-top: 1px solid var(--line); padding: 36px 0; }
.foot-in { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.foot-in img { width: 60px; height: auto; }
.foot-in .mono { font-size: 12px; }
.copy { margin-left: auto; }

/* ===== 響應式 ===== */
@media (max-width: 1080px) {
  .sb-nav { display: none; }
  .sb-clock { margin-left: auto; }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
  .pipeline { grid-template-columns: 1fr; gap: 0; }
  .link { height: 34px; justify-content: center; }
  .link span { width: 2px; height: 100%; }
  .link span::after { width: 100%; height: 40%; left: 0; top: -40%; animation-name: flowv; }
}
@keyframes flowv { to { top: 100%; } }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 90px; }
  .hero-logo { width: 110px; }
  .about-grid, .product, .product-origin, .fhir, .contact-box { grid-template-columns: 1fr; }
  .principles ul { grid-template-columns: 1fr; }
  .product { padding: 26px 20px; gap: 32px; }
  .contact-box { padding: 28px 20px; gap: 28px; }
  .screens { height: auto; display: grid; gap: 12px; }
  .screen { position: relative; width: 100%; inset: auto; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  /* 時間軸改為左側單欄 */
  .tl-item, .tl-item:nth-child(odd of .tl-item) { grid-template-columns: 1fr; gap: 6px; padding-left: 44px; margin-bottom: 40px; }
  .tl-item::after { left: 14px; top: 8px; }
  .tl-date, .tl-item:nth-child(odd of .tl-item) .tl-date { order: 0; text-align: left; padding-top: 0; font-size: 16px; }
  .tl-item:nth-child(odd of .tl-item) .tl-card { order: 1; }
}
@media (max-width: 560px) {
  .statusbar { gap: 10px; padding: 0 12px; }
  .sb-brand span, .sb-live { display: none; }
  .mon-body { grid-template-columns: 1fr 100px; height: 260px; }
  .ro { padding: 8px 10px; }
  .ro strong { font-size: 26px; } .ro-green strong { font-size: 22px; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 84px 0; }
  .award { grid-template-columns: 40px 1fr; }
  .award time { grid-column: 2; }
  .copy { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .tl-card { opacity: 1; transform: none; }
}
