:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --paper-light: #fffaf0;
  --ink: #17130d;
  --muted: #6d655a;
  --line: #d8d0c4;
  --accent: #b66b2f;
  --green: #243a2c;
  --blue: #2d67dc;
  --yellow: #ffc95c;
  --shadow: 0 24px 70px rgba(80, 61, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.paper-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 12%, rgba(182, 107, 47, 0.14), transparent 25%),
    radial-gradient(circle at 90% 8%, rgba(36, 58, 44, 0.11), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 42%);
}

.tool-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(23, 19, 13, 0.12);
  background: rgba(244, 241, 234, 0.84);
  backdrop-filter: blur(18px);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 900;
}

.site-mark {
  position: relative;
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.site-mark::after {
  position: absolute;
  top: 9px;
  left: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
}

.back-home {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 250, 240, 0.5);
  font-size: 12px;
  font-weight: 850;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.back-home:hover {
  border-color: rgba(182, 107, 47, 0.35);
  color: var(--ink);
  background: var(--paper-light);
}

.quote-workspace {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0 90px;
}

.tool-heading {
  display: grid;
  align-items: end;
  gap: 36px;
  margin-bottom: 42px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.tool-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: clamp(46px, 6.7vw, 82px);
  letter-spacing: -0.045em;
  line-height: 1;
}

.tool-heading > div:first-child > p:last-child {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.shift-key {
  display: grid;
  min-width: 260px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.55);
}

.shift-key span {
  display: grid;
  align-items: center;
  gap: 9px;
  padding: 13px 15px;
  color: var(--muted);
  font-size: 11px;
  grid-template-columns: auto 1fr auto;
}

.shift-key span + span {
  border-top: 1px solid var(--line);
}

.shift-key i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.shift-key span:last-child i {
  background: var(--accent);
}

.shift-key b {
  color: var(--ink);
  font-size: 12px;
}

.calculator-layout {
  display: grid;
  align-items: start;
  gap: 26px;
  grid-template-columns: minmax(0, 1fr) 390px;
}

.quote-form {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.form-block {
  min-width: 0;
  margin: 0;
  padding: 24px;
  border: 1px solid rgba(23, 19, 13, 0.13);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(255, 250, 240, 0.08)),
    rgba(255, 250, 240, 0.68);
  box-shadow: 0 12px 34px rgba(80, 61, 38, 0.07);
}

.block-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  margin: 0 0 22px;
  padding: 0;
}

legend.block-heading {
  float: left;
}

legend.block-heading + * {
  clear: both;
}

.block-heading > span:first-child {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--accent);
  background: rgba(255, 250, 240, 0.76);
  font-size: 10px;
  font-weight: 900;
}

.block-heading > div,
.block-heading > span:last-child {
  display: grid;
  gap: 4px;
}

.block-heading h2,
.block-heading strong {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 800;
}

.block-heading p,
.block-heading small {
  margin: 0;
  color: var(--muted);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}

.client-field {
  display: grid;
  gap: 8px;
}

.client-shift-fields {
  display: grid;
  grid-template-columns: minmax(132px, 0.36fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.client-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.client-field input,
.client-field select {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.client-field select {
  cursor: pointer;
}

.client-field input::placeholder {
  color: #a39a8e;
}

.client-field input:focus,
.client-field select:focus {
  border-color: var(--accent);
  background: var(--paper-light);
  box-shadow: 0 0 0 4px rgba(182, 107, 47, 0.1);
}

.client-field input[aria-invalid="true"] {
  border-color: #b84545;
  box-shadow: 0 0 0 4px rgba(184, 69, 69, 0.08);
}

.field-error {
  min-height: 17px;
  margin: 7px 0 -3px;
  color: #a93636;
  font-size: 11px;
}

.client-field + .field-error + .client-field {
  margin-top: 8px;
}

.service-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.service-card {
  position: relative;
  display: flex;
  min-height: 208px;
  flex-direction: column;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.service-card:hover {
  transform: translateY(-2px);
  border-color: rgba(182, 107, 47, 0.4);
  background: rgba(255, 255, 255, 0.66);
}

.service-card[data-selected="true"] {
  border-color: var(--accent);
  background: #fff8ec;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.service-card > input,
.tier-option > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.service-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.service-icon,
.selected-plan__icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper-light);
  background: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.service-check {
  width: 18px;
  height: 18px;
  border: 1px solid #bdb4a8;
  border-radius: 50%;
  background: var(--paper-light);
}

.service-card[data-selected="true"] .service-check {
  border: 5px solid var(--accent);
}

.service-card > strong {
  margin-top: 18px;
  font-size: 15px;
}

.service-card > small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.service-channel {
  margin-top: auto;
  padding-top: 13px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
}

.tier-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 13px;
}

.tier-toolbar p,
.tier-footnote {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.tier-toolbar output {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.tier-options {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.tier-option {
  position: relative;
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.tier-option:hover {
  transform: translateY(-1px);
  border-color: rgba(182, 107, 47, 0.45);
  color: var(--accent);
}

.tier-option:has(input:checked) {
  border-color: var(--ink);
  color: var(--paper-light);
  background: var(--ink);
}

.tier-footnote {
  margin-top: 11px;
  line-height: 1.5;
}

.client-night-option {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.night-toggle {
  position: relative;
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.44);
  cursor: pointer;
  grid-template-columns: auto 1fr auto;
}

.night-toggle__icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--paper-light);
  background: var(--green);
  font-family: Georgia, serif;
  font-size: 24px;
}

.night-toggle__copy {
  display: grid;
  gap: 3px;
}

.night-toggle__copy strong {
  font-size: 13px;
}

.night-toggle__copy small {
  color: var(--muted);
  font-size: 10px;
}

.night-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  border: 1px solid #bdb4a8;
  border-radius: 999px;
  background: #d9d2c7;
  transition: background 170ms ease, border-color 170ms ease;
}

.switch i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper-light);
  box-shadow: 0 3px 8px rgba(23, 19, 13, 0.2);
  transition: transform 170ms ease;
}

.night-toggle input:checked + .switch {
  border-color: var(--accent);
  background: var(--accent);
}

.night-toggle input:checked + .switch i {
  transform: translateX(20px);
}

.night-rule {
  display: flex;
  align-items: baseline;
  gap: 12px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 190ms ease, opacity 190ms ease, margin 190ms ease;
}

body[data-night="true"] .night-rule {
  max-height: 70px;
  margin-top: 12px;
  opacity: 1;
}

.night-rule span {
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
}

.night-rule p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.quote-panel {
  position: sticky;
  top: 94px;
  overflow: hidden;
  border-radius: 12px;
  color: var(--paper-light);
  background: var(--ink);
  box-shadow: var(--shadow);
}

.quote-panel::before {
  position: absolute;
  top: -120px;
  right: -110px;
  width: 300px;
  height: 300px;
  border: 46px solid rgba(182, 107, 47, 0.12);
  border-radius: 50%;
  content: "";
}

.quote-panel__head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 25px;
  border-bottom: 1px solid rgba(244, 241, 234, 0.12);
}

.quote-panel__head > div > span {
  color: #c59a6a;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.quote-panel h2 {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 23px;
}

.quote-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(244, 241, 234, 0.5);
  font-size: 9px;
}

.quote-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #65b987;
  box-shadow: 0 0 0 4px rgba(101, 185, 135, 0.1);
}

.selected-plan {
  position: relative;
  display: grid;
  align-items: center;
  gap: 12px;
  margin: 22px 25px 0;
  padding: 14px;
  border: 1px solid rgba(244, 241, 234, 0.1);
  background: rgba(244, 241, 234, 0.06);
  grid-template-columns: auto 1fr auto;
}

.selected-plan__icon {
  color: var(--ink);
  background: #c59a6a;
}

.selected-plan > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.selected-plan > div strong {
  font-size: 13px;
}

.selected-plan > div span {
  overflow: hidden;
  color: rgba(244, 241, 234, 0.45);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-plan > b {
  color: #d5b58c;
  font-size: 10px;
}

.price-breakdown {
  margin: 19px 25px 0;
}

.price-breakdown > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(244, 241, 234, 0.1);
}

.price-breakdown dt {
  display: grid;
  gap: 3px;
}

.price-breakdown dt span {
  font-size: 11px;
  font-weight: 800;
}

.price-breakdown dt small {
  color: rgba(244, 241, 234, 0.4);
  font-size: 9px;
}

.price-breakdown dd {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
}

#resultShift {
  max-width: 56%;
  text-align: right;
  white-space: normal;
  line-height: 1.45;
}

.night-price dd {
  color: #d5b58c;
}

.quote-total {
  display: grid;
  padding: 22px 25px;
}

.quote-total > span {
  color: rgba(244, 241, 234, 0.52);
  font-size: 10px;
  font-weight: 800;
}

.quote-total > strong {
  margin-top: 2px;
  color: #d5b58c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 5vw, 56px);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.quote-total > small {
  margin-top: 7px;
  color: rgba(244, 241, 234, 0.42);
  font-size: 9px;
  line-height: 1.55;
}

.quote-actions {
  display: grid;
  gap: 8px;
  margin: 0 25px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  justify-content: space-between;
  color: var(--paper-light);
  background: var(--accent);
  box-shadow: 0 12px 30px rgba(182, 107, 47, 0.18);
}

.button--secondary {
  border: 1px solid rgba(244, 241, 234, 0.18);
  color: rgba(244, 241, 234, 0.72);
  background: transparent;
}

.button--secondary:hover {
  color: var(--paper-light);
  background: rgba(244, 241, 234, 0.08);
}

.copy-status {
  min-height: 16px;
  margin: 9px 25px 0;
  color: #8fd0a8;
  font-size: 9px;
  line-height: 1.5;
}

.copy-fallback {
  max-height: 150px;
  margin: 7px 25px;
  overflow: auto;
  padding: 11px;
  color: var(--ink);
  background: var(--paper-light);
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 10px;
  line-height: 1.5;
}

.quote-disclaimer {
  margin: 6px 25px 24px;
  color: rgba(244, 241, 234, 0.3);
  font-size: 8px;
  line-height: 1.55;
}

.image-dialog {
  width: min(780px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 19, 13, 0.18);
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 40px 110px rgba(23, 19, 13, 0.32);
}

.image-dialog::backdrop {
  background: rgba(23, 19, 13, 0.56);
  backdrop-filter: blur(8px);
}

.image-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.image-dialog__head span {
  color: var(--accent);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.image-dialog__head h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", "Noto Serif SC", serif;
  font-size: 24px;
}

.image-dialog__head button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
  cursor: pointer;
}

.image-dialog__body {
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding: 18px;
  background: #dfd9ce;
}

.image-dialog__body img {
  display: block;
  width: min(100%, 540px);
  height: auto;
  margin: 0 auto;
  box-shadow: 0 18px 50px rgba(23, 19, 13, 0.2);
}

.image-dialog__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
}

.image-dialog__actions p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.button--download {
  min-height: 42px;
  color: var(--paper-light);
  background: var(--ink);
  font-size: 11px;
}

.noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  margin: 0;
  padding: 12px 16px;
  color: var(--paper-light);
  background: #9c3333;
}

[hidden] {
  display: none !important;
}

.back-home:focus-visible,
.service-card:has(input:focus-visible),
.tier-option:has(input:focus-visible),
.night-toggle:has(input:focus-visible),
.button:focus-visible,
.image-dialog button:focus-visible,
.image-dialog a:focus-visible {
  outline: 3px solid #c59a6a;
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .calculator-layout {
    grid-template-columns: minmax(0, 1fr) 350px;
  }

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

  .service-card {
    min-height: 145px;
  }

  .service-card > strong {
    margin-top: 12px;
  }

  .service-card > small br {
    display: none;
  }

  .tier-options {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .quote-workspace {
    padding-top: 46px;
  }

  .tool-heading {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .shift-key {
    min-width: 0;
  }

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

  .service-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .service-card {
    min-height: 205px;
  }

  .quote-panel {
    position: relative;
    top: auto;
  }
}

@media (max-width: 620px) {
  .tool-nav {
    min-height: 66px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .quote-workspace {
    width: calc(100% - 28px);
    padding: 38px 0 60px;
  }

  .tool-heading {
    gap: 24px;
    margin-bottom: 28px;
  }

  .tool-heading h1 {
    font-size: 45px;
  }

  .tool-heading > div:first-child > p:last-child {
    font-size: 14px;
  }

  .form-block {
    padding: 18px;
  }

  .client-shift-fields {
    grid-template-columns: 1fr;
  }

  .service-options {
    display: flex;
    margin-right: -18px;
    overflow-x: auto;
    padding: 0 18px 8px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .service-options::-webkit-scrollbar {
    display: none;
  }

  .service-card {
    min-width: 210px;
    min-height: 196px;
    scroll-snap-align: start;
  }

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

  .night-toggle {
    grid-template-columns: auto 1fr;
  }

  .switch {
    position: absolute;
    right: 15px;
  }

  .night-toggle__copy {
    padding-right: 48px;
  }

  .image-dialog__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button--download {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .back-home {
    font-size: 10px;
  }

  .site-brand {
    font-size: 15px;
  }

  .tool-heading h1 {
    font-size: 40px;
  }

  .tier-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .selected-plan {
    grid-template-columns: auto 1fr;
  }

  .selected-plan > b {
    grid-column: 2;
  }
}

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

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