:root {
  --bg: #ffffff;
  --bg-alt: #eef1f5;
  --ink: #141a22;
  --ink-2: #3a4452;
  --mute: #66717f;
  --rule: #dde2e8;
  --accent: #1f5fae;
  --dark: #111821;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  font-family: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.wrap { width: min(1200px, 100% - 32px); margin: 0 auto; }

.kicker { font-size: 15px; font-weight: 500; color: var(--accent); letter-spacing: .06em; display: flex; align-items: center; gap: 10px; }
.kicker::before { content: ""; width: 22px; height: 2px; background: currentColor; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 22px; border-radius: 6px; font-weight: 500; font-size: 16px; transition: background-color .2s, border-color .2s, color .2s; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 15px; }
.btn-dark { background: var(--dark); color: #fff; }
.btn-dark:hover { background: var(--accent); }
.btn-ghost { border: 1px solid #c9d0d9; color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

.nav { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.nav-in { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { font-size: 20px; font-weight: 900; display: flex; align-items: baseline; gap: 10px; }
.brand span { font-size: 13px; font-weight: 500; color: var(--mute); }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 15px; color: var(--ink-2); }
.nav-links a:not(.btn):hover { color: var(--accent); }

.hero { background: var(--bg-alt); border-bottom: 1px solid var(--rule); overflow: hidden; position: relative; }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(20,26,34,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(20,26,34,.045) 1px, transparent 1px); background-size: 40px 40px; pointer-events: none; }
.hero-in { position: relative; display: grid; grid-template-columns: 1fr 1.15fr; gap: 48px; align-items: center; padding: 72px 0 64px; }
.hero h1 { font-size: clamp(36px, 5vw, 58px); font-weight: 900; line-height: 1.2; margin: 18px 0 20px; }
.lead { font-size: 18px; color: var(--ink-2); max-width: 34em; }
.hero-cta { display: flex; gap: 12px; margin: 32px 0 40px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0; border-top: 1px solid var(--rule); }
.facts div { padding: 16px 28px 0 0; margin-right: 28px; border-right: 1px solid var(--rule); }
.facts div:last-child { border-right: 0; margin-right: 0; }
.facts dt { font-size: 24px; font-weight: 900; }
.facts dd { font-size: 14px; color: var(--mute); }
.hero-img img { width: 100%; height: auto; }

.sec { padding: 96px 0; }
.sec-alt { background: var(--bg-alt); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 900; line-height: 1.3; margin-top: 12px; }
.sec-note { color: var(--mute); max-width: 26em; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); }
.tab { padding: 8px 14px; font-size: 15px; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .2s, border-color .2s; }
.tab:hover { color: var(--ink); }
.tab.is-on { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 28px; }
.card { text-align: left; display: block; width: 100%; }
.card-img { aspect-ratio: 16 / 10; overflow: hidden; border-radius: 8px; border: 1px solid var(--rule); background: var(--bg-alt); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-img img { transform: scale(1.03); }
.card-meta { margin-top: 16px; font-size: 13px; color: var(--accent); font-weight: 500; }
.card h3 { font-size: 19px; font-weight: 700; margin-top: 4px; line-height: 1.45; }
.card p { font-size: 15px; color: var(--mute); margin-top: 6px; }
.card-more { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--ink-2); border-bottom: 1px solid #c9d0d9; }
.card:hover .card-more { color: var(--accent); border-color: var(--accent); }
.card[hidden] { display: none; }

.svc { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.svc article { padding: 28px 24px 8px 0; margin-right: 24px; border-right: 1px solid var(--rule); }
.svc article:last-child { border-right: 0; margin-right: 0; }
.svc h3 { font-size: 20px; font-weight: 700; }
.price { font-size: 28px; font-weight: 900; color: var(--accent); margin: 8px 0 14px; }
.price small { font-size: 14px; font-weight: 500; color: var(--mute); }
.svc p { color: var(--ink-2); font-size: 15px; }
.svc ul { list-style: none; margin-top: 16px; border-top: 1px solid var(--rule); }
.svc li { font-size: 14px; color: var(--ink-2); padding: 9px 0; border-bottom: 1px solid var(--rule); }

.flow { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; position: relative; padding-top: 28px; }
.flow::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 1px; background: var(--rule); }
.flow li { position: relative; }
.flow li::before { content: ""; position: absolute; top: -28px; left: 0; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); }
.flow h3 { font-size: 17px; font-weight: 700; }
.flow p { font-size: 14px; color: var(--mute); margin-top: 6px; }
.stack { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 160px 1fr; gap: 24px; }
.stack h3 { font-size: 16px; font-weight: 700; }
.stack p { color: var(--ink-2); }

.contact { background: var(--dark); color: #e9edf2; padding: 88px 0; }
.contact .kicker { color: #8db8ec; }
.contact h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 900; line-height: 1.3; margin: 12px 0 14px; color: #fff; }
.contact .lead { color: #aeb8c4; }
.contact-in { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: end; }
.contact-list { list-style: none; border-top: 1px solid rgba(255,255,255,.14); }
.contact-list li { display: grid; grid-template-columns: 96px 1fr; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.14); align-items: baseline; }
.contact-list span { font-size: 14px; color: #8b96a3; }
.contact-list a { font-size: 20px; font-weight: 700; color: #fff; }
.contact-list a:hover { color: #8db8ec; }

.foot { background: var(--dark); color: #6f7b88; font-size: 13px; padding: 20px 0 28px; border-top: 1px solid rgba(255,255,255,.08); }

.lb { position: fixed; inset: 0; z-index: 50; background: rgba(10,14,20,.72); display: flex; align-items: center; justify-content: center; padding: 24px; }
.lb[hidden] { display: none; }
.lb-box { position: relative; background: #fff; border-radius: 10px; width: min(1180px, 100%); max-height: calc(100vh - 48px); display: grid; grid-template-columns: 1.6fr 1fr; overflow: hidden; }
.lb-x { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; font-size: 28px; line-height: 1; color: var(--mute); z-index: 2; }
.lb-x:hover { color: var(--ink); }
.lb-media { background: var(--bg-alt); padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.lb-media > img { width: 100%; border-radius: 6px; border: 1px solid var(--rule); background: #fff; }
.lb-media > p { font-size: 14px; color: var(--mute); }
.lb-thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lb-thumbs button { border-radius: 4px; overflow: hidden; border: 2px solid transparent; opacity: .7; transition: opacity .2s, border-color .2s; }
.lb-thumbs button.is-on, .lb-thumbs button:hover { opacity: 1; border-color: var(--accent); }
.lb-info { padding: 32px 28px; overflow-y: auto; }
.lb-info h3 { font-size: 22px; font-weight: 900; line-height: 1.4; margin: 10px 0 16px; }
.lb-desc { font-size: 15px; color: var(--ink-2); white-space: pre-line; }
.lb-skills { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--mute); }
body.lb-open { overflow: hidden; }

@media (max-width: 1024px) {
  .hero-in { grid-template-columns: 1fr; padding: 56px 0 48px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .svc { grid-template-columns: repeat(2, 1fr); }
  .svc article:nth-child(2) { border-right: 0; margin-right: 0; }
  .svc article:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .flow { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
  .flow::before { display: none; }
  .flow li { border-top: 1px solid var(--rule); padding-top: 4px; }
  .contact-in { grid-template-columns: 1fr; gap: 32px; }
  .lb-box { grid-template-columns: 1fr; overflow-y: auto; }
  .lb-media, .lb-info { overflow: visible; }
}

@media (max-width: 640px) {
  .nav-links a:not(.btn) { display: none; }
  .brand span { display: none; }
  .lead { font-size: 16px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(2) { border-right: 0; margin-right: 0; }
  .facts div:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--rule); margin-top: 14px; }
  .sec { padding: 64px 0; }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 8px 4px; }
  .grid { grid-template-columns: 1fr; gap: 36px; }
  .svc { grid-template-columns: 1fr; }
  .svc article { border-right: 0; margin-right: 0; padding-right: 0; }
  .svc article + article { border-top: 1px solid var(--rule); }
  .flow { grid-template-columns: 1fr 1fr; }
  .stack { grid-template-columns: 1fr; gap: 8px; }
  .contact { padding: 64px 0; }
  .contact-list li { grid-template-columns: 76px 1fr; }
  .contact-list a { font-size: 18px; }
  .lb { padding: 0; }
  .lb-box { max-height: 100vh; height: 100%; border-radius: 0; }
  .lb-media { padding: 56px 12px 12px; }
  .lb-thumbs { grid-template-columns: repeat(4, 1fr); }
  .lb-info { padding: 20px 16px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card-img img { transition: none; }
  .card:hover .card-img img { transform: none; }
}
