:root {
  --bg: #f3f5f9;
  --bg-strong: #eef3f9;
  --card: rgba(255, 255, 255, 0.96);
  --card-strong: #ffffff;
  --panel: #f7f9fc;
  --primary: #1f4d8f;
  --primary-strong: #183e72;
  --primary-soft: rgba(31, 77, 143, 0.08);
  --text: #1a2433;
  --muted: #5b6878;
  --border: #dfe5ef;
  --success: #227a5d;
  --success-soft: rgba(34, 122, 93, 0.08);
  --shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: linear-gradient(180deg, #f5f7fb 0%, #edf2f7 100%);
  color: var(--text);
}

button,
select {
  font: inherit;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 50px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, #3d74c7 100%);
  color: white;
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

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

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.primary-btn {
  background: var(--primary);
  color: white;
}

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

.primary-btn:hover,
.secondary-btn:hover {
  transform: translateY(-1px);
}

.primary-btn:active,
.secondary-btn:active {
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

.content {
  display: grid;
  gap: 22px;
  margin-top: 26px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(220px, 0.8fr);
  gap: 24px;
  align-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(245, 248, 252, 0.96));
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.06em;
}

.hero-copy {
  margin: 0;
  max-width: 700px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1rem;
}

.user-card {
  min-height: 126px;
  padding: 18px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

#userLabel {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.estimator h2,
.result-box h2 {
  margin: 0 0 18px;
  font-size: clamp(1.55rem, 2vw, 1.9rem);
  letter-spacing: -0.04em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
}

select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:focus {
  border-color: rgba(31, 77, 143, 0.42);
  box-shadow: 0 0 0 4px rgba(31, 77, 143, 0.08);
}

.form-actions {
  display: flex;
  gap: 14px;
  margin-top: 24px;
}

.result-box {
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
}

.result-summary {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.result-details {
  display: grid;
  gap: 14px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
  color: var(--text);
}

.result-row strong {
  min-width: 130px;
  color: var(--muted);
}

.result-row span:last-child {
  font-weight: 700;
  text-align: right;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  background: var(--success-soft);
  color: var(--success);
}

@media (max-width: 760px) {
  .shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

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

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

  .actions,
  .form-actions {
    flex-wrap: wrap;
  }

  .result-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-row span:last-child {
    text-align: left;
  }
}
