main.wrap {
  box-sizing: border-box;
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 16px 28px;
  background: var(--paper, #f6f1e7);
  color: var(--ink, #33291f);
  font-family: var(--sans, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
main.wrap * { box-sizing: border-box; }
main.wrap h1 {
  margin: 4px 0 6px;
  font-size: 23px;
  line-height: 1.35;
  font-family: var(--serif, "Songti SC", "STSong", serif);
  letter-spacing: .5px;
}
main.wrap .sub {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted, #8d8072);
}
main.wrap .panel {
  background: var(--card, #fffdf8);
  border: 1px solid var(--line, #e7dcc7);
  border-radius: 14px;
  padding: 14px;
}
main.wrap .row2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}
main.wrap .fld { display: block; min-width: 0; }
main.wrap .fld span {
  display: block;
  font-size: 12px;
  color: var(--muted, #8d8072);
  margin-bottom: 6px;
}
main.wrap select {
  display: block;
  width: 100%;
  height: 46px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink, #33291f);
  background: #fff;
  border: 1px solid var(--line, #e7dcc7);
  border-radius: 10px;
  padding: 0 8px;
}
main.wrap .swap {
  height: 46px;
  min-width: 46px;
  border: 1px solid var(--line, #e7dcc7);
  border-radius: 10px;
  background: var(--card2, #fbf7ee);
  color: var(--cinnabar, #b23a2e);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
main.wrap .swap:active { transform: translateY(1px); }
main.wrap .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
main.wrap .chip {
  min-height: 44px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink, #33291f);
  background: #fff;
  border: 1px solid var(--line, #e7dcc7);
  border-radius: 999px;
  cursor: pointer;
}
main.wrap .chip[aria-pressed="true"] {
  background: var(--cinnabar-soft, #faece7);
  border-color: var(--cinnabar, #b23a2e);
  color: var(--cinnabar, #b23a2e);
  font-weight: 600;
}
main.wrap .result {
  margin-top: 12px;
  padding: 16px;
  background: var(--card, #fffdf8);
  border: 1px solid var(--line, #e7dcc7);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(80, 60, 30, .05);
}
main.wrap .scoreline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
main.wrap .num { display: flex; flex-direction: column; }
main.wrap .num b {
  font-size: 48px;
  line-height: .95;
  color: var(--cinnabar, #b23a2e);
  font-family: var(--serif, "Songti SC", serif);
  font-variant-numeric: tabular-nums;
}
main.wrap .num .cap {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted, #8d8072);
  letter-spacing: 1px;
}
main.wrap .badge {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--gold, #a9822f);
  background: var(--gold-soft, #fbf3dd);
  border: 1px solid #ecd9a8;
}
main.wrap .pairline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0 4px;
  font-size: 15px;
  font-weight: 600;
}
main.wrap #rel, main.wrap .ranklist em {
  font-style: normal;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--gold-soft, #fbf3dd);
  color: var(--gold, #a9822f);
  font-weight: 600;
  white-space: nowrap;
}
main.wrap [data-rel="he6"], main.wrap [data-rel="he3"] {
  background: var(--lucky-soft, #e9f2ec) !important;
  color: var(--lucky, #3d7a4f) !important;
}
main.wrap [data-rel="hai"], main.wrap [data-rel="xing"] {
  background: #fdf0e4 !important;
  color: #b06a24 !important;
}
main.wrap [data-rel="chong"] {
  background: var(--cinnabar-soft, #faece7) !important;
  color: var(--cinnabar, #b23a2e) !important;
}
main.wrap .bars { margin-top: 10px; }
main.wrap .bar { margin-top: 8px; }
main.wrap .lb {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted, #8d8072);
}
main.wrap .lb .v { color: var(--ink, #33291f); font-variant-numeric: tabular-nums; }
main.wrap .track {
  height: 8px;
  margin-top: 5px;
  border-radius: 999px;
  background: #f0e7d6;
  overflow: hidden;
}
main.wrap .fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gold, #a9822f);
  transition: width .25s ease;
}
main.wrap .fill.lv-hi { background: var(--lucky, #3d7a4f); }
main.wrap .fill.lv-mid { background: var(--gold, #a9822f); }
main.wrap .fill.lv-low { background: var(--cinnabar, #b23a2e); }
main.wrap .verdict {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.75;
}
main.wrap .hint {
  margin: 10px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted, #8d8072);
  background: var(--card2, #fbf7ee);
  border-left: 3px solid var(--gold, #a9822f);
  border-radius: 0 8px 8px 0;
}
main.wrap .hint[hidden] { display: none; }
main.wrap .el {
  margin-top: 10px;
  font-size: 12px;
  color: var(--lucky, #3d7a4f);
  font-variant-numeric: tabular-nums;
}
main.wrap .el[data-tone="ke"] { color: #b06a24; }
main.wrap .el[data-tone="none"] { color: var(--muted, #8d8072); }
main.wrap .tips {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}
main.wrap .tips li {
  position: relative;
  padding-left: 16px;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink, #33291f);
}
main.wrap .tips li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cinnabar, #b23a2e);
  opacity: .55;
}
main.wrap .copy {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--cinnabar, #b23a2e);
  color: #fff;
  font-size: 16px;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
}
main.wrap .copy:active { transform: translateY(1px); }
main.wrap .rank { margin-top: 20px; }
main.wrap .rank h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-family: var(--serif, "Songti SC", serif);
  letter-spacing: .5px;
}
main.wrap .ranklist {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card, #fffdf8);
  border: 1px solid var(--line, #e7dcc7);
  border-radius: 14px;
  overflow: hidden;
}
main.wrap .ranklist li + li { border-top: 1px solid #efe5d3; }
main.wrap .ranklist button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 0 12px;
  background: none;
  border: 0;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink, #33291f);
  text-align: left;
  cursor: pointer;
}
main.wrap .ranklist button .zi { flex: none; }
main.wrap .ranklist button b {
  margin-left: auto;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
main.wrap .ranklist button.on { background: var(--gold-soft, #fbf3dd); }
main.wrap .ranklist button.on .zi { font-weight: 600; }
main.wrap .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
main.wrap .links a {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--muted, #8d8072);
  text-decoration: none;
  border: 1px solid var(--line, #e7dcc7);
  border-radius: 8px;
  background: var(--card, #fffdf8);
}
main.wrap .note {
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: #9c9082;
}
@media (max-width: 340px) {
  main.wrap { padding: 12px 14px 24px; }
  main.wrap .num b { font-size: 42px; }
}
