:root {
  --orange: #ff5a2a;
  --orange-deep: #eb421f;
  --orange-soft: #fff0e9;
  --ink: #171a2f;
  --muted: #707386;
  --pale: #f4f0f4;
  --line: #ece7ee;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(23, 26, 47, 0.16);
  --round: 28px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--orange);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.32), transparent 18rem),
    linear-gradient(135deg, #ff5a2a 0%, #ff612c 44%, #f54d21 100%);
  font-family:
    "Nunito", "Avenir Next", ui-rounded, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: var(--orange-deep);
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  grid-template-areas:
    "intro calculator"
    "tips calculator";
  column-gap: clamp(28px, 5vw, 66px);
  row-gap: 25px;
  width: min(1120px, calc(100% - 36px));
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) 0;
  align-content: center;
  align-items: start;
}

.intro-panel {
  grid-area: intro;
  color: var(--white);
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  margin-bottom: 34px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 12px;
  height: 12px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 18px 0 0 rgba(255, 255, 255, 0.56);
}

.mini-label {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 900;
}

h1 {
  max-width: 570px;
  margin: 0;
  color: var(--white);
  font-size: clamp(44px, 7vw, 78px);
  line-height: 1.02;
  letter-spacing: 0;
}

.intro-copy > p:last-child {
  max-width: 530px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.8;
  font-weight: 700;
}

.calculator-wrap {
  grid-area: calculator;
  display: grid;
  gap: 16px;
}

.result-card,
.tax-form,
.tip-card {
  background: var(--white);
  border-radius: var(--round);
  box-shadow: var(--shadow);
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 5vw, 40px);
}

.result-card::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -42px;
  width: 150px;
  height: 150px;
  background:
    radial-gradient(circle at center, transparent 40%, var(--orange) 42%, var(--orange) 48%, transparent 50%),
    var(--orange-soft);
  border-radius: 50%;
  opacity: 0.95;
}

.result-kicker {
  color: var(--orange-deep);
  font-size: 15px;
  font-weight: 1000;
}

.refund-yen {
  margin-top: 8px;
  color: var(--ink);
  font-size: clamp(58px, 10vw, 94px);
  font-weight: 1000;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.refund-rmb {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  margin-top: 14px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--orange);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.35;
}

.tax-form {
  display: grid;
  gap: 18px;
  padding: clamp(22px, 4vw, 30px);
}

.field-block,
.choice-block {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.refresh-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.field-block span,
legend {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.refresh-rate {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  color: var(--orange-deep);
  background: var(--orange-soft);
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 1000;
  cursor: pointer;
}

.refresh-rate:disabled {
  cursor: wait;
  opacity: 0.72;
}

input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  color: var(--ink);
  background: #f8f4f8;
  border: 2px solid transparent;
  border-radius: 18px;
  font-size: 22px;
  font-weight: 950;
  outline: none;
}

input:focus {
  border-color: var(--orange);
  background: var(--white);
  box-shadow: 0 0 0 5px rgba(255, 90, 42, 0.16);
}

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

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

.segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 14px;
  color: var(--ink);
  background: #f8f4f8;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 950;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.rate-segment {
  justify-content: space-between;
  min-height: 54px;
  border-radius: 22px;
  text-align: left;
}

.rate-segment small {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: var(--muted);
  background: var(--white);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}

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

.segment.active {
  color: var(--white);
  background: var(--orange);
}

.segment.active small {
  color: var(--orange-deep);
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  font-weight: 700;
}

.rate-credit {
  margin-top: -4px;
  font-size: 12px;
}

.rate-feedback {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 900;
  white-space: nowrap;
}

.rate-feedback:empty {
  display: none;
}

.rate-feedback.loading {
  color: var(--muted);
}

.rate-feedback.success {
  color: #1f6b4a;
}

.rate-feedback.error {
  color: var(--orange-deep);
}

.next-step-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  background: var(--orange-soft);
  border-radius: 22px;
}

.card-eyebrow {
  margin: 0;
  color: var(--orange-deep);
  font-size: 12px;
  font-weight: 1000;
}

.next-step-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
}

.next-step-list {
  display: grid;
  gap: 9px;
}

.next-step-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 16px;
}

.next-step-item span {
  display: inline-flex;
  justify-content: center;
  padding: 5px 0;
  color: var(--white);
  background: var(--orange);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 1000;
}

.next-step-item p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 800;
}

.copy-button {
  min-height: 56px;
  color: var(--white);
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 1000;
  cursor: pointer;
}

.tip-card {
  grid-area: tips;
  padding: clamp(22px, 4vw, 30px);
}

.tip-card h2 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 24px;
}

.tip-list {
  display: grid;
  gap: 10px;
}

.tip-list p {
  margin: 0;
  padding: 14px 16px;
  color: var(--ink);
  background: var(--orange-soft);
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.65;
  font-weight: 750;
}

.source-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  font-weight: 700;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "calculator"
      "tips";
    align-items: start;
    width: min(100% - 24px, 560px);
    padding: 18px 0 max(28px, env(safe-area-inset-bottom));
  }

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

  .brand-row {
    margin-bottom: 18px;
  }

  .intro-copy > p:last-child {
    margin-top: 14px;
    font-size: 16px;
  }

  .calculator-wrap {
    gap: 12px;
  }

  .result-card {
    position: sticky;
    top: 10px;
    z-index: 3;
    padding: 22px;
    border-radius: 26px;
  }

  .refund-yen {
    font-size: clamp(50px, 16vw, 74px);
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 42px;
  }

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

  input {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
