/*
 * 夯能省 C 端视觉系统
 * 参考 AegisData 的信息层级、状态语义和响应式边界，保留消费产品的轻量与亲和感。
 */

:root {
  --ink: #153630;
  --muted: #667a74;
  --paper: #f6f7f2;
  --card: #ffffff;
  --green: #176b55;
  --green-strong: #0f5142;
  --green-soft: #e7f1ec;
  --lime: #d7f36a;
  --line: #dfe6e1;
  --orange: #d9653d;
  --danger: #b94343;
  --shadow: 0 18px 48px rgba(21, 54, 48, 0.09);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -8%, rgba(174, 223, 188, 0.32), transparent 28rem),
    var(--paper);
  font-size: 15px;
  line-height: 1.55;
}

button,
input,
textarea,
select {
  max-width: 100%;
  font-family: inherit;
}

button,
[role="button"] {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(23, 107, 85, 0.2);
  outline-offset: 2px;
}

img,
svg {
  max-width: 100%;
}

#app {
  width: 100%;
  max-width: 760px;
  min-width: 0;
  overflow-x: clip;
}

main,
section,
article,
header,
footer,
nav,
div,
label {
  min-width: 0;
}

p,
h1,
h2,
h3,
small,
span,
strong,
b,
dt,
dd,
button,
a {
  overflow-wrap: anywhere;
}

.topbar {
  padding: 30px 24px 20px;
}

.topbar h1 {
  font-size: clamp(24px, 4vw, 30px);
  line-height: 1.2;
}

.topbar p {
  max-width: 34rem;
  font-size: 14px;
  line-height: 1.55;
}

.eyebrow,
.decision-label,
.section-head span,
.panel-kicker {
  font-size: 12px !important;
  line-height: 1.4;
  letter-spacing: 0.12em;
}

.avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
}

main {
  padding-inline: 22px;
}

.hero {
  min-height: 286px;
  contain: paint;
  border-radius: 26px;
  padding: 28px 26px;
  box-shadow: 0 22px 50px rgba(17, 57, 49, 0.16);
}

.cart-hero {
  color: #ffffff;
  background:
    radial-gradient(circle at 88% 18%, rgba(215, 243, 106, 0.12), transparent 13rem),
    linear-gradient(145deg, #123f36 0%, #0a2d27 72%);
}

.hero::after {
  top: -54px;
  right: 16px;
  width: 180px;
  height: 180px;
  box-shadow:
    0 0 0 28px rgba(215, 243, 106, 0.035),
    0 0 0 56px rgba(215, 243, 106, 0.025);
}

.hero-badge {
  max-width: 100%;
  font-size: 13px;
  white-space: normal;
}

.hero h2 {
  max-width: 10em;
  font-size: clamp(32px, 6vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.hero p {
  max-width: 40rem;
  font-size: 15px;
  line-height: 1.75;
}

.month-saving {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.month-saving span,
.month-saving small {
  font-size: 13px;
  line-height: 1.5;
}

.month-saving strong {
  font-size: 28px;
}

.compare-entry,
.ask-card,
.decision-card,
.offer-card,
.order-card,
.stats-strip,
.trust-card,
.privacy-card,
.wallet-hero,
.saving-report,
.ledger-list,
.profile-card,
.profile-saving,
.menu-list,
.cart-bill,
.login-benefits article {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.compare-entry {
  margin-inline: 8px;
  padding: 22px;
}

.compare-entry h2,
.section-head h2 {
  font-size: clamp(21px, 4vw, 25px);
  line-height: 1.3;
}

.compare-entry > p,
.decision-card > p,
.comparison-warnings p,
.reason,
.trust-card p,
.privacy-card p,
.saving-report p,
.safety-note p,
.sheet p,
.empty-state p,
.cart-entry > p,
.cart-reason,
.cart-warnings p {
  font-size: 13px !important;
  line-height: 1.65;
}

.compare-entry > .cart-mode {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.compare-entry > .cart-input {
  display: block;
  width: 100%;
}

.cart-input textarea,
.compare-entry textarea,
.input-wrap textarea,
.sheet textarea,
.form-sheet input,
.form-sheet select,
.form-sheet textarea {
  width: 100%;
  min-width: 0;
  font-size: 16px;
  line-height: 1.55;
}

.primary,
.empty-state button,
.privacy-actions button,
.form-sheet button {
  min-height: 44px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.25;
}

.primary.compact {
  min-height: 40px;
  padding: 9px 13px;
  font-size: 13px;
}

.text-button,
.section-head button,
.link-card button,
.order-status button {
  min-height: 40px;
  font-size: 13px;
}

.quick-prompts,
.tags,
.segmented,
.cart-mode {
  scrollbar-width: thin;
}

.quick-prompts button,
.segmented button,
.cart-mode button {
  min-height: 40px;
  font-size: 13px;
}

.decision-card {
  padding: 24px;
}

.decision-card h2 {
  font-size: 24px;
  line-height: 1.3;
}

.decision-card > strong {
  font-size: 16px;
}

.capabilities {
  align-items: flex-start;
}

.capability,
.match-chip,
.score,
.verified,
.mode-chip,
.cart-status,
  .bill-time,
  .quote-result > span {
  max-width: 100%;
  font-size: 12px !important;
  line-height: 1.45;
  white-space: normal;
}

.section-head {
  align-items: flex-end;
  gap: 14px;
}

.offer-list {
  align-items: stretch;
}

.offer-card {
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  padding: 16px;
  border-radius: 20px;
}

.product-mark {
  min-width: 0;
  height: 132px;
}

.product-mark small,
.offer-card .seller,
.reason,
.tags span,
.price-line small,
.price-line del,
.breakdown,
.uncertainty {
  font-size: 12px !important;
  line-height: 1.5;
}

.offer-top {
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.offer-card h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 9px 0 6px;
  font-size: 16px;
  line-height: 1.45;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.offer-card .seller {
  white-space: normal;
}

.reason {
  -webkit-line-clamp: 3;
}

.tags {
  overflow-x: auto;
  padding-bottom: 2px;
}

.tags span {
  flex: 0 0 auto;
}

.price-line {
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.price-line > div {
  min-width: 0;
  flex: 1 1 120px;
}

.price-line strong {
  font-size: 21px;
}

.breakdown {
  gap: 6px;
  white-space: normal;
}

.breakdown .icon {
  flex: 0 0 14px;
}

.trust-card,
.privacy-card {
  align-items: flex-start;
}

.trust-card strong,
.privacy-card b,
.ledger-list b,
.menu-list b,
.safety-note b {
  font-size: 14px;
  line-height: 1.45;
}

.bottom-nav {
  width: min(100%, 760px);
  min-width: 320px;
  height: calc(76px + env(safe-area-inset-bottom));
}

.nav-item {
  min-width: 0;
  min-height: 54px;
  font-size: 12px;
}

.site-footer {
  font-size: 12px;
  line-height: 1.55;
}

.stats-strip {
  gap: 0;
}

.stats-strip span,
.order-meta,
.order-status,
.order-product p,
.progress div,
.wallet-hero > span,
.wallet-hero p span,
.saving-report span,
.ledger-list small,
.profile-card p,
.profile-card span,
.profile-saving span,
.menu-list small {
  font-size: 12px !important;
  line-height: 1.5;
}

.segmented {
  overflow-x: auto;
}

.segmented button {
  min-width: max-content;
  padding-inline: 12px;
}

.order-meta,
.order-status {
  gap: 10px;
  flex-wrap: wrap;
}

.order-product h3 {
  display: -webkit-box;
  font-size: 15px;
  line-height: 1.45;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.progress {
  min-width: 0;
}

.progress div {
  padding-inline: 2px;
}

.wallet-hero > button {
  position: static;
  width: fit-content;
  min-height: 42px;
  margin-bottom: 18px;
  font-size: 13px;
}

.wallet-hero > strong {
  font-size: clamp(34px, 8vw, 44px);
}

.wallet-hero > div {
  gap: 16px;
}

.ledger-list article,
.profile-card,
.menu-list button {
  gap: 12px;
}

.ledger-list article > div,
.profile-card > div:nth-child(2),
.menu-list button > span:first-child {
  min-width: 0;
}

.profile-card {
  align-items: flex-start;
  flex-wrap: wrap;
}

.profile-card > div:nth-child(2) {
  flex: 1 1 180px;
}

.profile-card h2 {
  font-size: 19px;
}

.profile-saving strong {
  font-size: 18px;
}

.menu-list button {
  min-height: 58px;
}

.sheet-backdrop {
  padding-top: max(16px, env(safe-area-inset-top));
}

.sheet {
  max-height: calc(100dvh - max(16px, env(safe-area-inset-top)));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet h2 {
  padding-right: 42px;
  font-size: 23px;
  line-height: 1.3;
}

.sheet > small,
.state-screen > small,
.consent-check,
.setting-row small,
.form-sheet > label:not(.setting-row),
.privacy-actions button {
  font-size: 12px !important;
  line-height: 1.55;
}

.toast {
  width: max-content;
  max-width: calc(100vw - 32px);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  white-space: normal;
}

.state-screen {
  width: 100%;
  min-height: 100dvh;
  padding: 42px 24px 110px !important;
}

.state-screen h1,
.state-screen h2 {
  font-size: clamp(27px, 6vw, 34px);
  line-height: 1.25;
}

.state-screen p {
  font-size: 14px !important;
}

.consent-check {
  align-items: flex-start;
  width: min(100%, 420px);
}

.consent-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.quote-result h3,
.cart-item-head h3,
.cart-candidate b,
.verified-offer b,
.ticket-item b,
.setting-row b {
  font-size: 14px;
  line-height: 1.5;
}

.quote-result > div,
.quote-money-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quote-result p {
  min-width: 0;
}

.quote-money-grid small,
.quote-result > small,
.ticket-item span,
.setting-row small,
.screenshot-picker small,
.cart-candidate small,
.cart-candidate em,
.verified-offer span,
.ocr-price {
  font-size: 12px !important;
  line-height: 1.55;
}

.quote-money-grid b {
  font-size: 17px;
  overflow-wrap: anywhere;
}

.cart-mode button {
  min-width: 0;
  white-space: normal;
}

.screenshot-picker {
  min-height: 150px;
}

.screenshot-picker b {
  max-width: 100%;
  font-size: 15px;
}

.cart-bill {
  overflow: hidden;
}

.cart-bill-head {
  gap: 12px;
}

.cart-bill-head h2 {
  font-size: 21px;
  line-height: 1.4;
}

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

.cart-totals span {
  font-size: 12px;
}

.cart-totals b,
.cart-totals strong {
  overflow-wrap: anywhere;
}

.cart-item-head {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
}

.cart-item-head h3 {
  margin-top: 0;
  overflow-wrap: anywhere;
}

.cart-candidate {
  align-items: flex-start;
}

.cart-candidate > span,
.verified-offer {
  min-width: 0;
}

.cart-candidate b,
.cart-candidate small,
.cart-candidate em,
.verified-offer b,
.verified-offer span {
  white-space: normal;
  overflow-wrap: anywhere;
}

.verified-offer {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
}

@media (min-width: 700px) {
  .offer-list,
  .order-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .offer-card {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .product-mark {
    height: 124px;
  }
}

@media (max-width: 699px) {
  .topbar {
    padding: 24px 18px 16px;
  }

  main {
    padding-inline: 16px;
  }

  .hero {
    min-height: 264px;
    padding: 24px 20px;
    border-radius: 22px;
  }

  .hero h2 {
    font-size: clamp(29px, 9vw, 36px);
  }

  .compare-entry {
    margin-inline: 6px;
    padding: 18px;
  }
}

@media (max-width: 520px) {
  .month-saving {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .month-saving small {
    grid-column: 1 / -1;
  }

  .offer-card {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .product-mark {
    height: 116px;
  }

  .price-line .primary {
    width: 100%;
  }

  .stats-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-inline: 10px;
  }

  .stats-strip div {
    padding-inline: 6px;
  }

  .profile-saving {
    padding-inline: 9px;
  }

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

  .cart-totals .final {
    grid-column: 1 / -1;
  }

  .quote-result > div,
  .quote-money-grid {
    grid-template-columns: 1fr;
  }

  .verified-offer {
    grid-template-columns: 1fr;
  }

  .verified-offer strong {
    justify-self: start;
  }
}

@media (max-width: 380px) {
  .topbar p {
    display: none;
  }

  .hero h2 {
    font-size: 28px;
  }

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

  .product-mark {
    width: 100%;
    height: 96px;
  }

  .cart-mode {
    grid-template-columns: 1fr !important;
  }

  .stats-strip,
  .profile-saving {
    grid-template-columns: 1fr;
  }

  .stats-strip div,
  .profile-saving div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-block: 10px;
  }

  .stats-strip div:last-child,
  .profile-saving div:last-child {
    border-bottom: 0;
  }
}

@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;
  }
}
