:root {
  --bg: #f4eee6;
  --bg-deep: #ebe3d6;
  --ink: #1b1612;
  --muted: #74685e;
  --card: #fffdf9;
  --line: #e7d8c6;
  --wine: #8b2348;
  --wine-deep: #54162e;
  --rose: #c45c6a;
  --gold: #c4a574;
  --gold-soft: #f3e6cf;
  --sage: #2f6f5e;
  --sage-soft: #e4f0eb;
  --danger: #9d0208;
  --shadow: 0 16px 40px rgba(84, 22, 46, 0.09);
  --radius: 22px;
  --sans: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --serif: "Palatino Linotype", Palatino, "Iowan Old Style", "Songti SC", "STSong", serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; color: var(--ink);
  font-family: var(--sans);
  min-height: 100%;
  background: var(--bg);
}
html[lang="zh-CN"] body { font-size: 16.5px; letter-spacing: 0.01em; }
body {
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 12% -10%, rgba(196, 165, 116, 0.28), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(139, 35, 72, 0.12), transparent 36%),
    linear-gradient(180deg, #f8f2ea 0%, var(--bg) 28%, #efe6d8 100%);
  background-attachment: fixed;
}
body.auth-mode { padding-bottom: env(safe-area-inset-bottom); }
body.invite-mode {
  background: #eef0f3 !important;
  min-height: 100vh;
}
body.invite-mode .topbar { display: none !important; }
body.invite-mode main {
  max-width: 760px;
  padding: 18px 16px 40px;
}

.land { width: 100%; }
.land-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
  min-height: 44px;
}
.land-logo {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.03em;
  color: #222;
  position: relative;
}
.land-dot {
  display: inline-block;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--wine);
  margin-left: 2px;
  vertical-align: super;
}
.land-lang {
  position: absolute;
  right: 0;
  top: 4px;
  display: flex; align-items: center; gap: 0;
  background: #fff; border: 1px solid #d8dde3; border-radius: 10px;
  overflow: hidden;
}
.land-lang button {
  border: 0; background: #fff; color: #333;
  padding: 8px 12px; font-weight: 700; font-size: 13px; cursor: pointer;
}
.land-lang button.active { background: #f4f6f8; }
.land-lang-split { width: 1px; height: 22px; background: #d8dde3; }

.land-hero {
  background: #4f8fd0;
  border-radius: 8px;
  padding: 28px 18px 22px;
  text-align: center;
  color: #fff;
}
.land-safe {
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(26px, 4.4vw, 36px);
  line-height: 1.2;
  margin: 0 0 22px;
  color: #fff;
  letter-spacing: -0.02em;
}
.land-photos {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
}
.land-photo {
  position: relative;
  width: 22%;
  max-width: 140px;
  aspect-ratio: 3/4;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.18);
  background: #222;
}
.land-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.land-photo.p2,
.land-photo.p3 {
  width: 24%;
  max-width: 152px;
}
.land-check {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%;
  background: #3aa0d6;
  color: #fff; font-size: 16px; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.land-ask { text-align: center; padding: 28px 4px 0; }
.land-ask h2 {
  font-family: var(--sans);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  color: #3a3a3a;
  margin: 0 0 18px;
}
.land-choices {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 22px;
}
.land-choice {
  border: 0;
  background: #fff;
  color: #333;
  border-radius: 999px;
  padding: 16px 10px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.land-choice.on {
  outline: 2px solid #4f8fd0;
  color: #1d4f80;
}
.land-ages {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin: 8px 0 22px;
  font-size: 16px;
  color: #333;
  font-weight: 600;
}
.land-ages select {
  flex: 1;
  max-width: none;
  background: #fff;
  border: 1px solid #d5d8de;
  border-radius: 8px;
  padding: 12px 10px;
}
.land-dash { color: #888; }
.land-next {
  background: #e31c3d;
  box-shadow: none;
  border-radius: 8px;
  font-size: 20px;
  padding: 16px;
}
.land-next:hover { filter: brightness(1.05); }
.land-login { margin-top: 14px; }

@media (max-width: 560px) {
  .land-photos { flex-wrap: wrap; max-width: 340px; margin: 0 auto; }
  .land-photo,
  .land-photo.p2,
  .land-photo.p3 { width: calc(50% - 8px); max-width: 150px; }
  .land-choices { grid-template-columns: 1fr; }
  .land-choice { padding: 14px; }
  .land-ages { flex-wrap: wrap; }
  .land-ages span:first-child { width: 100%; text-align: left; }
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(255, 253, 249, 0.86);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(231, 216, 198, 0.8);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; color: #fff; font-size: 16px;
  background: linear-gradient(145deg, var(--wine), var(--wine-deep));
  box-shadow: 0 8px 16px rgba(84, 22, 46, 0.22);
}
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 18px; line-height: 1.1; }
.brand-sub { color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch {
  display: flex; padding: 3px; border-radius: 999px;
  background: #f3ebe1; border: 1px solid var(--line);
}
.lang-switch button {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; cursor: pointer;
}
.lang-switch button.active { background: #fff; color: var(--wine-deep); box-shadow: 0 2px 8px rgba(84,22,46,0.08); }
.ghost-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: 12px; cursor: pointer;
}
.ghost-btn.hidden, .hidden { display: none !important; }

main { max-width: 980px; margin: 0 auto; padding: 18px 16px 24px; }
body:not(.auth-mode) main { max-width: 760px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
h1, .serif { font-family: var(--serif); }
h1 { font-size: 28px; margin: 0 0 10px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 0 0 8px; }
h3 { margin: 0 0 6px; font-size: 15px; }
p.sub, .sub { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 14px; }

.hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: center;
  padding: 18px 6px 10px;
}
.kicker {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--wine); font-weight: 700; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 12px;
}
.hero-title {
  font-family: var(--serif); font-size: clamp(34px, 5vw, 54px); line-height: 1.08;
  margin: 0 0 14px; color: var(--wine-deep);
}
.hero-sub { color: var(--muted); font-size: 16px; line-height: 1.65; max-width: 520px; margin: 0 0 22px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-ctas .btn, .hero-ctas .btn.secondary { width: auto; min-width: 180px; margin-top: 0; }
.hero-art {
  position: relative; min-height: 280px;
}
.float-card {
  position: absolute; background: #fff; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 12px; width: 180px;
}
.float-card img, .float-photo {
  width: 100%; height: 150px; object-fit: cover; border-radius: 14px; background: var(--gold-soft);
  display: block;
}
.float-a { top: 8px; right: 18px; transform: rotate(4deg); }
.float-b { left: 8px; bottom: 8px; transform: rotate(-6deg); width: 160px; }
.match-pill {
  position: absolute; right: -8px; bottom: 18px;
  background: var(--sage); color: #fff; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800;
}
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.trust-chip {
  background: rgba(255,255,255,0.7); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 600;
}

.section { padding: 28px 0 8px; }
.section-title { font-family: var(--serif); text-align: center; font-size: 28px; margin: 0 0 8px; }
.section-lead { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 22px; }

.steps-grid, .features-grid, .inspired-grid {
  display: grid; gap: 14px;
}
.steps-grid { grid-template-columns: repeat(4, 1fr); }
.features-grid { grid-template-columns: repeat(2, 1fr); }
.inspired-grid { grid-template-columns: repeat(5, 1fr); }
.step, .feature, .inspired {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px;
  box-shadow: 0 8px 20px rgba(84,22,46,0.04);
}
.step-num, .inspired-num {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--wine); color: #fff; font-size: 12px; font-weight: 800; margin-bottom: 10px;
}
.inspired h3 { font-size: 14px; }
.inspired p, .step p, .feature p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; }

.safety-banner {
  display: flex; gap: 16px; align-items: flex-start;
  background: linear-gradient(135deg, #fff8f2, #f4efe4);
  border: 1px solid var(--line); border-radius: 20px; padding: 18px;
}
.safety-banner button { width: auto; margin-top: 10px; }

.join-heading { text-align: center; margin: 28px 0 12px; }
.join-heading h2 { font-family: var(--serif); font-size: 26px; }
.auth-card { max-width: 560px; margin: 0 auto 24px; }
.wizard-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.wizard-dot {
  flex: 1; height: 6px; border-radius: 99px; background: #eadfd0;
}
.wizard-dot.on { background: linear-gradient(90deg, var(--gold), var(--wine)); }
.wizard-label { color: var(--muted); font-size: 13px; margin-bottom: 12px; font-weight: 600; }

label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 5px; color: #4e433c; }
input, select, textarea {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 16px; background: #fffaf4; color: var(--ink); font-family: inherit;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(139,35,72,0.35); border-color: var(--wine); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.check-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 600;
}
.check-chip input { width: 16px; height: 16px; }

.btn {
  display: inline-block; width: 100%; padding: 13px 16px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--wine), var(--wine-deep)); color: white;
  font-size: 15px; font-weight: 800; margin-top: 16px;
  box-shadow: 0 10px 20px rgba(84, 22, 46, 0.22);
  cursor: pointer;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; box-shadow: none; }
.btn.secondary { background: #f3ebe1; color: var(--wine-deep); box-shadow: none; }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; margin-top: 0; }
.btn.danger { background: #fde2e4; color: var(--danger); box-shadow: none; }
.btn.land-next {
  background: #e31c3d;
  box-shadow: none;
  border-radius: 8px;
  font-size: 20px;
  padding: 16px;
  margin-top: 0;
}
.linkbtn { background: none; border: none; color: var(--wine); font-weight: 700; font-size: 14px; padding: 0; cursor: pointer; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.error { background: #fde2e4; color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-top: 12px; }
.success { background: var(--sage-soft); color: #1b4332; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-top: 12px; }
.notice { background: var(--gold-soft); color: #6a4b16; padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-top: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

.photo-picker { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.photo-preview {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  background: var(--gold-soft); border: 3px dashed var(--line); flex-shrink: 0;
}
.photo-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.photo-actions .btn { margin-top: 0; }

.filter-bar {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 8px; align-items: end;
}
.filter-bar label { margin-top: 0; }
.quiz-banner {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  background: linear-gradient(135deg, #fff7ea, #f7e7ee); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 16px;
}
.quiz-banner .btn { width: auto; margin: 0; }

.featured {
  position: relative; overflow: hidden; padding: 0;
  background: linear-gradient(160deg, #54162e, #8b2348 55%, #c45c6a);
  color: #fff; border: 0;
}
.featured-body { padding: 18px; }
.featured .kicker { color: #f3e6cf; }
.featured h2 { font-family: var(--serif); font-size: 26px; margin: 4px 0 8px; color: #fff; }
.featured p { color: rgba(255,255,255,0.82); margin: 0 0 12px; }
.compat-ring {
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 13px;
  background: conic-gradient(#f3e6cf var(--p), rgba(255,255,255,0.18) 0);
  color: #fff; flex-shrink: 0;
}
.compat-ring span {
  width: 44px; height: 44px; border-radius: 50%; background: #54162e;
  display: grid; place-items: center;
}
.compat-ring.light { color: var(--wine-deep); }
.compat-ring.light span { background: #fff; }

.profile-card { padding: 0; overflow: hidden; }
.profile-photo { width: 100%; aspect-ratio: 4/5; object-fit: cover; background: var(--gold-soft); display: block; }
.profile-body { padding: 14px 16px 16px; }
.profile-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.profile-name { font-family: var(--serif); font-weight: 700; font-size: 24px; line-height: 1.1; }
.profile-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip {
  background: #f6eee4; color: #5b4634; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 700;
}
.chip.intent { background: #f7e7ee; color: var(--wine); }
.chip.lang { background: var(--sage-soft); color: var(--sage); }
.prompt-quote {
  background: #fbf6ef; border-left: 3px solid var(--gold); padding: 10px 12px; border-radius: 0 12px 12px 0;
  margin: 10px 0; font-size: 14px; line-height: 1.45;
}
.prompt-quote b { display: block; color: var(--muted); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 4px; }
.like-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.like-btn {
  border: 0; width: 52px; height: 52px; border-radius: 50%;
  background: #f3ebe1; color: var(--wine); font-size: 22px; cursor: pointer;
}
.like-btn.on { background: var(--wine); color: #fff; box-shadow: 0 8px 16px rgba(84,22,46,0.25); }

.submit-bar {
  position: sticky; bottom: calc(68px + env(safe-area-inset-bottom));
  background: rgba(244, 238, 230, 0.92); backdrop-filter: blur(10px);
  padding: 10px 0 6px; margin: 0 -4px;
}
.count-pill {
  display: inline-block; background: var(--wine); color: white; border-radius: 20px;
  padding: 2px 9px; font-size: 12px; margin-left: 6px;
}

.match-card { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; }
.match-card img, .avatar {
  width: 84px; height: 84px; border-radius: 20px; object-fit: cover; background: var(--gold-soft);
}
.icebreaker {
  background: var(--gold-soft); color: #5b4014; border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-top: 8px;
}
.wechat-box {
  background: #1b1612; color: #f8f2ea; border-radius: 12px; padding: 10px 12px; margin-top: 8px; font-family: ui-monospace, monospace;
}

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty .big { font-size: 42px; margin-bottom: 8px; }

.toast {
  position: fixed; bottom: calc(86px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: #1b1612; color: white; padding: 10px 18px; border-radius: 30px;
  font-size: 14px; z-index: 50; box-shadow: 0 4px 14px rgba(0,0,0,0.2); max-width: 90%;
}
.toast.hidden { display: none; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.badge.admin { background: var(--gold-soft); color: #8a5a12; }
.codebox { background: #1b1612; color: #f3e6ea; padding: 12px; border-radius: 10px; font-family: monospace; font-size: 14px; letter-spacing: 1px; word-break: break-all; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,253,249,0.94); border-top: 1px solid var(--line); backdrop-filter: blur(16px);
}
.tabbar.admin-on { grid-template-columns: repeat(4, 1fr); }
.tabbtn {
  border: 0; background: transparent; color: var(--muted); border-radius: 14px;
  padding: 8px 6px; font-weight: 800; font-size: 11px; cursor: pointer;
}
.tabbtn.active { background: #f7e7ee; color: var(--wine-deep); }

.profile-hero { text-align: center; }
.profile-hero img {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 12px;
  border: 4px solid #fff; box-shadow: var(--shadow);
}
.dl { display: grid; gap: 8px; }
.declare-box {
  margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px;
  background: #fffaf4; font-size: 13px; line-height: 1.55; color: var(--muted);
}
.declare-box strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 8px; }
.consent-line {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 10px;
  font-weight: 600; color: var(--ink); font-size: 13px;
}
.consent-line input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
.rank-badge {
  position: absolute; top: 12px; left: 12px; z-index: 1;
  background: var(--wine); color: #fff; font-weight: 800; font-size: 12px;
  padding: 6px 10px; border-radius: 999px; letter-spacing: 0.02em;
}
.recommended-card { position: relative; }
.reason-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.dl div { display: grid; grid-template-columns: 140px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.dl dt { color: var(--muted); font-weight: 700; }

.quiz-grid { display: grid; gap: 12px; }
.quiz-q {
  border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: #fffaf4;
}
.quiz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.quiz-opts label {
  margin: 0; font-weight: 600; border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  background: #fff; display: flex; align-items: center; gap: 8px;
}
.quiz-opts input { width: 16px; height: 16px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 220px; display: none; }
  .inspired-grid { grid-template-columns: 1fr 1fr; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .row3 { grid-template-columns: 1fr 1fr; }
  .quiz-banner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .features-grid, .inspired-grid { grid-template-columns: 1fr; }
  .dl div { grid-template-columns: 1fr; gap: 2px; }
  .hero-title { font-size: 34px; }
  .quiz-opts { grid-template-columns: 1fr; }
}
