:root {
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #173a40;
  background: #eaf3f3;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #173a40;
  --muted: #648084;
  --line: #d7e5e4;
  --teal: #167a77;
  --teal-dark: #105e5c;
  --mint: #c9e8dc;
  --paper: #fff;
  --coral: #c65e4d;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 82% 17%, rgba(201, 232, 220, 0.62), transparent 28rem),
    #eaf3f3;
}

button,
input {
  font: inherit;
}

.topbar,
main,
footer {
  width: min(1120px, calc(100% - 64px));
  margin-inline: auto;
}

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 58, 64, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px 11px 11px 3px;
  background: var(--teal);
  color: white;
  font-size: 16px;
}

.service-state {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d59a42;
}

.state-dot.is-online {
  background: #33896f;
}

.state-dot.is-offline {
  background: var(--coral);
}

main {
  padding: 66px 0 42px;
}

.intro {
  max-width: 660px;
  margin-bottom: 38px;
}

.section-label {
  margin: 0 0 13px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(42px, 6vw, 66px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 1.17;
}

.intro h1 span {
  color: var(--teal);
}

.intro-copy {
  max-width: 490px;
  margin: 18px 0 0;
  color: #597578;
  font-size: 15px;
  line-height: 1.85;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  overflow: hidden;
  border: 1px solid rgba(23, 58, 64, 0.08);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 18px 55px rgba(29, 75, 77, 0.08);
}

.measure-form {
  padding: 34px 38px 30px;
}

.form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 31px;
}

.form-heading h2,
.empty-result h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.formula-chip {
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 5px;
  background: #edf6f3;
  color: #39716d;
  font-size: 11px;
}

.field {
  display: block;
  margin-bottom: 21px;
  color: #35585c;
  font-size: 13px;
  font-weight: 600;
}

.input-wrap {
  height: 54px;
  display: flex;
  align-items: center;
  margin-top: 9px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input-wrap:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(22, 122, 119, 0.12);
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
}

.input-wrap input::placeholder {
  color: #a9bcbd;
  font-weight: 400;
}

.input-wrap > span {
  flex: 0 0 auto;
  color: #81999a;
  font-size: 12px;
  font-weight: 400;
}

.form-error {
  margin: -4px 0 13px;
  color: #a84235;
  font-size: 13px;
  line-height: 1.6;
}

.calculate-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 7px;
  background: var(--teal);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  transition: background 150ms ease, transform 150ms ease;
}

.calculate-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--teal-dark);
}

.calculate-button:focus-visible {
  outline: 3px solid #9ed5c4;
  outline-offset: 3px;
}

.calculate-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.form-note {
  margin: 13px 0 0;
  color: #81999a;
  font-size: 11px;
  line-height: 1.6;
}

.result-panel {
  min-height: 423px;
  padding: 38px 42px;
  background:
    linear-gradient(145deg, rgba(220, 241, 232, 0.7), rgba(233, 244, 241, 0.46) 57%, rgba(247, 250, 247, 0.75)),
    #edf5f2;
}

.empty-result {
  max-width: 330px;
  padding-top: 27px;
}

.measure-illustration {
  position: relative;
  width: 150px;
  height: 90px;
  margin-bottom: 38px;
  border-bottom: 2px solid #b2d8ca;
}

.measure-line {
  position: absolute;
  bottom: 0;
  left: 30px;
  width: 2px;
  height: 68px;
  background: #84bdae;
}

.measure-line::before,
.measure-line::after {
  position: absolute;
  right: -9px;
  width: 10px;
  height: 1px;
  background: #84bdae;
  content: "";
}

.measure-line::before {
  top: 10px;
}

.measure-line::after {
  top: 29px;
}

.measure-line.short {
  left: 61px;
  height: 36px;
  background: #c1e1d5;
}

.measure-point {
  position: absolute;
  right: 12px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  border: 2px solid #75ad9d;
  border-radius: 50%;
  background: #edf5f2;
}

.empty-result h2 {
  font-size: 24px;
}

.empty-result > p:last-child {
  margin: 12px 0 0;
  color: #668184;
  font-size: 13px;
  line-height: 1.8;
}

.calculated-result {
  padding-top: 4px;
}

.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-topline .section-label {
  margin-bottom: 0;
}

.category-pill {
  padding: 6px 11px;
  border: 1px solid #a9d8c6;
  border-radius: 100px;
  background: #e2f2eb;
  color: #286d58;
  font-size: 12px;
  font-weight: 650;
}

.category-pill.is-low,
.category-pill.is-high {
  border-color: #e8c99a;
  background: #fbf0dc;
  color: #8d6327;
}

.category-pill.is-very-high {
  border-color: #e5b7ad;
  background: #f9e9e5;
  color: #a8463a;
}

.bmi-value {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: clamp(58px, 8vw, 76px);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.07em;
  line-height: 1.1;
}

.result-message {
  max-width: 390px;
  min-height: 44px;
  margin: 8px 0 32px;
  color: #668184;
  font-size: 13px;
  line-height: 1.7;
}

.scale {
  position: relative;
  display: flex;
  gap: 3px;
  height: 9px;
}

.scale-segment {
  display: block;
  height: 100%;
  border-radius: 10px;
}

.scale-low {
  width: 14%;
  background: #e2c481;
}

.scale-standard {
  width: 21.6%;
  background: #75bca1;
}

.scale-high {
  width: 16.4%;
  background: #e4ad68;
}

.scale-very-high {
  flex: 1;
  background: #d78c7d;
}

.scale-marker {
  position: absolute;
  z-index: 1;
  top: -5px;
  left: 0;
  width: 3px;
  height: 19px;
  border: 1px solid white;
  border-radius: 3px;
  background: var(--ink);
  box-shadow: 0 1px 5px rgba(23, 58, 64, 0.3);
  transform: translateX(-50%);
  transition: left 350ms ease;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: #6b8586;
  font-size: 10px;
}

.weight-range {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(68, 112, 107, 0.18);
}

.weight-range .section-label {
  margin-bottom: 7px;
  color: #668184;
  font-weight: 500;
  letter-spacing: 0;
}

.range-value {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.range-unit {
  padding-bottom: 3px;
  color: #668184;
  font-size: 12px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  max-width: 850px;
  margin-top: 24px;
  padding: 4px 0;
}

.notice-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #9bb9b4;
  border-radius: 50%;
  color: #527d78;
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
}

.notice p {
  margin: 0;
  color: #688184;
  font-size: 12px;
  line-height: 1.8;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 27px;
  border-top: 1px solid rgba(23, 58, 64, 0.12);
  color: #789092;
  font-size: 11px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .topbar,
  main,
  footer {
    width: min(100% - 36px, 560px);
  }

  .topbar {
    height: 72px;
  }

  main {
    padding-top: 48px;
  }

  .intro {
    margin-bottom: 27px;
  }

  .intro-copy {
    font-size: 14px;
  }

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

  .measure-form {
    padding: 27px 24px 25px;
  }

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

  .result-panel {
    min-height: 0;
    padding: 27px 24px 31px;
  }

  .empty-result {
    padding-top: 3px;
  }

  .measure-illustration {
    height: 68px;
    margin-bottom: 26px;
  }

  .measure-line {
    height: 52px;
  }

  .measure-line.short {
    height: 28px;
  }

  .result-message {
    margin-bottom: 26px;
  }

  footer {
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 420px) {
  .topbar,
  main,
  footer {
    width: calc(100% - 28px);
  }

  .form-heading {
    flex-direction: column;
    gap: 11px;
  }

  .formula-chip {
    padding: 6px 8px;
  }

  .service-state {
    font-size: 11px;
  }

  .scale-labels {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
