:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #edf3fa;
  --text: #172033;
  --muted: #667085;
  --border: #d8e2ee;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #e8f0ff;
  --success: #13795b;
  --shadow: 0 20px 60px rgba(37, 99, 235, 0.08);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: #172033;
  --surface-soft: #202c42;
  --text: #edf2f7;
  --muted: #9aa9bf;
  --border: #31415a;
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-soft: rgba(96, 165, 250, 0.12);
  --success: #6ee7b7;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Instrument Sans", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

svg {
  display: block;
  flex: 0 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: rgba(244, 247, 251, 0.9);
  backdrop-filter: blur(16px);
}

[data-theme="dark"] .site-header {
  background: rgba(15, 23, 42, 0.9);
}

.header-inner,
.container {
  width: min(100% - 32px, 1280px);
  margin-inline: auto;
}

.header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 750;
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-link,
.icon-button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
}

.language-link {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.icon-button {
  width: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.language-link:hover,
.icon-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.container {
  padding-block: 28px 80px;
}

.breadcrumb {
  margin-bottom: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb a {
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.hero {
  max-width: 920px;
  margin-bottom: 42px;
}

.eyebrow,
.section-label {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 10px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(38px, 6vw, 66px);
  line-height: 1.06;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.lead {
  max-width: 760px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-point {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr);
  gap: 26px;
  align-items: start;
}

.questionnaire,
.result-card {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.questionnaire {
  overflow: hidden;
  border-radius: 22px;
}

.progress {
  padding: 22px 24px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.progress-copy {
  margin-bottom: 11px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.progress-bar {
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 220ms ease;
}

.step-panel {
  display: none;
  min-height: 530px;
  padding: 34px;
}

.step-panel.is-active {
  display: block;
  animation: panel-in 220ms ease both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-heading {
  margin-bottom: 25px;
}

.step-heading .section-label {
  display: block;
  margin-bottom: 8px;
}

.step-heading h2 {
  margin-bottom: 7px;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.step-heading p {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
}

.feature-tools {
  margin-bottom: 18px;
}

.feature-search {
  min-height: 50px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.feature-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  color: var(--primary);
}

.feature-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.feature-search input::placeholder {
  color: var(--muted);
}

.feature-trigger-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.feature-browse-toggle {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.feature-browse-toggle:hover,
.feature-browse-toggle[aria-expanded="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.feature-browse-toggle:focus-visible {
  outline: 3px solid var(--primary-soft);
  outline-offset: 2px;
}

.feature-browser {
  margin-top: 12px;
  padding-top: 2px;
  animation: panel-in 180ms ease both;
}

.feature-browser[hidden] {
  display: none;
}

.feature-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-category {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.feature-category:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.feature-category.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.feature-category:focus-visible {
  outline: 3px solid var(--primary-soft);
  outline-offset: 2px;
}

.feature-meta {
  margin-top: 13px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

#selectedFeatureCount {
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 750;
}

.feature-empty {
  margin: 18px 0 0;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.feature-more {
  width: 100%;
  min-height: 43px;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}

.feature-more:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.option {
  position: relative;
  cursor: pointer;
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-content {
  min-height: 100%;
  padding: 17px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.option-content::before {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  flex: 0 0 auto;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  content: "";
  box-shadow: inset 0 0 0 4px var(--surface);
  transition: background 160ms ease, border-color 160ms ease;
}

.option--checkbox .option-content::before {
  border-radius: 5px;
}

.option--checkbox .option-content::after {
  position: absolute;
  top: 23px;
  left: 21px;
  width: 9px;
  height: 5px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  content: "";
  opacity: 0;
  transform: rotate(-45deg) scale(0.7);
  transition: opacity 160ms ease, transform 160ms ease;
}

.option strong,
.option small {
  display: block;
}

.option strong {
  margin-bottom: 3px;
  font-size: 15px;
  line-height: 1.4;
}

.option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.option:hover .option-content {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.option input:focus-visible + .option-content {
  outline: 3px solid var(--primary-soft);
  outline-offset: 2px;
}

.option input:checked + .option-content {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.option input:checked + .option-content::before {
  border-color: var(--primary);
  background: var(--primary);
}

.option--checkbox input:checked + .option-content::before {
  box-shadow: none;
  background: var(--primary);
}

.option--checkbox input:checked + .option-content::after {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

.step-actions {
  padding: 20px 34px 26px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
}

.button {
  min-height: 46px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:active {
  transform: scale(0.98);
}

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button-primary {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
}

.button-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.button-secondary {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.button[hidden] {
  display: none;
}

.result-card {
  position: sticky;
  top: 92px;
  overflow: hidden;
  border-radius: 20px;
}

.result-top {
  padding: 26px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.result-kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.result-price {
  margin-bottom: 7px;
  font-size: clamp(24px, 2.1vw, 32px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-time {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.result-body {
  padding: 23px 26px 26px;
}

.result-list {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.result-list li {
  padding: 9px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.result-list span {
  color: var(--muted);
}

.result-list strong {
  text-align: right;
  font-weight: 750;
}

.maintenance-note {
  display: none;
  margin: -6px 0 20px;
  padding: 12px 13px;
  border-left: 3px solid var(--success);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
}

.maintenance-note.is-visible {
  display: block;
}

.inquiry-panel {
  margin: 0 0 18px;
  padding-top: 21px;
  border-top: 1px solid var(--border);
}

.inquiry-panel h3 {
  margin-bottom: 4px;
  font-size: 19px;
  line-height: 1.3;
}

.inquiry-panel > p {
  margin-bottom: 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inquiry-form {
  display: grid;
  gap: 13px;
}

.inquiry-field {
  display: grid;
  gap: 5px;
}

.inquiry-field > span,
.contact-methods legend {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.inquiry-field input,
.inquiry-field textarea {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.inquiry-field textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.inquiry-field input:focus,
.inquiry-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.contact-methods {
  margin: 0;
  padding: 0;
  border: 0;
}

.contact-methods legend {
  margin-bottom: 7px;
}

.contact-methods label {
  margin: 0 12px 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.contact-methods input,
.privacy-consent input {
  accent-color: var(--primary);
}

.privacy-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.5;
}

.privacy-consent input {
  margin: 3px 0 0;
  flex: 0 0 auto;
}

.privacy-consent a {
  margin-inline: 2px;
  color: var(--primary);
}

.inquiry-form .button {
  width: 100%;
}

.inquiry-status {
  margin: 0;
  padding: 10px 11px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.inquiry-status:empty {
  display: none;
}

.inquiry-status--success {
  background: rgba(19, 121, 91, 0.12);
  color: var(--success);
}

.inquiry-status--error {
  background: rgba(190, 24, 93, 0.1);
  color: #be185d;
}

[data-theme="dark"] .inquiry-status--error {
  color: #fda4af;
}

.result-actions {
  display: grid;
  gap: 9px;
}

.result-actions .button {
  width: 100%;
}

.disclaimer {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.content-section {
  padding-top: 78px;
}

.content-section h2 {
  max-width: 760px;
  margin: 7px 0 28px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.price-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.price-table th,
.price-table td {
  padding: 15px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.price-table th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.price-table td:last-child {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.price-table tr:last-child td {
  border-bottom: 0;
}

.faq-list {
  max-width: 860px;
  border-top: 1px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  padding: 19px 4px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  color: var(--primary);
  content: "+";
  font-size: 20px;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  max-width: 70ch;
  padding: 0 4px 20px;
  margin-bottom: 0;
  color: var(--muted);
}

.site-footer {
  padding: 28px max(16px, calc((100% - 1280px) / 2));
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
}

@media (max-width: 980px) {
  .calculator-shell {
    grid-template-columns: 1fr;
  }

  .result-card {
    position: static;
  }

  .step-panel {
    min-height: auto;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .container {
    width: min(100% - 24px, 1280px);
  }

  .brand span:last-child {
    display: none;
  }

  .container {
    padding-top: 20px;
  }

  .breadcrumb {
    margin-bottom: 24px;
  }

  .hero {
    margin-bottom: 28px;
  }

  .option-grid {
    grid-template-columns: 1fr;
  }

  .progress {
    padding-inline: 18px;
  }

  .step-panel {
    padding: 25px 18px;
  }

  .feature-categories {
    margin-inline: -2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2px 2px 7px;
    scrollbar-width: thin;
  }

  .feature-category {
    flex: 0 0 auto;
  }

  .feature-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .step-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: 14px 18px;
    background: var(--surface);
  }

  .step-actions .button {
    flex: 1;
  }

  .result-top,
  .result-body {
    padding-inline: 20px;
  }

  .content-section {
    padding-top: 60px;
  }

  .price-table th,
  .price-table td {
    padding: 13px 14px;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
