:root{
  --bg:#1c130e;
  --paper:#fdf6ec;
  --paper2:#f9eedf;
  --ink:#24170f;
  --muted:#6c5242;
  --brown:#8b5a3c;
  --brown2:#a36b48;
  --line:rgba(36,23,15,.12);
  --shadow: 0 18px 50px rgba(15,11,8,.22);
  --shadow2: 0 10px 26px rgba(15,11,8,.16);
  --radius: 18px;
  --radius2: 14px;
  --focus: 0 0 0 3px rgba(139,90,60,.22);
  --start-bg: #f5ebe0;
  --card-white: #ffffff;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(163,107,72,.22), transparent 60%),
              radial-gradient(900px 500px at 90% 20%, rgba(139,90,60,.20), transparent 55%),
              radial-gradient(900px 700px at 60% 100%, rgba(163,107,72,.18), transparent 55%),
              var(--bg);
  color:var(--ink);
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
}

.bg-ink{
  position:fixed; inset:0;
  background:
    linear-gradient(180deg, rgba(15,11,8,.28), rgba(15,11,8,.10) 40%, rgba(15,11,8,.30));
  pointer-events:none;
  opacity:.75;
}

.container{
  width:min(980px, calc(100% - 32px));
  margin:0 auto;
}

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter: blur(12px);
  background: rgba(247,237,225,.88);
  border-bottom: 1px solid rgba(36,23,15,.06);
}
.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 0;
}

.brand{display:flex; align-items:center; gap:12px; color: var(--paper)}
.brand__mark{
  width:42px; height:42px;
  border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(180deg, rgba(163,107,72,.75), rgba(139,90,60,.85));
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-family:"ZCOOL XiaoWei","Noto Serif SC",serif;
  font-size:22px;
  letter-spacing:.06em;
}
.brand__title{
  font-family:"ZCOOL XiaoWei","Noto Serif SC",serif;
  font-size:18px;
  letter-spacing:.06em;
  line-height:1.2;
}
.brand__sub{
  font-size:12px;
  color: rgba(251,244,234,.75);
  line-height:1.2;
}
.topbar__meta{
  color: rgba(251,244,234,.78);
  font-size:12px;
  display:flex;
  align-items:center;
  gap:10px;
  white-space:nowrap;
}

body.page-start .topbar{
  display:none;
}
body.page-start .bg-ink{
  display:none;
}
body.page-start{
  background: var(--start-bg);
}
body.page-start .footer__note{
  color:var(--muted);
}

.card{
  margin:22px 0 26px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--paper), var(--paper2));
  box-shadow: var(--shadow);
  border: 1px solid rgba(36,23,15,.08);
  overflow:hidden;
}

.start-page{
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:20px 16px 32px;
}
.start-page.card{
  background:transparent;
  box-shadow:none;
  border:none;
}
.start-card{
  width:100%;
  max-width:520px;
  background: var(--card-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(36,23,15,.06);
  padding:48px 32px 44px;
  text-align:center;
}
.start-card__title{
  font-family:"ZCOOL XiaoWei","Noto Serif SC",serif;
  font-size:26px;
  font-weight:800;
  letter-spacing:.06em;
  color:var(--ink);
  margin:0 0 14px;
  line-height:1.3;
}
.start-card__sub{
  font-size:15px;
  color:var(--muted);
  line-height:1.7;
  margin:0 0 8px;
}
.start-card__hint{
  font-size:14px;
  color:var(--muted);
  line-height:1.6;
  margin:0 0 28px;
}
.start-card__buttons{
  display:flex;
  gap:20px;
  justify-content:center;
  flex-wrap:wrap;
}
.btn--gender{
  min-width:140px;
  padding:14px 28px;
  border-radius:999px;
  font-size:18px;
  font-weight:700;
  letter-spacing:.08em;
  background: linear-gradient(180deg, var(--brown2), var(--brown));
  color:var(--paper);
  border:1px solid rgba(36,23,15,.2);
  box-shadow: 0 8px 24px rgba(139,90,60,.28);
  cursor:pointer;
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
}
.btn--gender:hover{
  filter:brightness(1.06);
  box-shadow: 0 10px 28px rgba(139,90,60,.32);
}
.btn--gender:active{
  transform:translateY(1px);
}
.btn--gender:focus-visible{
  outline:none;
  box-shadow: 0 0 0 3px rgba(139,90,60,.35);
}

.card__inner{padding:20px}

.hero{
  padding:22px 22px 16px;
  background:
    radial-gradient(700px 220px at 10% 0%, rgba(163,107,72,.18), transparent 60%),
    radial-gradient(640px 260px at 90% 10%, rgba(139,90,60,.12), transparent 55%);
  border-bottom: 1px solid var(--line);
}
.hero__title{
  font-family:"ZCOOL XiaoWei","Noto Serif SC",serif;
  font-size:26px;
  letter-spacing:.08em;
  margin:0 0 6px;
}
.hero__desc{margin:0; color: var(--muted); line-height:1.7; font-size:14px}

.row{display:flex; gap:14px; flex-wrap:wrap}
.row--space{justify-content:space-between; align-items:center}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(36,23,15,.10);
  background: rgba(251,244,234,.9);
  box-shadow: var(--shadow2);
}
.pill__k{color:var(--muted); font-size:12px}
.pill__v{font-weight:700; font-size:12px}

.btn{
  appearance:none;
  border: 1px solid rgba(36,23,15,.16);
  background: linear-gradient(180deg, rgba(163,107,72,.92), rgba(139,90,60,.96));
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 14px;
  cursor:pointer;
  font-weight:700;
  letter-spacing:.03em;
  box-shadow: 0 12px 26px rgba(15,11,8,.18);
  transition: transform .08s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover{filter:brightness(1.03)}
.btn:active{transform: translateY(1px)}
.btn:focus-visible{outline:none; box-shadow: var(--shadow2), var(--focus)}
.btn[disabled]{opacity:.55; cursor:not-allowed; filter:saturate(.75)}

.btn--ghost{
  background: transparent;
  color: var(--brown);
  border-color: rgba(139,90,60,.24);
  box-shadow:none;
}
.btn--ghost:hover{background: rgba(139,90,60,.06)}

.btn--flat{
  background: rgba(36,23,15,.04);
  color: var(--ink);
  border-color: rgba(36,23,15,.10);
  box-shadow:none;
}
.btn--flat:hover{background: rgba(36,23,15,.06)}

.grid2{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:16px;
}

.panel{
  border-radius: var(--radius2);
  background: rgba(251,244,234,.9);
  border: 1px solid rgba(36,23,15,.08);
  box-shadow: var(--shadow2);
  padding:16px;
}
.panel__title{margin:0 0 8px; font-weight:800; letter-spacing:.03em}
.panel__muted{margin:0; color:var(--muted); line-height:1.75; font-size:13px}

.select{
  width:100%;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(36,23,15,.14);
  background: rgba(251,244,234,.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  font-size:14px;
}
.select:focus{outline:none; box-shadow: var(--focus)}

.progress{
  height:10px;
  border-radius:999px;
  background: rgba(36,23,15,.08);
  overflow:hidden;
  border: 1px solid rgba(36,23,15,.08);
}
.progress__bar{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(163,107,72,.92), rgba(139,90,60,.98));
}

.q-title{
  font-family:"ZCOOL XiaoWei","Noto Serif SC",serif;
  margin:0 0 12px;
  font-size:20px;
  letter-spacing:.06em;
}

.options{
  display:grid;
  gap:10px;
}
.opt{
  width:100%;
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(36,23,15,.10);
  background: rgba(251,244,234,.9);
  cursor:pointer;
  box-shadow: var(--shadow2);
  text-align:left;
}
.opt:hover{background: rgba(163,107,72,.07)}
.opt__label{line-height:1.55; font-size:14px}
.opt--active{
  border-color: rgba(139,90,60,.40);
  box-shadow: var(--shadow2), 0 0 0 3px rgba(139,90,60,.12);
}

.actions{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
}
.actions__left,.actions__right{display:flex; gap:10px; flex-wrap:wrap; align-items:center}

.dialog{
  border:none;
  padding:0;
  background: transparent;
}
.dialog::backdrop{
  background: rgba(15,11,8,.55);
  backdrop-filter: blur(2px);
}
.dialog__panel{
  width:min(760px, calc(100vw - 26px));
  margin: 10vh auto 0;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--paper), var(--paper2));
  border: 1px solid rgba(36,23,15,.10);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.dialog__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.dialog__title{
  font-family:"ZCOOL XiaoWei","Noto Serif SC",serif;
  font-size:18px;
  letter-spacing:.06em;
}
.dialog__sub{font-size:12px; color:var(--muted); margin-top:2px}
.dialog__body{padding:14px 16px 18px}
.filled-grid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap:10px;
}
.jump{
  padding:10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(36,23,15,.12);
  background: rgba(251,244,234,.9);
  box-shadow: var(--shadow2);
  cursor:pointer;
}
.jump:hover{background: rgba(163,107,72,.07)}
.jump:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
}
.jump:disabled:hover{background: rgba(251,244,234,.9)}
.jump--done{
  border-color: rgba(139,90,60,.35);
}
.jump__n{font-weight:800}
.jump__s{font-size:12px; color: var(--muted); margin-top:2px}

.result{
  display:grid;
  grid-template-columns: 1fr 1.2fr;
  gap:16px;
}
.portrait{
  border-radius: 18px;
  overflow:hidden;
  border: 1px solid rgba(36,23,15,.10);
  background: rgba(36,23,15,.03);
  box-shadow: var(--shadow2);
}
.portrait img{
  width:100%;
  height:auto;
  display:block;
}
.kv{
  display:grid;
  gap:8px;
}
.kv__row{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:10px 12px;
  border-radius: 16px;
  border:1px solid rgba(36,23,15,.10);
  background: rgba(251,244,234,.9);
}
.kv__k{width:90px; color:var(--muted); font-size:12px; padding-top:2px}
.kv__v{flex:1; font-size:14px; line-height:1.6}
.reason{
  margin-top:10px;
  padding:12px 12px;
  border-radius: 16px;
  border:1px solid rgba(36,23,15,.10);
  background: rgba(163,107,72,.07);
  line-height:1.75;
  font-size:14px;
}
.tagrow{display:flex; flex-wrap:wrap; gap:8px; margin-top:10px}
.tag{
  display:inline-flex;
  padding:8px 10px;
  border-radius: 999px;
  background: rgba(36,23,15,.05);
  border: 1px solid rgba(36,23,15,.10);
  font-size:12px;
  color: var(--muted);
}

.footer{padding: 6px 0 26px}
.footer__note{color: rgba(251,244,234,.75); font-size:12px; line-height:1.65}

@media (max-width: 860px){
  .grid2{grid-template-columns: 1fr}
  .result{grid-template-columns: 1fr}
  .filled-grid{grid-template-columns: repeat(4, 1fr)}
}
