:root {
  color-scheme: light;
  --bg: #f5f8fa;
  --surface: #ffffff;
  --surface-2: #f7faff;
  --ink: #1f2329;
  --muted: #495770;
  --line: #e1e6f0;
  --line-soft: #edf1f7;
  --teal: #006eff;
  --teal-dark: #0052d9;
  --amber: #ff7a00;
  --red: #e53030;
  --blue: #00a4ff;
  --green: #0abf5b;
  --shadow: 0 8px 24px rgba(20, 38, 72, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eaf4ff 0, #f5f8fa 340px),
    var(--bg);
  color: var(--ink);
  font-family:
    "PingFang SC", "Helvetica Neue", Arial, "Hiragino Sans GB",
    "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.topbar {
  position: relative;
  display: flex;
  min-height: 178px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  overflow: hidden;
  margin-bottom: 20px;
  padding: 30px 36px;
  border: 1px solid #d7e8ff;
  border-radius: 4px;
  background:
    radial-gradient(circle at 84% 28%, rgba(0, 164, 255, 0.18), transparent 34%),
    linear-gradient(115deg, #ffffff 0%, #eef7ff 56%, #dff1ff 100%);
  box-shadow: 0 10px 28px rgba(0, 82, 217, 0.08);
}

.topbar::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(0, 82, 217, 0.06) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(0deg, rgba(0, 82, 217, 0.05) 1px, transparent 1px) 0 0 / 48px 48px;
  mask-image: linear-gradient(90deg, transparent, #000 45%, #000);
}

.topbar-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.language-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  overflow: hidden;
  margin-top: 22px;
  border: 1px solid #b7d4ff;
  border-radius: 2px;
  background: #fff;
}

.language-switch button {
  min-width: 68px;
  height: 34px;
  border: 0;
  border-right: 1px solid #b7d4ff;
  background: transparent;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 500;
}

.language-switch button:last-child {
  border-right: 0;
}

.language-switch button.active {
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  color: #fff;
}

.hero-visual {
  position: relative;
  z-index: 1;
  width: min(340px, 32vw);
  height: 132px;
  overflow: hidden;
}

.hero-visual span {
  position: absolute;
  display: block;
  border: 1px solid rgba(0, 110, 255, 0.22);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(217, 240, 255, 0.72));
  box-shadow: 0 18px 32px rgba(0, 82, 217, 0.14);
  transform: skewX(-14deg);
}

.hero-visual span:nth-child(1) {
  right: 14px;
  top: 12px;
  width: 176px;
  height: 54px;
}

.hero-visual span:nth-child(2) {
  right: 82px;
  top: 52px;
  width: 214px;
  height: 62px;
  border-color: rgba(0, 164, 255, 0.34);
}

.hero-visual span:nth-child(3) {
  right: 0;
  top: 84px;
  width: 138px;
  height: 34px;
  background: linear-gradient(135deg, rgba(0, 110, 255, 0.22), rgba(0, 164, 255, 0.12));
}

.topbar h1,
.panel h2,
.report-main h2,
.section-title h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 500;
  line-height: 1.16;
}

.hero-subtitle {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

.main-column,
.side-column {
  display: grid;
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.config-panel,
.report-main {
  padding: 24px 28px;
}

.estimate-panel,
.payment-panel,
.progress-panel,
.share-panel,
.history-panel {
  padding: 20px;
}

.panel-header,
.report-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-header.compact {
  margin-bottom: 16px;
  padding-bottom: 12px;
}

.panel h2,
.report-main h2 {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--teal-dark);
  font-size: 20px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--teal-dark);
  background: #f2f7ff;
}

form {
  display: grid;
  gap: 20px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.field > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}

.segmented label,
.profile-card,
.toggle-row {
  position: relative;
}

.segmented input,
.profile-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 8px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.segmented label:last-child span {
  border-right: 0;
}

.segmented input:checked + span {
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  color: #fff;
}

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

.field.full {
  grid-column: 1 / -1;
}

.field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(0, 110, 255, 0.12);
}

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

.profile-card {
  display: grid;
  gap: 5px;
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
}

.profile-card:has(input:checked) {
  border-color: var(--teal-dark);
  background: #f2f7ff;
  box-shadow: inset 3px 0 0 var(--teal-dark);
}

.profile-name {
  font-weight: 600;
}

.profile-meta,
.helper-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

.toggle-row:has(input:checked) {
  border-color: #b7d4ff;
  background: #f2f7ff;
}

.toggle-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal-dark);
}

.notice {
  display: grid;
  gap: 5px;
  padding: 13px 16px;
  border: 1px solid #b7d4ff;
  border-radius: 3px;
  background: #f2f7ff;
  color: #27466d;
  font-size: 14px;
  line-height: 1.55;
}

.config-actions {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding-top: 4px;
}

.config-actions .helper-text {
  margin: 0;
}

.metric-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-bottom: 0;
}

.metric-list div,
.summary-grid div,
.technical-grid div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.summary-grid div,
.technical-grid div {
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-2);
}

.metric-list span,
.summary-grid span,
.technical-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.metric-list strong,
.summary-grid strong,
.technical-grid strong {
  min-width: 0;
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.pay-options {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}

.qr-box {
  display: grid;
  gap: 8px;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.qr-pattern {
  width: 68px;
  height: 68px;
  background:
    linear-gradient(90deg, var(--ink) 10px, transparent 10px) 0 0 / 20px 20px,
    linear-gradient(var(--ink) 10px, transparent 10px) 0 0 / 20px 20px,
    #fff;
  border: 8px solid #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.paypal-button {
  min-height: 108px;
  border: 1px solid #b7d4ff;
  border-radius: 2px;
  background: linear-gradient(180deg, #f7fbff, #ecf5ff);
  color: var(--teal-dark);
  font-size: 23px;
  font-weight: 600;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 2px;
  font-weight: 500;
}

.primary-button {
  width: 100%;
  border: 1px solid var(--teal-dark);
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  color: #fff;
}

.primary-button:hover {
  border-color: #003cab;
  background: linear-gradient(90deg, #1684ff, #0048c7);
}

.primary-button:disabled {
  cursor: not-allowed;
  border-color: #a7b4c8;
  background: #a7b4c8;
}

.secondary-button {
  border: 1px solid #b7d4ff;
  background: #fff;
  color: var(--teal-dark);
}

.secondary-button:hover {
  border-color: var(--teal-dark);
  background: #f2f7ff;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 0;
  background: #e8eef7;
}

.progress-track div {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--teal-dark), var(--blue));
  transition: width 250ms ease;
}

.progress-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 12px 0;
}

.progress-copy strong {
  color: var(--teal-dark);
  font-size: 26px;
  font-weight: 500;
}

.progress-copy span {
  color: var(--muted);
  font-size: 14px;
}

.stage-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}

.stage-list li.active {
  color: var(--teal-dark);
  font-weight: 600;
}

.stage-list li.done {
  color: #16824a;
}

.report-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.score-ring {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 8px solid rgba(0, 110, 255, 0.16);
  border-top-color: var(--teal-dark);
  border-radius: 50%;
  background: #f7fbff;
}

.score-ring strong {
  color: var(--teal-dark);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
}

.score-ring span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

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

.section-title {
  margin: 24px 0 12px;
}

.section-title h3 {
  position: relative;
  padding-left: 10px;
  font-size: 17px;
  font-weight: 500;
}

.section-title h3::before {
  position: absolute;
  left: 0;
  top: 4px;
  width: 3px;
  height: 16px;
  background: var(--teal-dark);
  content: "";
}

.score-bars {
  display: grid;
  gap: 11px;
}

.score-bar {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
}

.score-bar span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 0;
  background: #e8eef7;
}

.bar-track div {
  height: 100%;
  background: var(--teal-dark);
}

.bar-track.warning div {
  background: var(--amber);
}

.bar-track.danger div {
  background: var(--red);
}

.bar-track.muted div {
  background: #a7b4c8;
}

.conclusion {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid #b7d4ff;
  border-radius: 2px;
  background: #f2f7ff;
  line-height: 1.65;
}

.conclusion p,
.conclusion ol {
  margin: 0;
}

.conclusion ol {
  padding-left: 22px;
}

.case-table {
  display: grid;
  gap: 10px;
}

.case-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 92px 76px minmax(220px, 2fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  font-size: 14px;
}

.case-row:hover,
.history-item:hover {
  border-color: #b7d4ff;
  background: #f7fbff;
}

.case-title {
  display: grid;
  gap: 4px;
}

.case-title strong {
  font-size: 14px;
  font-weight: 600;
}

.case-title span,
.case-reason small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.case-reason {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.case-reason span {
  overflow-wrap: anywhere;
}

.status-pill {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 2px;
  background: #fff3e6;
  color: #b95f00;
  font-size: 12px;
  font-weight: 500;
}

.status-pill.pass {
  background: #e8f7ef;
  color: #16824a;
}

.status-pill.warn {
  background: #fff3e6;
  color: #b95f00;
}

.status-pill.fail {
  background: #fdeceb;
  color: var(--red);
}

.share-panel h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 500;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

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

.history-item {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.history-item strong,
.history-item span {
  display: block;
}

.history-item strong {
  margin-bottom: 4px;
  font-weight: 600;
}

.history-item span {
  color: var(--muted);
  font-size: 12px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1050px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .share-panel,
  .history-panel {
    grid-column: span 2;
  }

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

  .paypal-button {
    min-height: 54px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 10px;
  }

  .topbar {
    min-height: 156px;
    align-items: flex-start;
    flex-direction: column;
    padding: 22px 18px;
  }

  .hero-visual {
    width: 100%;
    height: 58px;
  }

  .hero-visual span:nth-child(1) {
    right: 0;
    top: 0;
  }

  .hero-visual span:nth-child(2) {
    left: 18px;
    top: 22px;
    width: 174px;
  }

  .hero-visual span:nth-child(3) {
    right: 22px;
    top: 30px;
  }

  .config-panel,
  .report-main,
  .estimate-panel,
  .payment-panel,
  .progress-panel,
  .share-panel,
  .history-panel {
    padding: 16px;
  }

  .segmented,
  .form-grid,
  .profile-grid,
  .toggle-grid,
  .config-actions,
  .side-column,
  .summary-grid,
  .technical-grid {
    grid-template-columns: 1fr;
  }

  .segmented span {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .segmented label:last-child span {
    border-bottom: 0;
  }

  .field.full,
  .share-panel,
  .history-panel {
    grid-column: auto;
  }

  .report-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .score-bar {
    grid-template-columns: 1fr 46px;
  }

  .score-bar .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

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

  .pay-options,
  .button-row {
    grid-template-columns: 1fr;
  }

  .paypal-button {
    min-height: 54px;
  }
}
