:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: #f4f5f1;
  color: #17201b;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(244, 245, 241, 0.96), rgba(232, 236, 230, 0.98)),
    repeating-linear-gradient(90deg, rgba(23, 32, 27, 0.035) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(0deg, rgba(23, 32, 27, 0.025) 0 1px, transparent 1px 42px),
    #f4f5f1;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

.input-panel,
.result-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(23, 32, 27, 0.1);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(22, 26, 24, 0.12);
}

.input-panel {
  position: sticky;
  top: 24px;
  padding: 22px;
}

.result-panel {
  min-height: calc(100vh - 48px);
  padding: 20px;
}

.brand-row,
.block-title,
.paywall,
.score-strip,
.summary-block,
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow,
.metric-label,
.privacy-note,
.lead {
  color: #667066;
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
}

h2 {
  margin-bottom: 8px;
  font-size: 20px;
}

.badge,
.block-title span {
  border: 1px solid #cad4c8;
  border-radius: 999px;
  color: #315c4c;
  font-size: 12px;
  padding: 6px 10px;
  white-space: nowrap;
}

.lead {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.7;
}

.profile-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.upload-zone {
  position: relative;
  min-height: 280px;
  border: 1px dashed #89988d;
  border-radius: 8px;
  background: #eef2ec;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  color: #4e5c52;
}

.upload-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-zone img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  pointer-events: none;
}

.upload-zone span {
  pointer-events: none;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 12px;
}

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

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

label {
  display: grid;
  gap: 7px;
  color: #304039;
  font-size: 14px;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  color: #304039;
  font-size: 14px;
  margin-bottom: 8px;
}

.gender-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cad4c8;
  border-radius: 8px;
  background: #fff;
  color: #17201b;
  cursor: pointer;
}

.choice input {
  width: auto;
  min-height: 0;
  margin: 0 8px 0 0;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cad4c8;
  border-radius: 8px;
  background: #fff;
  color: #17201b;
  padding: 0 12px;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: #17201b;
  color: #fff;
  cursor: pointer;
  padding: 0 16px;
}

button:disabled {
  background: #98a39a;
  cursor: not-allowed;
}

.privacy-note {
  line-height: 1.7;
  margin-bottom: 0;
}

.face-notice {
  border: 1px solid #d9ded5;
  border-radius: 8px;
  background: #fbfcfa;
  color: #526158;
  font-size: 13px;
  line-height: 1.6;
  padding: 12px;
}

.face-notice.loading {
  border-color: #b8c6d8;
  background: #f0f5fa;
  color: #31506b;
}

.face-notice.ready {
  border-color: #c7d4b5;
  background: #f5f8ef;
  color: #40562c;
}

.face-notice.valid {
  border-color: #9bb79e;
  background: #edf6ee;
  color: #255b35;
}

.face-notice.invalid {
  border-color: #d7aaa0;
  background: #fff1ee;
  color: #8c3528;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 18px;
}

.score-strip > div {
  border: 1px solid #d9ded5;
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.score-strip strong,
.score-strip span {
  display: block;
}

.score-strip strong {
  margin-top: 7px;
  font-size: 18px;
}

.empty-state {
  min-height: 420px;
  display: grid;
  place-content: center;
  text-align: center;
  color: #526158;
}

.empty-state h2 {
  color: #17201b;
}

.result-content {
  display: grid;
  gap: 18px;
}

.summary-block {
  border: 1px solid #d8dfd4;
  border-radius: 8px;
  background: #fbfcfa;
  padding: 18px;
}

.summary-block p:last-child {
  margin-bottom: 0;
  color: #526158;
  line-height: 1.7;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-actions button {
  min-height: 40px;
  background: #315c4c;
}

.advice-block {
  border-top: 1px solid #e3e7df;
  padding-top: 18px;
}

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

.card {
  border: 1px solid #dce2d8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.advice-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.advice-tag {
  width: fit-content;
  border: 1px solid #cbd6cc;
  border-radius: 999px;
  background: #f5f8ef;
  color: #315c4c;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
}

.card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #dfe5dc;
}

.visual {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #eef2ec;
  overflow: hidden;
}

.visual svg {
  display: block;
  width: 100%;
  height: 100%;
}

.card-body {
  padding: 0;
}

.card h3 {
  font-size: 15px;
  margin: 0 0 6px;
}

.card p {
  color: #526158;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 0;
}

.paywall {
  margin-top: 2px;
  padding: 18px;
  border-radius: 8px;
  background: #e8eee8;
  border: 1px solid #cdd9cf;
}

.paywall p {
  margin-bottom: 0;
  color: #526158;
}

.paywall button {
  background: #b04c36;
  min-width: 190px;
}

.action-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 22px;
  color: #334239;
  line-height: 1.7;
}

.action-list li {
  padding-left: 4px;
}

.pay-dialog {
  width: min(720px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: #17201b;
  box-shadow: 0 26px 80px rgba(15, 20, 17, 0.28);
}

.pay-dialog::backdrop {
  background: rgba(20, 27, 24, 0.45);
}

.pay-dialog form {
  padding: 20px;
}

.icon-button {
  width: 36px;
  min-height: 36px;
  border: 1px solid #ccd6ce;
  border-radius: 999px;
  background: #fff;
  color: #17201b;
  font-size: 22px;
  line-height: 1;
  padding: 0;
}

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

.price-grid article {
  display: grid;
  gap: 10px;
  border: 1px solid #d7ded4;
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfa;
}

.plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.plan-head span {
  color: #667066;
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.price-grid h3 {
  margin: 0;
  font-size: 16px;
}

.price-grid strong {
  display: block;
  color: #b04c36;
  font-size: 26px;
}

.price-grid p {
  margin: 0;
  color: #526158;
  font-size: 13px;
  line-height: 1.6;
}

.price-grid button {
  min-height: 42px;
  margin-top: 2px;
  background: #17201b;
}

.plan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.plan-actions button {
  min-width: 0;
  padding: 0 10px;
}

.plan-actions button[data-pay-provider="alipay"] {
  background: #1d6fd8;
}

.featured-plan {
  background: #e8eee8 !important;
  border-color: #9fb39f !important;
}

.dialog-status {
  grid-column: 1 / -1;
  margin: 0;
  color: #526158;
}

.order-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 16px;
  align-items: center;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #cdd9cf;
  border-radius: 8px;
  background: #eef4ee;
}

.order-box h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.order-box p {
  margin: 0 0 8px;
  color: #526158;
  line-height: 1.6;
}

.order-box img {
  width: 140px;
  height: 140px;
  border: 1px solid #d7ded4;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.order-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.order-actions button {
  min-height: 40px;
  background: #315c4c;
}

.pay-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #1d6fd8;
  color: #fff;
  padding: 0 16px;
  text-decoration: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #17201b;
  color: #fff;
  padding: 10px 16px;
  box-shadow: 0 16px 40px rgba(15, 20, 17, 0.22);
  z-index: 20;
}

.legal-footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 12px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  color: #607066;
  font-size: 13px;
  text-align: center;
}

.legal-footer a,
.back-link {
  color: #315c4c;
  text-decoration: none;
}

.legal-footer a:hover,
.back-link:hover {
  text-decoration: underline;
}

.legal-footer a[href*="beian.miit.gov.cn"] {
  flex-basis: 100%;
  text-align: center;
}

.legal-page {
  width: min(880px, calc(100% - 24px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.legal-page h1 {
  margin: 18px 0 10px;
  font-size: clamp(28px, 5vw, 42px);
}

.legal-page h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.legal-page p {
  margin: 0 0 10px;
  color: #3f4c44;
  line-height: 1.8;
}

.legal-page section {
  margin-top: 18px;
  padding: 18px 0;
  border-top: 1px solid #d8e0d8;
}

.legal-meta {
  color: #607066 !important;
  font-size: 14px;
}

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

.mobile-hub .mobile-actions a {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #17201b;
  color: #fff;
  text-decoration: none;
  padding: 0 14px;
  text-align: center;
}

.mobile-qr {
  width: min(240px, 80vw);
  aspect-ratio: 1;
  display: block;
  margin: 8px 0 14px;
  border: 1px solid #d8e0d8;
  border-radius: 8px;
  background: #fff;
}

.support-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.support-form label {
  display: grid;
  gap: 6px;
  color: #29362f;
  font-weight: 700;
}

.support-form input,
.support-form select,
.support-form textarea {
  width: 100%;
  border: 1px solid #cbd6cc;
  border-radius: 8px;
  background: #fff;
  color: #17201b;
  font: inherit;
  font-weight: 500;
  padding: 11px 12px;
}

.support-form textarea {
  resize: vertical;
  min-height: 120px;
}

.support-form button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: #17201b;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.form-status {
  min-height: 24px;
  margin: 0 !important;
  color: #315c4c !important;
  font-weight: 700;
}

.form-status.error {
  color: #b04c36 !important;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 12px;
  }

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

  .input-panel {
    position: static;
  }

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

  .cards,
  .score-strip {
    grid-template-columns: 1fr;
  }

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

  .summary-block {
    align-items: stretch;
    flex-direction: column;
  }

  .summary-actions button {
    flex: 1;
  }

  .paywall button {
    width: 100%;
  }

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

  .order-box {
    grid-template-columns: 1fr;
  }

  .order-box img {
    width: 160px;
    height: 160px;
  }

  .mobile-hub .mobile-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  .brand-row {
    align-items: flex-start;
  }
}
