@import url("./base.css");

:root {
  --ink: #223d49;
  --muted: #667981;
  --soft: #f5eee3;
  --line: #d9d3ca;
  --line-dark: #b9c5c8;
  --paper: #fffdf9;
  --accent: #4b8294;
  --accent-soft: #e8f0f1;
  --accent-dark: #3f7284;
  --success: #4f776a;
  --plum: #873e4d;
  --radius-lg: 22px;
  --shadow: 0 22px 60px rgba(34, 61, 73, 0.12);
}

@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/Newsreader-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("../assets/fonts/DMSans-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif SC";
  src: url("../assets/fonts/NotoSerifSC-variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

html {
  min-width: 0;
  background: #eee8de;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(75, 130, 148, 0.1), transparent 30%),
    linear-gradient(180deg, #f8f3eb 0%, #eee8de 100%);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
  height: 78px;
  padding: 0 clamp(20px, 4vw, 56px);
  border-color: rgba(34, 61, 73, 0.14);
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: blur(12px);
}

.brand img {
  width: 225px;
  height: auto;
  display: block;
}

.header-trust {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.header-actions { display: flex; align-items: center; gap: 16px; }
.language-selector {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(34, 61, 73, 0.2);
  border-radius: 999px;
}
.language-selector button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.language-selector button.is-active { color: #fff; background: var(--accent-dark); }
.language-selector button:focus-visible {
  outline: 3px solid rgba(75, 130, 148, 0.3);
  outline-offset: 2px;
}

.app-shell {
  border-color: rgba(34, 61, 73, 0.22);
  background: var(--paper);
}

.progress-rail {
  background: #f8f2e9;
}

.step-link {
  cursor: default;
}

.explain-panel {
  background:
    linear-gradient(155deg, rgba(75, 130, 148, 0.08), transparent 38%),
    #fbf7f0;
}

.explain-panel::after {
  color: rgba(75, 130, 148, 0.055);
  font-family: "Noto Serif SC", serif;
}

.explain-title,
.answer-title,
.teaching-card h3,
.package-card h3,
.overview-heading h1,
.overview-card h2 {
  font-family: "Newsreader", Georgia, serif;
}

.hanzi-chip,
.style-example strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.teaching-card,
.example-card,
.select-card,
.style-option,
.category-card,
.package-card,
.text-input,
.message-input {
  border-color: rgba(34, 61, 73, 0.2);
}

.select-card.is-selected,
.style-option.is-selected,
.category-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 8px 24px rgba(75, 130, 148, 0.1);
}

.select-card small {
  margin-top: 3px;
  display: block;
  line-height: 1.28;
}

.back-button {
  color: var(--accent-dark);
  border-color: var(--accent);
  background: transparent;
}

.back-button:hover {
  background: var(--accent-soft);
}

.continue-button,
.package-card.is-selected .package-select {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.package-card.featured .package-badge {
  background: var(--plum);
}

.old-price {
  color: #8b817b;
}

.new-price {
  color: var(--plum);
}

.app-shell {
  grid-template-columns: 190px minmax(400px, 0.88fr) minmax(590px, 1.22fr);
}

.answer-scroll {
  padding-right: 3px;
  overflow-y: auto;
}

.category-list {
  gap: 8px;
}

.category-card {
  padding-top: 11px;
  padding-bottom: 11px;
}

.step-five .explain-panel {
  padding-top: 34px;
}

.step-five .explain-title {
  font-size: clamp(32px, 2.6vw, 44px);
}

.step-five .explain-copy {
  margin-top: 12px;
  font-size: 14px;
}

.step-five .message-input {
  height: 78px;
}

.step-five .review-list {
  grid-template-columns: 1fr 1fr;
  margin-top: 12px;
}

.step-five .review-card {
  min-height: 56px;
  padding: 9px 11px;
}

.step-five .review-card strong {
  font-size: 11px;
  overflow-wrap: anywhere;
}

.review-heading {
  margin: 16px 0 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product-summary {
  padding: 26px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--accent-soft), #fff 42%);
  box-shadow: 0 10px 28px rgba(35, 70, 88, 0.13);
}

.product-summary-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 22px;
  align-items: end;
}

.product-summary-head .package-badge { grid-column: 1 / -1; justify-self: start; }
.product-summary h3 { margin: 0; font-family: "Newsreader", Georgia, serif; font-size: 32px; }
.product-summary .price-row { margin: 0; }
.product-summary .package-subtitle { margin: 10px 0 14px; }
.product-summary .package-list { columns: 2; column-gap: 24px; }
.product-summary .package-list li { break-inside: avoid; }

.package-list .package-group {
  margin-top: 2px;
  padding-left: 0;
  color: var(--ink);
  font-weight: 800;
}

.package-list .package-group::before {
  content: "";
}

.package-list .conditional-item {
  margin-left: 10px;
  padding-left: 15px;
  color: var(--muted);
}

.package-list .conditional-item::before {
  content: "—";
  color: var(--muted);
}

.package-truth-note {
  margin: 12px 0 0;
  padding: 9px 10px;
  color: #52606c;
  border-radius: 8px;
  background: #f2f5f6;
  font-size: 9px;
  line-height: 1.4;
}

.continue-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.checkout-status {
  min-height: 15px;
  margin-top: 9px;
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
}

.return-notice,
.step-error {
  color: var(--plum);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.return-notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-left: 3px solid var(--plum);
  background: rgba(135, 62, 77, 0.07);
}

.step-error {
  min-width: 0;
  margin: 0 auto 0 0;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 170px minmax(360px, 0.84fr) minmax(540px, 1.16fr);
  }

  .package-card {
    min-height: 450px;
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (max-width: 900px) {
  .site-header {
    height: 68px;
    padding: 0 18px;
  }

  .brand img {
    width: 180px;
  }

  .header-trust {
    max-width: 120px;
    font-size: 10px;
    text-align: right;
  }

  .app-shell,
  .step-five.app-shell {
    width: calc(100% - 24px);
    height: auto;
    min-height: 0;
    max-height: none;
    margin: 12px auto 28px;
    display: block;
    overflow: visible;
    border-radius: 18px;
  }

  .progress-rail {
    padding: 18px 18px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-kicker,
  .rail-note {
    display: none;
  }

  .rail-progress {
    margin: 0 0 12px;
    font-size: 13px;
  }

  .step-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }

  .step-list::before {
    left: 10%;
    right: 10%;
    top: 15px;
    bottom: auto;
    width: auto;
    height: 1px;
  }

  .step-item {
    margin: 0;
    text-align: center;
  }

  .step-link {
    min-height: 52px;
    padding: 36px 2px 0;
    background: transparent !important;
  }

  .step-number {
    left: 50%;
    top: 0;
    width: 30px;
    height: 30px;
    transform: translateX(-50%);
  }

  .step-name {
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .step-state {
    display: none;
  }

  .explain-panel,
  .step-five .explain-panel {
    padding: 30px 22px 28px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .explain-title,
  .step-five .explain-title {
    font-size: clamp(36px, 10vw, 48px);
  }

  .explain-copy,
  .step-five .explain-copy {
    font-size: 15px;
  }

  .teaching-card {
    margin-top: 24px;
    padding: 20px;
  }

  .answer-panel {
    min-height: 590px;
    padding: 28px 18px 20px;
    overflow: visible;
  }

  .answer-scroll {
    overflow: visible;
  }

  .field-grid,
  .step-five .review-list {
    grid-template-columns: 1fr;
  }

  .product-summary { padding: 22px 18px; }
  .product-summary-head { grid-template-columns: 1fr; align-items: start; }
  .product-summary .package-list { columns: 1; }

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

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

  .style-option {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .style-example {
    padding: 9px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .answer-footer {
    position: sticky;
    z-index: 10;
    bottom: 0;
    margin: 24px -18px -20px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 249, 0.96);
    backdrop-filter: blur(10px);
  }

  .back-button,
  .continue-button {
    min-width: 0;
    flex: 1;
  }

  .footer-note {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .header-trust {
    display: none;
  }

  .brand img {
    width: 150px;
  }

  .header-actions { gap: 6px; }
  .language-selector button { width: 30px; min-height: 30px; }

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

  .hanzi-chip {
    justify-self: start;
  }

  .delivery-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}
