:root {
  --bg: #eef2f5;
  --panel: #ffffff;
  --ink: #1d3c59;
  --muted: #4f6d87;
  --line: #d8e4ee;
  --soft-card: #e4edf4;
  --blue: #1f9ee8;
  --green: #36caa0;
  --shadow: 0 20px 48px -30px rgba(24, 56, 87, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(31, 158, 232, 0.15), transparent 42%),
    radial-gradient(circle at 90% 100%, rgba(54, 202, 160, 0.15), transparent 40%),
    var(--bg);
}

.page-glow {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(42px);
}

.glow-a {
  width: 320px;
  height: 320px;
  top: -90px;
  left: -90px;
  background: rgba(31, 158, 232, 0.24);
}

.glow-b {
  width: 360px;
  height: 360px;
  right: -100px;
  bottom: -120px;
  background: rgba(54, 202, 160, 0.24);
}

.app-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(8px);
  min-height: 100vh;
}

.view {
  display: none;
  padding: 20px 16px 26px;
  animation: rise 200ms ease;
}

.view-active {
  display: block;
}

.verify-card {
  margin: 24px auto 0;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 20px 14px 16px;
}

.verify-title {
  margin: 0;
  font-size: clamp(1.35rem, 6vw, 2rem);
  line-height: 1.3;
}

.verify-desc {
  margin: 10px 0 14px;
  color: #456583;
  line-height: 1.6;
}

.verify-input {
  width: 100%;
  height: 54px;
  border-radius: 12px;
  border: 1px solid #cfdde9;
  background: #fbfdff;
  color: var(--ink);
  padding: 0 14px;
  font-size: 1.05rem;
  font-weight: 600;
  outline: none;
}

.verify-input:focus {
  border-color: #7abde4;
  box-shadow: 0 0 0 3px rgba(31, 158, 232, 0.15);
}

.verify-btn {
  margin-top: 12px;
  width: 100%;
}

.verify-tip {
  margin: 10px 0 0;
  min-height: 24px;
  color: #e15353;
  font-weight: 700;
}

.home-header-icon {
  width: 96px;
  height: 96px;
  margin: 0 auto 14px;
  border-radius: 24px;
  background: linear-gradient(135deg, #2da3ec, #44c9a5);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px -12px rgba(31, 158, 232, 0.45);
}

.home-header-icon svg {
  width: 52px;
  height: 52px;
  stroke: #fff;
}

.hero-title {
  margin: 0;
  text-align: center;
  font-size: clamp(1.58rem, 6.2vw, 2.35rem);
  line-height: 1.25;
}

.home-intro {
  margin: 16px 0 0;
}

.home-intro p {
  margin: 0 0 12px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #2f4f6e;
}

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

.feature-card {
  margin: 0;
  border-radius: 16px;
  background: var(--soft-card);
  border: 1px solid #d4e1eb;
  padding: 14px 10px 16px;
  text-align: center;
}

.feature-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  line-height: 1;
}

.feature-blue .feature-icon {
  background: rgba(31, 158, 232, 0.16);
  color: var(--blue);
}

.feature-green .feature-icon {
  background: rgba(54, 202, 160, 0.16);
  color: var(--green);
}

.feature-card h3 {
  margin: 0;
  font-size: clamp(1.15rem, 4.8vw, 2rem);
}

.feature-card p {
  margin: 6px 0 0;
  font-size: clamp(0.92rem, 3.3vw, 1.05rem);
  color: #3f607e;
}

.feature-blue h3 {
  color: var(--blue);
}

.feature-green h3 {
  color: var(--green);
}

.quiz-head {
  margin-bottom: 12px;
}

.counter {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #4e6a84;
  font-weight: 700;
}

.progress-wrap {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #d5e3ef;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 3.333%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 220ms ease;
}

.quiz-card {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.question-title {
  margin: 0 0 14px;
  font-size: clamp(1.28rem, 5vw, 1.72rem);
  line-height: 1.48;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  width: 100%;
  min-height: 64px;
  border: 1px solid #cfdde9;
  border-radius: 14px;
  background: #fbfdff;
  color: var(--ink);
  padding: 12px 13px;
  text-align: left;
  font-size: 1.02rem;
  line-height: 1.5;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    transform 120ms ease,
    background-color 140ms ease;
}

.option:hover {
  border-color: #90bfdf;
}

.option:active {
  transform: translateY(1px);
}

.option-selected {
  border-color: var(--blue);
  background: linear-gradient(
    180deg,
    rgba(31, 158, 232, 0.13),
    rgba(54, 202, 160, 0.14)
  );
}

.quiz-actions {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding-top: 10px;
  display: flex;
  gap: 8px;
  background: linear-gradient(
    180deg,
    rgba(238, 242, 245, 0),
    rgba(238, 242, 245, 0.94) 45%,
    rgba(238, 242, 245, 1)
  );
}

.btn {
  border: 0;
  border-radius: 14px;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 0 14px;
  height: 56px;
  cursor: pointer;
  transition:
    transform 120ms ease,
    opacity 120ms ease,
    filter 120ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  flex: 1;
  color: #fff;
  background: linear-gradient(90deg, #209de7, #42caa5);
  box-shadow: 0 8px 20px -12px rgba(31, 158, 232, 0.58);
}

.btn-ghost {
  flex: 0 0 34%;
  color: #31506d;
  background: #dfeaf2;
}

#start-btn {
  margin-top: 16px;
  width: 100%;
  height: 64px;
  font-size: 1.95rem;
}

.result-top {
  text-align: center;
  padding: 4px 0 14px;
}

.result-main-title {
  margin: 0;
  color: #27a8dd;
  font-size: clamp(1.7rem, 6.2vw, 2.65rem);
}

.result-subtitle {
  margin: 8px 0 0;
  color: #476683;
  font-size: 1.4rem;
}

.result-hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px 14px;
  text-align: center;
}

.result-city-icon {
  width: 132px;
  height: 132px;
  margin: 0 auto 16px;
  border-radius: 26px;
  background: linear-gradient(135deg, #2da3ec, #44c9a5);
  display: grid;
  place-items: center;
}

.result-city-icon svg {
  width: 62px;
  height: 62px;
  stroke: #fff;
}

.match-chip {
  width: fit-content;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: #dbeee8;
  color: #34bb97;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 8px 18px;
}

.best-score {
  margin: 0;
  color: #27a8dd;
  font-size: clamp(3.3rem, 14vw, 5rem);
  font-weight: 800;
  line-height: 1;
}

.best-city {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 1.2;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tag-row-persona {
  margin-top: 6px;
}

.tag-row-city {
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-persona {
  color: #193c59;
  background: #d7e9f2;
  border: 2px solid #96d2eb;
  padding: 9px 18px;
  font-size: 1.05rem;
}

.tag-city {
  color: #0f4d67;
  background: #3ac9a8;
  border: 2px solid #33bf9f;
  padding: 7px 16px;
  font-size: 1rem;
}

.wuxing-panel {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid #c9dbe7;
  background: #f1f7fb;
  padding: 10px 12px;
}

.wuxing-line {
  margin: 0;
  color: #355875;
  font-size: 1.02rem;
  line-height: 1.55;
}

.reason-card {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid #cfe0eb;
  background: #e9f1f7;
  padding: 14px;
}

.reason-card h4 {
  margin: 0 0 10px;
  font-size: 1.75rem;
}

.best-desc {
  margin: 0;
  color: #2f4f6c;
  line-height: 1.72;
  font-size: 1.26rem;
}

.wuxing-legend-card {
  margin-top: 12px;
  border-radius: 16px;
  border: 1px solid #cfe0eb;
  background: #f4f9fc;
  padding: 14px;
}

.wuxing-legend-card h4 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.wuxing-legend-card p {
  margin: 0;
  color: #3e5f7d;
  line-height: 1.7;
  font-size: 1rem;
}

.wuxing-relation {
  margin: 6px 0 0;
  font-weight: 700;
  font-size: 1.06rem;
}

.wuxing-relation-same {
  color: #247ab1;
}

.wuxing-relation-sheng {
  color: #2fa980;
}

.wuxing-relation-ke {
  color: #d56a3e;
}

.other-section {
  margin-top: 16px;
}

.list-title {
  margin: 0 0 10px;
  text-align: center;
  font-size: 2.2rem;
}

.other-cities {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.city-item {
  border-radius: 16px;
  border: 1px solid #c9dbe7;
  background: #f8fbfe;
  padding: 12px;
}

.city-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.city-item h5 {
  margin: 0;
  font-size: 1.9rem;
}

.city-match-badge {
  border-radius: 999px;
  background: #e3f1ea;
  color: #39bf9a;
  font-weight: 800;
  font-size: 1.85rem;
  padding: 6px 14px;
  line-height: 1;
}

.city-pill-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.city-wuxing-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border-radius: 999px;
  font-weight: 700;
  padding: 6px 12px;
  white-space: nowrap;
}

.pill-persona {
  color: #1f3d58;
  border: 1px solid #93cee8;
  background: #d8eaf3;
  font-size: 1.05rem;
}

.pill-city {
  color: #15394f;
  border: 1px solid #c5d8e6;
  background: #f1f6fa;
  font-size: 1.04rem;
}

.pill-wuxing {
  color: #274d67;
  border: 1px solid #a6c6da;
  background: #e8f3fa;
  font-size: 1rem;
}

.pill-relation {
  font-size: 0.98rem;
}

.pill-relation-same {
  color: #206e9f;
  border: 1px solid #8cc2e0;
  background: #dff0fb;
}

.pill-relation-sheng {
  color: #2a8f70;
  border: 1px solid #94d6bf;
  background: #e3f7ef;
}

.pill-relation-ke {
  color: #ba643e;
  border: 1px solid #ebc4b1;
  background: #fdf0e9;
}

.city-reason {
  margin: 10px 0 0;
  color: #426581;
  line-height: 1.65;
  font-size: 1.22rem;
}

#retry-btn {
  margin-top: 14px;
  width: 100%;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 760px) {
  .app-shell {
    margin: 24px auto;
    min-height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .view {
    padding: 26px 22px;
  }

  .result-subtitle {
    font-size: 1.95rem;
  }

  .best-desc {
    font-size: 1.42rem;
  }

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

  .city-item h5 {
    font-size: 2.1rem;
  }
}

@media (max-width: 500px) {
  .result-subtitle {
    font-size: 1.08rem;
  }

  .list-title {
    font-size: 1.8rem;
  }

  .reason-card h4 {
    font-size: 1.55rem;
  }

  .best-desc {
    font-size: 1.05rem;
  }

  .city-item h5 {
    font-size: 1.55rem;
  }

  .city-match-badge {
    font-size: 1.25rem;
  }

  .city-reason {
    font-size: 1rem;
  }
}

@media (max-width: 370px) {
  .home-feature-grid {
    grid-template-columns: 1fr;
  }

  .btn-ghost {
    flex-basis: 40%;
  }
}
