:root {
  color-scheme: light;
  --ink: #23161a;
  --muted: #7c6b6e;
  --line: #f0d5bd;
  --paper: #ffffff;
  --wash: #fff7eb;
  --accent: #e82735;
  --accent-2: #f3b23f;
  --accent-dark: #a80f25;
  --deep: #3a111b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 214, 94, .42), transparent 28%),
    radial-gradient(circle at 90% 12%, rgba(232, 39, 53, .28), transparent 31%),
    linear-gradient(180deg, #fff0d1 0%, #fff8ed 42%, #fff 100%),
    var(--wash);
  color: var(--ink);
  padding-bottom: 82px;
}

html {
  scroll-behavior: smooth;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(16px, calc((100vw - 960px) / 2 + 16px));
  background: rgba(58, 17, 27, .94);
  color: #ffe9bd;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(58, 17, 27, .18);
  font-size: 14px;
}

.topbar a {
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.shell {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 16px 16px 40px;
}

.hero {
  min-height: 318px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 0 18px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: var(--paper);
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(168, 15, 37, .18);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(44px, 8vw, 72px);
  line-height: 1.05;
  color: var(--deep);
  text-shadow: 0 3px 0 rgba(243, 178, 63, .45);
}

h2 {
  font-size: 22px;
}

.hero p,
.download-panel p,
.panel-head p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.hero-card {
  margin: 24px 0 18px;
  min-height: 92px;
  border: 1px solid rgba(255, 219, 145, .85);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(232, 39, 53, .95), rgba(168, 15, 37, .96)),
    var(--accent);
  box-shadow: 0 18px 46px rgba(168, 15, 37, .24);
}

.hero-card strong {
  font-size: 28px;
  line-height: 1.1;
}

.hero-card span {
  color: #ffe9bd;
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stats span {
  min-height: 46px;
  border: 1px solid rgba(232, 39, 53, .20);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .76);
  color: var(--accent-dark);
  font-weight: 700;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.feature-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .72);
}

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

.feature-strip strong {
  color: var(--deep);
  font-size: 16px;
}

.feature-strip span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.live-preview,
.plan-preview {
  margin-bottom: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.section-head p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.6;
}

.section-head > span {
  border: 1px solid rgba(232, 39, 53, .22);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, .74);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.match-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.match-card {
  min-height: 176px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 14px 34px rgba(58, 17, 27, .09);
}

.match-top,
.match-main,
.plan-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.match-top span {
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  background: var(--deep);
  font-size: 12px;
  font-weight: 900;
}

.match-top strong {
  color: var(--accent-dark);
  font-size: 13px;
}

.match-main {
  min-height: 80px;
  margin-top: 12px;
  text-align: center;
}

.match-main div {
  min-width: 0;
  flex: 1;
}

.match-main b {
  display: block;
  overflow: hidden;
  color: var(--deep);
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-main small {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-main em {
  min-width: 56px;
  color: var(--accent);
  font-size: 23px;
  font-style: normal;
  font-weight: 1000;
}

.match-card p {
  min-height: 42px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.plan-card {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  gap: 12px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 14px 34px rgba(58, 17, 27, .09);
}

.avatar {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #ff4d4d, var(--accent-dark));
  font-weight: 1000;
}

.plan-body {
  min-width: 0;
  flex: 1;
}

.plan-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--deep);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-title span {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.plan-body p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.plan-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.plan-tags span {
  border-radius: 999px;
  padding: 5px 8px;
  color: #7a3311;
  background: #fff2d8;
  font-size: 12px;
  font-weight: 800;
}

.loading-card {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.register-panel,
.download-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 45px rgba(58, 17, 27, .12);
}

.register-panel {
  padding: 22px;
}

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

.panel-head {
  margin-bottom: 18px;
}

#aidBadge {
  border: 1px solid rgba(232, 39, 53, .26);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--accent-dark);
  background: rgba(232, 39, 53, .08);
  font-weight: 700;
  white-space: nowrap;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fffaf2;
  font: inherit;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 39, 53, .12);
}

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

button,
.download,
.ghost-link {
  border: 0;
  border-radius: 8px;
  min-height: 52px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
}

button:disabled {
  opacity: .62;
  cursor: wait;
}

.primary,
.download {
  color: #fff;
  background: linear-gradient(135deg, #ff4d4d, var(--accent-dark));
  box-shadow: 0 12px 24px rgba(168, 15, 37, .22);
}

.ghost {
  color: var(--accent-dark);
  background: rgba(243, 178, 63, .20);
}

.ghost img {
  max-width: 100%;
  max-height: 34px;
}

.ghost-link {
  min-height: 38px;
  color: var(--accent-dark);
  background: rgba(243, 178, 63, .20);
}

.agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.6;
}

.agree input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.notice {
  min-height: 26px;
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.notice[data-type="success"] {
  color: #16704e;
}

.notice[data-type="error"] {
  color: var(--accent-dark);
}

.download-panel {
  margin-top: 16px;
  padding: 18px 20px;
}

.link-panel {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.link-panel a {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .80);
  color: var(--deep);
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(58, 17, 27, .08);
}

.page-shell {
  padding-top: 24px;
}

.page-hero {
  min-height: 210px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid rgba(255, 219, 145, .85);
  border-radius: 8px;
  padding: 24px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(232, 39, 53, .95), rgba(58, 17, 27, .98)),
    var(--accent);
  box-shadow: 0 18px 46px rgba(168, 15, 37, .20);
}

.page-hero h1 {
  color: #fff;
  text-shadow: none;
}

.page-hero p {
  max-width: 620px;
  margin-top: 10px;
  color: #ffe9bd;
  line-height: 1.7;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.content-grid article,
.steps div,
.text-page,
.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 14px 34px rgba(58, 17, 27, .09);
}

.content-grid article {
  min-height: 156px;
  padding: 18px;
}

.content-grid strong,
.steps strong {
  display: block;
  color: var(--deep);
  font-size: 18px;
}

.content-grid p,
.steps p,
.text-page p,
.faq-list p,
.note-list p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.75;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.steps div {
  padding: 18px;
}

.steps span {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  color: #fff;
  background: linear-gradient(135deg, #ff4d4d, var(--accent-dark));
  font-weight: 900;
}

.note-list {
  display: grid;
  gap: 8px;
}

.note-list p {
  margin: 0;
  padding-left: 14px;
  border-left: 3px solid var(--accent-2);
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.faq-list details {
  padding: 0 18px;
}

.faq-list summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--deep);
  font-weight: 900;
}

.faq-list p {
  margin: 0;
  padding: 0 0 18px;
}

.text-page {
  margin-top: 16px;
  padding: 22px;
}

.text-page h2 {
  margin-top: 22px;
}

.text-page h2:first-child {
  margin-top: 0;
}

.bottom-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px max(16px, calc((100vw - 960px) / 2 + 16px)) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .90);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}

.bottom-cta a {
  min-height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-weight: 900;
}

.bottom-cta a:first-child {
  color: var(--accent-dark);
  background: #fff2d8;
}

.bottom-cta a:last-child {
  color: #fff;
  background: linear-gradient(135deg, #ff4d4d, var(--accent-dark));
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdfd;
}

.metric-grid span {
  display: block;
  font-size: 28px;
  font-weight: 900;
}

pre {
  margin-top: 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #101820;
  color: #d8f3ed;
}

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

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

  .stats,
  .metric-grid,
  .feature-strip,
  .match-list,
  .content-grid,
  .steps,
  .link-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .row,
  .download-panel {
    grid-template-columns: 1fr;
  }

  .download-panel {
    align-items: stretch;
  }

  .topnav {
    gap: 10px;
  }

  .page-hero {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 430px) {
  .topbar {
    height: 42px;
  }

  .shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero {
    min-height: 300px;
    padding-top: 16px;
  }

  .brand {
    gap: 12px;
  }

  .logo {
    width: 60px;
    height: 60px;
  }

  h1 {
    font-size: 42px;
  }

  .topbar span {
    display: none;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  .hero-card strong {
    font-size: 24px;
  }

  .register-panel {
    padding: 18px 14px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .row {
    grid-template-columns: 1fr 104px;
    gap: 8px;
  }

  .feature-strip,
  .match-list,
  .content-grid,
  .steps,
  .link-panel {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  button,
  .download,
  input {
    min-height: 50px;
  }
}
