:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #06113f;
  --muted: #52607d;
  --line: rgba(6, 17, 63, 0.14);
  --blue: #0052ff;
  --surface: #f7f9ff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071025;
  --text: #f7fbff;
  --muted: #aebced;
  --line: rgba(255, 255, 255, 0.16);
  --blue: #2f77ff;
  --surface: #0d1a3a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Noto Sans TC", "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; }
.skip-link {
  position: absolute;
  left: 16px;
  top: 8px;
  transform: translateY(-140%);
  background: var(--text);
  color: var(--bg);
  padding: 8px 12px;
  z-index: 20;
}
.skip-link:focus { transform: translateY(0); }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(18px, 2.2vw, 34px);
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.brand__logo { width: 42px; height: 42px; object-fit: contain; border-radius: 8px; background: #fff; }
.brand__fallback { font-size: 20px; letter-spacing: 0; }
.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(30px, 2.8vw, 40px);
  margin-left: auto;
  font-size: 16px;
  font-weight: 650;
}
.site-nav a { text-decoration: none; color: var(--muted); padding: 10px 4px; line-height: 1.4; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-button, .button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
}
.icon-button.nav-toggle { display: none; width: 42px; padding: 0; font-size: 22px; line-height: 1; }
.button--primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.button--secondary { background: var(--surface); }
.button--compact { min-height: 36px; }
.hero, .section, .contact {
  padding: clamp(72px, 10vw, 128px) clamp(18px, 5vw, 72px);
}
.hero {
  min-height: calc(100vh - 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(36px, 6vw, 92px);
  align-items: center;
}
.eyebrow { color: var(--blue); font-weight: 800; margin: 0 0 14px; }
h1, h2 { margin: 0; line-height: 1.05; letter-spacing: 0; }
h1 { font-size: clamp(44px, 7vw, 86px); max-width: 900px; }
h2 { font-size: clamp(30px, 4vw, 54px); }
.hero__lead { color: var(--muted); font-size: clamp(18px, 2vw, 22px); line-height: 1.75; max-width: 760px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__visual { min-height: 420px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); position: relative; overflow: hidden; }
.module-path { position: absolute; inset: 48px; }
.module-path span { position: absolute; width: 92px; height: 92px; border-radius: 20px; background: linear-gradient(135deg, #06113f, #0052ff); box-shadow: 0 24px 54px rgba(0, 82, 255, 0.22); }
.module-path span:nth-child(1) { left: 4%; top: 16%; }
.module-path span:nth-child(2) { left: 26%; top: 38%; }
.module-path span:nth-child(3) { left: 50%; top: 58%; }
.module-path span:nth-child(4) { right: 10%; top: 24%; width: 76px; height: 76px; }
.module-path span:nth-child(5) { right: 0; top: 4%; width: 54px; height: 54px; border-radius: 14px; }
.module-grid, .process-list, .reason-list, .use-case-list, .faq-list { display: grid; gap: 16px; margin-top: 28px; }
.module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card, details { border: 1px solid var(--line); border-radius: 8px; padding: 22px; background: var(--bg); }
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; }
.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  gap: clamp(28px, 5vw, 72px);
  text-align: left;
  align-items: start;
}

.contact__copy {
  max-width: 560px;
}

.contact__copy p {
  margin-left: 0;
  margin-right: 0;
}

.contact__note {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.consultation-form {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-field,
.form-consent {
  display: grid;
  gap: 8px;
}

.form-field label,
.form-consent label {
  color: var(--text);
  font-weight: 750;
  line-height: 1.45;
}

.form-required {
  color: var(--blue);
  font-size: 13px;
  margin-left: 6px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

.form-field textarea {
  resize: vertical;
  line-height: 1.65;
}

.form-consent {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.form-consent input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
}

.form-status {
  min-height: 0;
  color: var(--muted);
  line-height: 1.6;
}

.form-status[data-state="success"] {
  color: var(--blue);
  font-weight: 800;
}

.form-status[data-state="error"],
.form-error {
  color: #c02828;
}

.form-error {
  min-height: 18px;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.form-field--hidden {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consultation-form__submit {
  justify-self: start;
  min-width: 180px;
}

:root[data-theme="dark"] .consultation-form {
  background: #0d1a3a;
}

:root[data-theme="dark"] .form-field input,
:root[data-theme="dark"] .form-field select,
:root[data-theme="dark"] .form-field textarea {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .form-status[data-state="error"],
:root[data-theme="dark"] .form-error {
  color: #ff9b9b;
}
.site-footer { padding: 28px clamp(18px, 5vw, 72px); display: flex; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--line); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 70%, white); outline-offset: 3px; }

@media (max-width: 900px) {
  .contact {
    grid-template-columns: 1fr;
  }

  .hero, .split { grid-template-columns: 1fr; }
  .hero__visual { min-height: 320px; }
  .module-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; gap: 8px; }

  .site-header {
    flex-wrap: wrap;
    align-items: center;
  }

  .icon-button.nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .site-header[data-nav-ready="true"] .site-nav {
    display: none;
  }

  .site-header[data-nav-ready="true"] .site-nav[data-open="true"] {
    display: flex;
  }

  .site-nav {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 16px;
    padding: 18px 0 6px;
    border-top: 1px solid var(--line);
    order: 4;
  }

  .site-nav a {
    width: 100%;
    padding: 12px 0;
  }
}

:root[data-theme="dark"] .site-header {
  background: rgba(7, 16, 37, 0.88);
}

:root[data-theme="dark"] .brand__logo {
  background: #ffffff;
}

:root[data-theme="dark"] .hero__visual,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] details {
  background: #0d1a3a;
}

:root[data-theme="dark"] .button--secondary {
  background: rgba(255, 255, 255, 0.06);
}

.card h3,
details summary {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.25;
}

.card p,
details p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.card p + p {
  margin-top: 12px;
}

.card__meta {
  font-size: 14px;
  color: color-mix(in srgb, var(--muted) 88%, var(--blue));
}

.process-card span {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--blue);
  font-weight: 900;
  margin-bottom: 16px;
}

.process-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reason-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.use-case-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

details summary {
  cursor: pointer;
  font-weight: 800;
}

details p {
  padding-top: 10px;
}

.system-panel {
  position: absolute;
  width: min(240px, 44%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
  padding: 16px;
  box-shadow: 0 20px 60px rgba(6, 17, 63, 0.12);
}

.system-panel span,
.system-panel strong {
  display: block;
}

.system-panel span {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.system-panel strong {
  font-size: 18px;
}

.system-panel--top {
  left: 28px;
  bottom: 32px;
}

.system-panel--bottom {
  right: 28px;
  top: 32px;
}

@media (max-width: 1180px) {
  .module-grid,
  .process-list,
  .use-case-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .consultation-form {
    padding: 18px;
  }

  .consultation-form__submit {
    width: 100%;
  }

  .site-header {
    min-height: auto;
    padding: 12px 14px;
    gap: 10px;
  }

  .brand__logo {
    width: 36px;
    height: 36px;
  }

  .brand__fallback {
    display: none;
  }

  .header-actions {
    gap: 6px;
    margin-left: 0;
  }

  .icon-button,
  .button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 13px;
  }

  h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

  .hero,
  .section,
  .contact {
    padding-left: 18px;
    padding-right: 18px;
  }

  .module-grid,
  .process-list,
  .reason-list,
  .use-case-list {
    grid-template-columns: 1fr;
  }

  .system-panel {
    width: 58%;
    padding: 12px;
  }

  .system-panel strong {
    font-size: 15px;
  }

  .header-actions .button--compact {
    display: none;
  }
}
