:root {
  --paper: #eef1ef;
  --paper-deep: #e4e8e6;
  --ink: #20242a;
  --ink-soft: #68717d;
  --line: #d9ddda;
  --white: #ffffff;
  --stem-green: #32988d;
  --stem-red: #b46a64;
  --stem-brown: #9d8562;
  --stem-gold: #c59b35;
  --stem-blue: #6f96aa;
  --teal: var(--stem-blue);
  --mint: var(--stem-green);
  --gold: var(--stem-gold);
  --rust: var(--stem-red);
  --seal: var(--stem-brown);
  --shadow: 12px 18px 38px rgba(112, 121, 126, 0.2), -10px -12px 28px rgba(255, 255, 255, 0.72);
  --shadow-soft: 7px 9px 20px rgba(114, 124, 129, 0.18), -7px -7px 18px rgba(255, 255, 255, 0.78);
  --shadow-inset: inset 5px 5px 11px rgba(118, 128, 132, 0.16), inset -5px -5px 12px rgba(255, 255, 255, 0.76);
  --surface: rgba(246, 248, 247, 0.88);
  --surface-strong: #f8faf9;
  --accent-blue: #6f96aa;
  --accent-gold: #a99568;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0 1px, transparent 1px 12px),
    linear-gradient(180deg, #f4f6f5 0%, #edf1ef 44%, #e9eeec 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.app-shell {
  width: min(1480px, calc(100% - 48px));
  margin: 0 auto;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 450px);
  align-items: center;
  gap: 44px;
  padding: 48px 0;
}

.brand-panel {
  position: relative;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 42px 48px;
  background: var(--white);
  border: 1px solid #dedede;
  border-radius: 0 0 28px 28px;
  box-shadow: var(--shadow);
}

.ink-mark {
  width: 32px;
  height: 36px;
  display: block;
  color: transparent;
  background: radial-gradient(circle at 35% 30%, #4a4d58 0 18%, #272a35 44%, transparent 45%), #20232c;
  border-radius: 56% 44% 48% 52%;
  transform: rotate(18deg);
  box-shadow: none;
}

.ink-mark span {
  display: none;
}

.seal {
  width: auto;
  margin: 10px 0 44px;
  padding: 0;
  color: #667286;
  text-align: left;
  letter-spacing: 0;
  writing-mode: horizontal-tb;
  background: transparent;
  font-size: 1.1rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: none;
  font-size: clamp(3.4rem, 7vw, 5.2rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-copy {
  margin-top: 18px;
  color: #30343b;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.brand-copy::after {
  content: "";
  width: 70px;
  height: 15px;
  display: block;
  margin-top: 24px;
  background:
    radial-gradient(circle, var(--mint) 0 45%, transparent 48%) 0 0 / 25px 15px no-repeat,
    radial-gradient(circle, var(--rust) 0 45%, transparent 48%) 25px 0 / 25px 15px no-repeat,
    radial-gradient(circle, var(--seal) 0 45%, transparent 48%) 50px 0 / 25px 15px no-repeat;
}

.chart-lines {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 56px;
  width: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 0;
}

.chart-lines span {
  --orb-color: transparent;
  min-height: 96px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: radial-gradient(circle, var(--orb-color) 0 35px, transparent 36px);
  border-right: 0;
  border-bottom: 1px solid var(--line);
  font-family: "Songti SC", "STSong", serif;
  font-size: 2rem;
}

.chart-lines span:nth-child(1),
.chart-lines span:nth-child(2) {
  --orb-color: var(--stem-green);
}

.chart-lines span:nth-child(3),
.chart-lines span:nth-child(4) {
  --orb-color: var(--stem-red);
}

.chart-lines span:nth-child(5) {
  --orb-color: var(--stem-blue);
}

.chart-lines span:nth-child(6) {
  --orb-color: var(--stem-brown);
}

.chart-lines span:nth-child(7),
.chart-lines span:nth-child(8) {
  --orb-color: var(--stem-green);
}

.chart-lines span:nth-child(-n + 8) {
  color: var(--white);
}

.login-panel {
  width: 100%;
  padding: 36px;
  background: var(--white);
  border: 1px solid #dedede;
  border-radius: 0 0 28px 28px;
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.panel-heading p {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.panel-heading h2 {
  margin-top: 5px;
  font-size: 1.5rem;
  font-weight: 800;
}

.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 30px 0;
  padding: 6px;
  background: var(--paper-deep);
  border: 0;
  border-radius: 18px;
}

.tab-button {
  min-height: 46px;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 14px;
  font-weight: 700;
}

.tab-button.is-active {
  color: var(--white);
  background: var(--teal);
}

.login-view {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

input[type="tel"],
input[type="text"],
input[type="date"],
input[type="time"],
select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  font-size: 0.9rem;
}

input[type="tel"]:focus,
input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(47, 130, 146, 0.11);
}

.date-input-wrap {
  position: relative;
  display: grid;
}

.time-select-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.date-input-wrap #solar-date {
  padding-right: 54px;
}

.date-picker-button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 34px;
  min-height: 30px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
}

.date-picker-button:hover,
.date-picker-button:focus-visible {
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

.date-picker-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.native-date-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.ghost-button {
  min-height: 40px;
  color: var(--teal);
  background: transparent;
  border: 1px solid var(--teal);
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 700;
}

.ghost-button:disabled {
  color: rgba(71, 66, 58, 0.66);
  border-color: var(--line);
  cursor: not-allowed;
}

.agreement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.agreement input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--teal);
  flex: 0 0 auto;
}

.primary-button {
  width: 100%;
  min-height: 42px;
  color: var(--white);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 800;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.wechat-view {
  justify-items: center;
  text-align: center;
}

.qr-card {
  width: 192px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.qr-grid {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.qr-grid span {
  background: var(--teal);
}

.qr-grid span:nth-child(2),
.qr-grid span:nth-child(5),
.qr-grid span:nth-child(11),
.qr-grid span:nth-child(13),
.qr-grid span:nth-child(16) {
  background: var(--paper-deep);
}

.wechat-view h3 {
  margin-top: 4px;
  font-size: 1.35rem;
}

.wechat-view p {
  color: var(--ink-soft);
  line-height: 1.7;
}

.form-message {
  min-height: 24px;
  color: var(--seal);
  font-size: 0.92rem;
  font-weight: 600;
}

.app-shell {
  min-height: 100vh;
  padding: 20px 0 36px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(21, 19, 15, 0.22);
  padding-bottom: 12px;
}

.app-header h1 {
  max-width: none;
  margin-top: 4px;
  font-size: clamp(1.8rem, 2.4vw, 2.7rem);
  line-height: 0.95;
}

.horizontal-seal {
  width: auto;
  display: inline-grid;
  place-items: center;
  margin: 0;
  padding: 4px 8px;
  writing-mode: horizontal-tb;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
}

.compact-button {
  width: auto;
  min-width: 92px;
  padding: 0 14px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
}

.app-shell.is-form-page .workspace-grid {
  grid-template-columns: minmax(280px, 560px);
  justify-content: center;
}

.app-shell.is-form-page .result-panel {
  display: none;
}

.app-shell.is-chart-page .workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.app-shell.is-chart-page .planner-panel {
  display: none;
}

.app-shell.is-chart-page .result-panel {
  min-height: auto;
}

.planner-panel,
.result-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid rgba(21, 19, 15, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.planner-panel {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
  padding: 18px;
}

.result-panel {
  min-height: 520px;
  padding: 0;
  overflow: hidden;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0;
  padding: 4px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segmented-control legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.segmented-control label {
  min-height: 34px;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  border-radius: 7px;
  font-size: 0.88rem;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
}

.segmented-control label:has(input:checked) {
  color: var(--white);
  background: var(--ink);
}

.form-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.three-cols {
  grid-template-columns: repeat(3, 1fr);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  min-height: 40px;
  padding: 0 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--ink);
}

.empty-state {
  min-height: 560px;
  padding: 28px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 14px;
}

.archive-chart {
  --archive-bg: #fbfbfb;
  --archive-ink: #15191f;
  --archive-muted: #506073;
  --archive-line: #d5d5d5;
  --archive-green: var(--stem-green);
  --archive-red: var(--stem-red);
  --archive-brown: var(--stem-brown);
  --archive-gold: var(--stem-gold);
  --archive-blue: var(--stem-blue);
  --archive-teal: var(--stem-blue);
  --archive-mint: var(--stem-green);
  color: var(--archive-ink);
  background: var(--archive-bg);
  border: 1px solid #dddddd;
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

.archive-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 28px 8px;
}

.archive-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.ink-dot {
  width: 22px;
  height: 25px;
  margin-top: 2px;
  display: inline-block;
  background: radial-gradient(circle at 35% 30%, #4a4d58 0 18%, #272a35 44%, transparent 45%), #20232c;
  border-radius: 56% 44% 48% 52%;
  transform: rotate(18deg);
}

.archive-title h2 {
  font-size: clamp(1.25rem, 1.6vw, 1.55rem);
  line-height: 1.1;
  font-weight: 700;
}

.archive-title p {
  margin-top: 3px;
  color: #667286;
  font-size: 0.9rem;
}

.collapse-button {
  width: 32px;
  height: 32px;
  border: 0;
  color: var(--archive-ink);
  background: transparent;
  font-size: 1.05rem;
}

.archive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.archive-actions .compact-button {
  min-height: 32px;
}

.chart-tabs {
  display: flex;
  gap: 6px;
  padding: 6px 28px 8px;
}

.chart-tabs button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--archive-muted);
  font-size: 0.82rem;
}

.chart-tabs .is-current {
  color: var(--archive-ink);
  background: #eceff1;
  font-weight: 700;
}

.chart-view {
  background: transparent;
}

.archive-person {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 36px;
  row-gap: 10px;
  padding: 28px 34px 30px;
}

.archive-person.compact {
  display: block;
  padding-bottom: 16px;
}

.archive-person h3 {
  font-size: clamp(1.45rem, 2vw, 2.15rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0;
}

.archive-person h3 span {
  color: #6e9daa;
  font-size: 0.55em;
  vertical-align: 0.16em;
}

.archive-person p {
  align-self: center;
  color: #30343b;
  font-size: clamp(0.95rem, 1.3vw, 1.18rem);
}

.basic-chart-overview {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(0, 1.7fr);
  gap: 12px;
  align-items: stretch;
  padding: 24px 34px 18px;
}

.basic-chart-overview .archive-person {
  min-height: 100%;
  padding: 20px;
  border-radius: 12px;
}

.basic-chart-overview .archive-info-grid {
  padding: 0;
}

.basic-chart-overview .archive-info-grid div {
  min-height: 70px;
  border-radius: 12px;
}

.tone-dots {
  display: flex;
  gap: 7px;
}

.tone-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.tone-dots i:nth-child(1) {
  background: var(--archive-mint);
}

.tone-dots i:nth-child(2) {
  background: var(--archive-red);
}

.tone-dots i:nth-child(3) {
  background: var(--archive-brown);
}

.archive-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  padding: 0 34px 32px;
}

.archive-info-grid div {
  display: grid;
  gap: 5px;
  min-height: 64px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--archive-line);
}

.archive-info-grid .wide {
  grid-column: 1 / -1;
}

.archive-info-grid span {
  color: var(--archive-muted);
  font-size: 0.78rem;
}

.archive-info-grid strong {
  font-size: 0.92rem;
}

.pillar-sheet {
  width: calc(100% - 68px);
  margin: 0 34px 30px;
  border-top: 1px solid var(--archive-line);
}

.sheet-row {
  display: grid;
  grid-template-columns: 88px repeat(4, minmax(96px, 1fr));
  min-height: 56px;
  border-bottom: 1px solid var(--archive-line);
  background: transparent;
}

.head-row {
  min-height: 42px;
  color: var(--archive-muted);
  background: #f1f3f4;
}

.row-label,
.row-cell {
  display: grid;
  align-content: center;
  padding: 7px 6px;
}

.row-label {
  color: var(--archive-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.row-cell {
  color: var(--archive-ink);
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.45;
  border-left: 1px solid rgba(213, 213, 213, 0.68);
}

.head-row .row-cell {
  color: var(--archive-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.compact-row {
  min-height: 48px;
}

.big-row {
  min-height: 82px;
}

.tall-row {
  min-height: 84px;
}

.shensha-row {
  min-height: 118px;
}

.shensha-row .row-cell {
  align-content: center;
  justify-items: center;
  padding: 12px 10px;
  text-align: center;
}

.orb {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  justify-self: center;
  border-radius: 50%;
  color: #ffffff;
  font-family: "Songti SC", "STSong", serif;
  font-size: 1.38rem;
  font-weight: 500;
}

.element-bg-木 {
  background: var(--archive-green);
}

.element-bg-水 {
  background: var(--archive-blue);
}

.element-bg-火 {
  background: var(--archive-red);
}

.element-bg-土 {
  background: var(--archive-brown);
}

.element-bg-金 {
  background: var(--archive-gold);
}

.stem-tone-green {
  color: var(--archive-green);
}

.stem-tone-red {
  color: var(--archive-red);
}

.stem-tone-brown {
  color: var(--archive-brown);
}

.stem-tone-gold {
  color: var(--archive-gold);
}

.stem-tone-blue {
  color: var(--archive-blue);
}

.detail-row .row-cell {
  align-content: center;
  font-size: 0.78rem;
  text-align: left;
}

.mini-stack,
.tag-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: center;
  justify-content: flex-start;
}

.hidden-stem-stack {
  display: grid;
  gap: 3px;
}

.hidden-row .row-cell {
  align-content: center;
  justify-items: center;
  text-align: left;
}

.hidden-row .hidden-stem-stack {
  width: fit-content;
  max-width: 100%;
  justify-self: center;
  align-self: center;
  justify-items: start;
}

.stem-chip,
.plain-chip {
  min-width: 0;
  display: inline-grid;
  align-items: center;
  padding: 3px 5px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(213, 213, 213, 0.82);
  border-radius: 6px;
}

.stem-chip {
  grid-template-columns: auto auto 1fr;
  gap: 4px;
}

.stem-chip i {
  display: inline-grid;
  place-items: center;
  width: 18px;
  min-height: 16px;
  color: var(--archive-muted);
  background: rgba(236, 239, 241, 0.82);
  border-radius: 4px;
  font-size: 0.56rem;
  font-style: normal;
  line-height: 1;
}

.stem-chip b {
  font-family: "Songti SC", "STSong", serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.stem-chip small,
.plain-chip {
  color: var(--archive-muted);
  font-size: 0.62rem;
  line-height: 1.25;
  white-space: nowrap;
}

.tag-stack {
  gap: 4px;
}

.pillar-sheet .shensha-row .tag-stack {
  width: fit-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
}

.shensha-stack.is-compact {
  gap: 3px;
}

.tag-stack span {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 2px 5px;
  color: var(--archive-muted);
  background: rgba(236, 239, 241, 0.78);
  border: 1px solid rgba(213, 213, 213, 0.78);
  border-radius: 999px;
  font-size: 0.62rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.shensha-stack.is-compact span {
  min-height: 17px;
  padding: 1px 5px;
  font-size: 0.56rem;
}

.tag-stack .is-more {
  color: var(--archive-blue);
  background: rgba(111, 150, 170, 0.1);
  border-color: rgba(111, 150, 170, 0.28);
  font-weight: 700;
}

.muted-text {
  color: #a8b0ba;
  font-weight: 500;
}

.fortune-section {
  margin: 0 34px;
  padding: 18px 0;
  background: transparent;
  border-top: 1px solid var(--archive-line);
}

.fortune-person {
  padding-top: 26px;
}

.fortune-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 34px 20px;
  border: 1px solid var(--archive-line);
  background: var(--archive-line);
}

.fortune-summary div {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 12px;
  background: #ffffff;
}

.fortune-summary span,
.fortune-summary small,
.fortune-section-heading p,
.fortune-section-heading span {
  color: var(--archive-muted);
}

.fortune-summary span {
  font-size: 0.72rem;
}

.fortune-summary strong {
  color: var(--archive-ink);
  font-size: 1.02rem;
}

.fortune-summary small {
  line-height: 1.35;
  font-size: 0.72rem;
}

.fortune-inspector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 0 34px 20px;
  border: 1px solid var(--archive-line);
  background: var(--archive-line);
}

.inspector-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 176px;
  padding: 12px;
  background: #ffffff;
}

.unlock-button {
  min-width: 172px;
  white-space: nowrap;
}

.fortune-paid-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--archive-line);
  border-radius: 8px;
}

.fortune-paid-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.fortune-paid-heading > div,
.paid-selector-heading,
.paid-detail-card > div {
  display: grid;
  gap: 7px;
}

.fortune-paid-heading span,
.paid-summary-card span,
.paid-selector-heading span,
.paid-detail-card span {
  color: var(--archive-muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.fortune-paid-heading h3,
.paid-selector-heading h4,
.paid-detail-card h4 {
  margin: 0;
  color: var(--archive-ink);
  line-height: 1.2;
}

.fortune-paid-heading h3 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
}

.fortune-paid-heading p,
.paid-detail-card p,
.paid-detail-card small,
.paid-summary-card small {
  color: var(--archive-muted);
  font-size: 0.82rem;
  line-height: 1.62;
}

.paid-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.paid-summary-card,
.paid-selector-panel,
.paid-detail-card {
  background: #ffffff;
  border: 1px solid var(--archive-line);
  border-radius: 8px;
}

.paid-summary-card {
  display: grid;
  gap: 7px;
  min-height: 96px;
  padding: 14px;
}

.paid-summary-card strong {
  color: var(--archive-ink);
  font-size: 1.05rem;
  line-height: 1.25;
}

.paid-selector-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
  overflow: hidden;
}

.paid-selector-heading {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 4px 12px;
}

.paid-selector-heading span {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--archive-blue);
  background: rgba(128, 146, 173, 0.14);
  border-radius: 50%;
}

.paid-selector-heading small {
  color: var(--archive-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.paid-dayun-timeline {
  display: grid;
  grid-template-columns: repeat(8, minmax(112px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.paid-dayun-card,
.paid-liunian-button {
  display: grid;
  gap: 4px;
  text-align: left;
  color: var(--archive-muted);
  background: rgba(246, 248, 247, 0.82);
  border: 1px solid rgba(213, 213, 213, 0.72);
  border-radius: 8px;
  cursor: pointer;
}

.paid-dayun-card {
  min-height: 88px;
  padding: 12px;
}

.paid-dayun-card strong,
.paid-liunian-button b {
  color: var(--archive-ink);
  font-size: 1rem;
}

.paid-dayun-card span,
.paid-dayun-card small,
.paid-liunian-button span,
.paid-liunian-button small {
  font-size: 0.74rem;
  line-height: 1.25;
}

.paid-dayun-card.is-current,
.paid-liunian-button.is-current {
  border-color: rgba(98, 157, 144, 0.5);
}

.paid-dayun-card.is-selected,
.paid-liunian-button.is-selected {
  color: #ffffff;
  background: var(--archive-blue);
  border-color: transparent;
}

.paid-dayun-card.is-selected strong,
.paid-dayun-card.is-selected span,
.paid-dayun-card.is-selected small,
.paid-liunian-button.is-selected b,
.paid-liunian-button.is-selected span,
.paid-liunian-button.is-selected small {
  color: #ffffff;
}

.paid-liunian-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.paid-liunian-button {
  min-height: 96px;
  padding: 12px;
}

.paid-liunian-button b {
  font-size: 1.18rem;
}

.paid-liunian-button.is-in-selected-dayun:not(.is-selected) {
  background: rgba(128, 146, 173, 0.08);
  border-color: rgba(128, 146, 173, 0.36);
}

.paid-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.paid-detail-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 172px;
  padding: 16px;
}

.paid-detail-card.is-wide,
.paid-detail-card.is-locked {
  grid-column: 1 / -1;
}

.paid-detail-card.is-locked {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr) auto;
  align-items: center;
}

.locked-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.locked-preview-grid i {
  min-height: 34px;
  display: grid;
  place-items: center;
  color: rgba(106, 115, 124, 0.62);
  background: rgba(236, 239, 241, 0.78);
  border: 1px solid rgba(213, 213, 213, 0.72);
  border-radius: 8px;
  font-style: normal;
  font-size: 0.74rem;
  font-weight: 700;
}

.inspector-card > span {
  color: var(--archive-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.inspector-card strong {
  color: var(--archive-ink);
  font-size: 1.06rem;
  line-height: 1.1;
}

.inspector-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}

.inspector-year,
.title-dot {
  color: var(--archive-ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.title-dot {
  color: var(--archive-muted);
}

.fortune-pillar-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mini-orb {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  font-family: "Songti SC", "STSong", serif;
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1;
}

.inspector-card p {
  color: var(--archive-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.fortune-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.fortune-facts span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  color: var(--archive-muted);
  background: rgba(236, 239, 241, 0.72);
  border-radius: 999px;
  font-size: 0.62rem;
}

.fortune-facts b {
  color: var(--archive-ink);
  font-weight: 700;
}

.fortune-detail-block {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(213, 213, 213, 0.7);
}

.fortune-detail-block > div {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.fortune-detail-block em {
  color: var(--archive-muted);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 700;
}

.fortune-detail-block .hidden-stem-stack {
  display: flex;
  flex-wrap: wrap;
}

.fortune-detail-block .stem-chip {
  background: #ffffff;
}

.fortune-section h3,
.fortune-section-heading h3 {
  margin-bottom: 10px;
  color: var(--archive-ink);
  font-size: 1.02rem;
}

.fortune-sheet-section {
  padding-bottom: 22px;
}

.fortune-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.fortune-section-heading h3 {
  margin-bottom: 6px;
}

.fortune-section-heading p {
  max-width: 680px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.fortune-section-heading > span {
  flex: 0 0 auto;
  padding-top: 2px;
  font-size: 0.76rem;
}

.fortune-sheet-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--archive-line);
  border-bottom: 1px solid var(--archive-line);
}

.fortune-sheet {
  width: 100%;
}

.fortune-row {
  display: grid;
  grid-template-columns: var(--fortune-label-width, 84px) repeat(var(--fortune-cols), minmax(var(--fortune-col-min, 88px), 1fr));
  min-height: 46px;
  border-bottom: 1px solid var(--archive-line);
}

.fortune-row:last-child {
  border-bottom: 0;
}

.fortune-label,
.fortune-cell {
  display: grid;
  align-content: center;
  padding: 7px 6px;
}

.fortune-label {
  position: sticky;
  left: 0;
  z-index: 2;
  color: var(--archive-muted);
  background: var(--archive-bg);
  font-size: 0.76rem;
  font-weight: 600;
}

.fortune-cell {
  min-width: 0;
  color: var(--archive-ink);
  font: inherit;
  background: transparent;
  border: 0;
  border-left: 1px solid rgba(213, 213, 213, 0.72);
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.35;
}

.fortune-cell small {
  color: var(--archive-muted);
  font-size: 0.58rem;
  line-height: 1.25;
}

.fortune-row.head-row {
  min-height: 42px;
  color: var(--archive-muted);
  background: #f1f3f4;
}

.fortune-row.head-row .fortune-label {
  background: #f1f3f4;
}

.fortune-row.head-row .fortune-cell {
  color: var(--archive-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.fortune-row.big-row {
  min-height: 68px;
}

.fortune-row.tall-row {
  min-height: 88px;
}

.fortune-row.tall-row .fortune-cell {
  align-content: start;
  font-size: 0.7rem;
  text-align: left;
  padding-top: 10px;
  padding-bottom: 10px;
}

.fortune-row.hidden-row .fortune-cell {
  align-content: center;
  justify-items: center;
  text-align: left;
}

.fortune-row.hidden-row .hidden-stem-stack {
  width: fit-content;
  max-width: 100%;
  justify-self: center;
  align-self: center;
  justify-items: start;
}

.fortune-row.shensha-row {
  min-height: 126px;
}

.fortune-row.shensha-row .fortune-cell {
  align-content: center;
  justify-items: center;
  padding: 12px 8px;
  text-align: center;
}

.fortune-row.shensha-row .tag-stack {
  display: grid;
  width: fit-content;
  max-width: 100%;
  margin: auto;
  align-items: center;
  align-content: center;
  justify-content: center;
  justify-items: center;
}

.fortune-row.shensha-row .shensha-stack.is-single-column {
  grid-template-columns: max-content;
}

.fortune-row.shensha-row .shensha-stack.is-balanced-columns {
  grid-template-columns: repeat(2, max-content);
}

.fortune-cell .orb {
  width: 38px;
  height: 38px;
  font-size: 1.12rem;
}

.fortune-cell .stem-chip {
  min-width: 0;
  padding: 3px 4px;
}

.fortune-cell .stem-chip b {
  font-size: 0.75rem;
}

.fortune-cell .stem-chip small,
.fortune-cell .plain-chip,
.fortune-cell .tag-stack span {
  font-size: 0.56rem;
}

.fortune-cell.is-current {
  background: rgba(111, 150, 170, 0.12);
  box-shadow: inset 0 2px 0 var(--archive-blue);
}

.fortune-cell[data-fortune-step],
.fortune-cell[data-liunian-index] {
  cursor: pointer;
}

.fortune-cell[data-fortune-step]:hover,
.fortune-cell[data-liunian-index]:hover {
  background: rgba(236, 239, 241, 0.72);
}

.fortune-cell.is-selected {
  background: rgba(111, 150, 170, 0.18);
  box-shadow: inset 0 0 0 1px rgba(111, 150, 170, 0.6), inset 0 2px 0 var(--archive-blue);
}

.liunian-sheet-section .fortune-label,
.liunian-sheet-section .fortune-cell {
  padding-right: 4px;
  padding-left: 4px;
}

.liunian-sheet-section .fortune-cell {
  font-size: 0.72rem;
}

.liunian-sheet-section .fortune-cell small {
  font-size: 0.52rem;
}

.liunian-sheet-section .fortune-cell .orb {
  width: 34px;
  height: 34px;
  font-size: 1rem;
}

.liunian-rail {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 8px;
  scroll-padding: 24px;
}

.liunian-chip {
  flex: 0 0 58px;
  display: grid;
  gap: 2px;
  align-content: center;
  min-height: 54px;
  padding: 6px 5px;
  color: var(--archive-ink);
  background: #ffffff;
  border: 1px solid rgba(213, 213, 213, 0.9);
  border-radius: 8px;
  text-align: center;
  font: inherit;
}

.liunian-chip:hover {
  background: rgba(236, 239, 241, 0.72);
}

.liunian-chip b {
  font-size: 0.72rem;
  line-height: 1;
}

.liunian-chip span {
  color: var(--archive-muted);
  font-size: 0.7rem;
  line-height: 1;
}

.liunian-chip small {
  color: #8b96a3;
  font-size: 0.56rem;
  line-height: 1;
}

.liunian-chip.is-in-selected-dayun {
  border-color: rgba(111, 150, 170, 0.45);
}

.liunian-chip.is-current {
  box-shadow: inset 0 2px 0 var(--archive-blue);
}

.liunian-chip.is-selected {
  color: #ffffff;
  background: var(--archive-ink);
  border-color: var(--archive-ink);
}

.liunian-chip.is-selected span,
.liunian-chip.is-selected small {
  color: rgba(255, 255, 255, 0.72);
}

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

.fortune-grid.compact {
  grid-template-columns: repeat(4, 1fr);
}

.fortune-grid article {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--archive-line);
  border-radius: 14px;
}

.fortune-grid p {
  color: var(--archive-muted);
  font-size: 0.88rem;
}

.fortune-grid strong {
  color: var(--archive-teal);
  font-size: 1.55rem;
  line-height: 1;
}

.fortune-grid span {
  color: var(--archive-brown);
}

.fortune-grid small {
  color: var(--archive-muted);
  line-height: 1.45;
}

.pay-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(31, 35, 40, 0.26);
  backdrop-filter: blur(8px);
}

.pay-modal {
  position: relative;
  width: min(480px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  color: var(--archive-muted);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(231, 237, 234, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.pay-modal > span {
  color: var(--accent-gold);
  font-size: 0.78rem;
  font-weight: 800;
}

.pay-modal h3 {
  color: var(--archive-ink);
  font-size: 1.35rem;
}

.pay-modal p,
.pay-modal small {
  color: var(--archive-muted);
  line-height: 1.65;
}

.pay-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 14px;
  background: rgba(236, 239, 241, 0.72);
  border: 1px solid rgba(213, 213, 213, 0.72);
  border-radius: 10px;
}

.pay-product strong {
  color: var(--archive-ink);
}

.pay-product b {
  color: var(--archive-ink);
  font-size: 1.45rem;
}

.pay-product small {
  grid-column: 1 / -1;
  font-size: 0.76rem;
}

.pay-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.pay-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: var(--archive-muted);
  background: rgba(236, 239, 241, 0.72);
  border: 1px solid rgba(213, 213, 213, 0.72);
  border-radius: 50%;
  font-size: 1.1rem;
}

.notes-panel {
  display: grid;
  gap: 18px;
  padding: 28px 34px 38px;
  color: var(--archive-muted);
}

.notes-panel h3 {
  color: var(--archive-ink);
}

.record-archive-panel {
  display: grid;
  gap: 16px;
  padding: 28px 34px 38px;
  color: var(--archive-muted);
}

.record-archive-panel header {
  display: grid;
  gap: 7px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--archive-line);
  border-radius: 8px;
}

.record-archive-panel header span {
  color: var(--archive-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.record-archive-panel header h3 {
  color: var(--archive-ink);
  font-size: clamp(1.55rem, 2.1vw, 2.15rem);
  line-height: 1;
}

.record-archive-panel header p {
  color: var(--archive-muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.record-archive-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.record-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  color: var(--archive-ink);
  background: #ffffff;
  border: 1px solid var(--archive-line);
  border-radius: 8px;
}

.record-open-button {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.record-card:hover,
.record-card:has(.record-open-button:focus-visible),
.record-card:has(.record-delete-button:focus-visible) {
  border-color: rgba(111, 150, 170, 0.54);
  box-shadow: 0 8px 18px rgba(92, 108, 116, 0.1);
}

.record-open-button:focus-visible,
.record-delete-button:focus-visible {
  outline: none;
}

.record-card b {
  grid-row: span 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--archive-blue);
  border-radius: 50%;
  font-size: 1rem;
  font-style: normal;
}

.record-card span,
.record-card em,
.record-card i {
  min-width: 0;
}

.record-card span {
  display: grid;
  gap: 3px;
}

.record-card strong {
  overflow: hidden;
  color: var(--archive-ink);
  font-size: 1rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-card small,
.record-card i {
  color: var(--archive-muted);
  font-size: 0.76rem;
  font-style: normal;
  line-height: 1.35;
}

.record-card em {
  overflow: hidden;
  color: var(--archive-ink);
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-delete-button {
  min-height: 32px;
  align-self: center;
  padding: 0 10px;
  color: var(--archive-red);
  background: rgba(180, 106, 100, 0.08);
  border: 1px solid rgba(180, 106, 100, 0.26);
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
}

.record-delete-button:hover {
  color: #ffffff;
  background: var(--archive-red);
  border-color: var(--archive-red);
}

.notes-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  align-items: stretch;
  gap: 14px;
}

.notes-heading > div:first-child,
.strength-badge,
.strength-grid article,
.element-section,
.guidance-section {
  background: #ffffff;
  border: 1px solid var(--archive-line);
  border-radius: 8px;
}

.notes-heading > div:first-child {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 150px;
  padding: 18px;
}

.notes-heading span,
.strength-grid span,
.guidance-section span {
  color: var(--archive-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.notes-heading h3 {
  font-size: clamp(1.55rem, 2.1vw, 2.15rem);
  line-height: 1;
}

.notes-heading p,
.strength-grid p,
.element-section p,
.guidance-section p {
  color: var(--archive-muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.strength-badge {
  display: grid;
  grid-template-columns: minmax(92px, 0.72fr) minmax(0, 1.28fr);
  align-content: center;
  align-items: center;
  gap: 8px;
  padding: 18px;
}

.score-value {
  display: grid;
  gap: 8px;
}

.strength-badge strong {
  color: var(--archive-ink);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.95;
}

.strength-badge small {
  color: var(--archive-muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.strength-badge.is-strong {
  border-top: 4px solid var(--archive-red);
}

.strength-badge.is-weak {
  border-top: 4px solid var(--archive-blue);
}

.strength-badge.is-balanced {
  border-top: 4px solid var(--archive-green);
}

.score-range-list {
  display: grid;
  gap: 5px;
}

.score-range-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 27px;
  align-items: center;
  padding: 4px 7px;
  color: var(--archive-muted);
  background: rgba(236, 239, 241, 0.72);
  border: 1px solid rgba(213, 213, 213, 0.72);
  border-radius: 8px;
  font-size: 0.72rem;
  line-height: 1.2;
}

.score-range-list span {
  color: inherit;
  font-size: inherit;
  font-weight: 700;
}

.score-range-list b {
  color: var(--archive-ink);
  font-size: inherit;
  white-space: nowrap;
}

.score-range-list .is-current {
  color: var(--archive-ink);
  background: rgba(128, 146, 173, 0.18);
  border-color: rgba(128, 146, 173, 0.38);
}

.strength-balance {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 12px 14px;
  background: #f1f3f4;
  border: 1px solid var(--archive-line);
  border-radius: 8px;
}

.strength-balance > div:not(.balance-track) {
  display: grid;
  gap: 3px;
}

.strength-balance > div:last-child {
  justify-items: end;
  text-align: right;
}

.strength-balance span {
  color: var(--archive-muted);
  font-size: 0.72rem;
}

.strength-balance strong {
  color: var(--archive-ink);
  font-size: 1.1rem;
}

.balance-track {
  height: 10px;
  overflow: hidden;
  background: rgba(182, 111, 104, 0.18);
  border-radius: 999px;
}

.balance-track i {
  width: var(--support-ratio);
  height: 100%;
  display: block;
  background: var(--archive-blue);
  border-radius: inherit;
}

.strength-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--archive-line);
  border: 1px solid var(--archive-line);
}

.strength-grid article {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 152px;
  padding: 14px;
  border: 0;
  border-radius: 0;
}

.strength-grid strong {
  color: var(--archive-ink);
  font-size: 1.08rem;
  line-height: 1.25;
}

.score-step-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--archive-line);
  border: 1px solid var(--archive-line);
}

.score-step-grid article {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 142px;
  padding: 14px;
  background: #ffffff;
}

.score-step-grid span,
.score-formula span,
.use-god-row span,
.calculation-section summary {
  color: var(--archive-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.score-step-grid strong {
  color: var(--archive-ink);
  font-size: clamp(1.5rem, 2.7vw, 2.1rem);
  line-height: 1;
}

.score-step-grid p,
.score-formula p,
.calculation-list {
  color: var(--archive-muted);
  font-size: 0.82rem;
  line-height: 1.62;
}

.score-formula {
  display: grid;
  gap: 7px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--archive-line);
  border-radius: 8px;
}

.score-formula strong {
  color: var(--archive-ink);
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
  line-height: 1.1;
}

.calculation-section {
  display: grid;
  gap: 8px;
}

.calculation-section details {
  background: #ffffff;
  border: 1px solid var(--archive-line);
  border-radius: 8px;
}

.calculation-section summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  cursor: pointer;
}

.calculation-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 16px 14px 30px;
}

.calculation-list li {
  padding-left: 2px;
}

.element-section {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.element-section header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.element-section h4 {
  margin: 0;
  color: var(--archive-ink);
  font-size: 1rem;
}

.element-section p {
  max-width: 420px;
  text-align: right;
}

.element-bars {
  display: grid;
  gap: 8px;
}

.element-bar {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.element-bar span,
.element-bar strong {
  color: var(--archive-ink);
  font-size: 0.82rem;
}

.element-bar div {
  height: 9px;
  overflow: hidden;
  background: #eceff1;
  border-radius: 999px;
}

.element-bar i {
  min-width: 2px;
  height: 100%;
  display: block;
  border-radius: inherit;
}

.element-bar strong {
  text-align: right;
}

.guidance-section {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 18px;
  padding: 16px;
}

.guidance-section > div {
  display: grid;
  gap: 8px;
}

.use-god-section > div {
  gap: 10px;
}

.use-god-row {
  display: grid;
  gap: 5px;
}

.guidance-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.guidance-tags b {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  color: var(--archive-ink);
  background: rgba(236, 239, 241, 0.82);
  border: 1px solid rgba(213, 213, 213, 0.84);
  border-radius: 999px;
  font-size: 0.74rem;
  line-height: 1.25;
}

.interpretation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.interpretation-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 280px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--archive-line);
  border-radius: 8px;
}

.interpretation-card.is-featured {
  grid-column: 1 / -1;
  grid-template-columns: minmax(168px, 0.34fr) minmax(0, 1fr);
  align-items: start;
  min-height: auto;
  padding: 20px;
}

.interpretation-card-title {
  display: grid;
  gap: 8px;
}

.interpretation-card span {
  color: var(--archive-muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.interpretation-card h4 {
  margin: 0;
  color: var(--archive-ink);
  font-size: 1.08rem;
  line-height: 1.25;
}

.interpretation-card p {
  color: var(--archive-muted);
  font-size: 0.88rem;
  line-height: 1.8;
}

.interpretation-card.is-featured p {
  font-size: 0.9rem;
  line-height: 1.75;
}

.empty-state h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 600;
}

.empty-state p:last-child,
.result-heading span {
  color: var(--ink-soft);
}

.result-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.result-heading p {
  color: var(--seal);
}

.result-heading h2 {
  margin-top: 6px;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 22px 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.summary-strip div {
  display: grid;
  gap: 8px;
  min-height: 84px;
  padding: 16px;
  background: rgba(247, 243, 234, 0.82);
}

.summary-strip span,
.pillar-card p,
.hidden-grid p,
.flow-grid p,
th {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.summary-strip strong {
  font-size: 1.08rem;
  font-weight: 600;
}

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

.pillar-card {
  min-height: 160px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  background: var(--ink);
  color: var(--white);
}

.pillar-card strong {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 600;
}

.pillar-card span {
  color: rgba(255, 253, 248, 0.72);
}

.data-section {
  margin-top: 28px;
}

.data-section h3 {
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.hidden-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.hidden-grid > div {
  min-height: 116px;
  padding: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.64);
}

.hidden-grid div div,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hidden-grid span,
.tag-cloud span {
  display: inline-grid;
  gap: 2px;
  padding: 7px 10px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
}

.hidden-grid small,
.flow-grid small {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: rgba(255, 253, 248, 0.7);
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

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

.flow-grid article {
  display: grid;
  gap: 5px;
  min-height: 132px;
  padding: 14px;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid var(--line);
}

.flow-grid strong {
  font-size: 1.55rem;
}

.flow-grid span {
  color: var(--seal);
}

/* Soft tactile theme inspired by the reference image. */
.brand-panel,
.login-panel,
.planner-panel,
.result-panel,
.archive-chart,
.qr-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(232, 237, 235, 0.76)),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.brand-panel,
.login-panel {
  border-radius: 18px;
}

.planner-panel,
.result-panel,
.archive-chart {
  border-radius: 14px;
}

.brand-panel::before,
.archive-chart::before,
.empty-state::before {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0.5;
}

.brand-panel {
  overflow: hidden;
}

.brand-panel::before {
  inset: 54px 42px auto auto;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(128, 146, 173, 0.18);
  border-radius: 50%;
  box-shadow:
    inset 10px 10px 20px rgba(122, 132, 137, 0.12),
    inset -10px -10px 22px rgba(255, 255, 255, 0.7);
}

.ink-mark {
  background:
    linear-gradient(145deg, #ffffff, #dfe5e2);
  box-shadow: var(--shadow-soft);
}

.seal,
.horizontal-seal,
.brand-copy::after,
.archive-title p,
.panel-heading p {
  color: var(--accent-gold);
}

.chart-lines {
  border-top-color: rgba(126, 135, 140, 0.2);
}

.chart-lines span {
  background:
    radial-gradient(circle, var(--orb-color) 0 35px, transparent 36px),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(229, 234, 232, 0.58));
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.login-tabs,
.segmented-control,
.chart-tabs,
.strength-balance,
.fortune-facts span,
.tag-stack span,
.guidance-tags b {
  background: rgba(227, 232, 230, 0.78);
  box-shadow: var(--shadow-inset);
}

.tab-button,
.chart-tabs button,
.segmented-control label,
.liunian-chip,
.fortune-cell[data-fortune-step],
.fortune-cell[data-liunian-index],
.ghost-button,
.primary-button,
.compact-button,
.collapse-button {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.tab-button.is-active,
.segmented-control label:has(input:checked),
.chart-tabs .is-current,
.liunian-chip.is-selected,
.fortune-cell.is-selected {
  color: #ffffff;
  background: var(--accent-blue);
  box-shadow:
    inset 2px 2px 5px rgba(47, 58, 70, 0.18),
    inset -2px -2px 5px rgba(255, 255, 255, 0.18),
    5px 8px 16px rgba(111, 125, 146, 0.22);
}

.primary-button {
  background: linear-gradient(145deg, #2c3138, #171b20);
  box-shadow: 7px 9px 18px rgba(79, 89, 96, 0.22), -5px -5px 14px rgba(255, 255, 255, 0.74);
}

.ghost-button,
.compact-button {
  color: var(--accent-blue);
  background: linear-gradient(145deg, #f9fbfa, #e4e9e6);
  border-color: rgba(128, 146, 173, 0.36);
  box-shadow: var(--shadow-soft);
}

.collapse-button {
  border-radius: 50%;
  background: linear-gradient(145deg, #f8faf9, #e1e7e4);
  box-shadow: var(--shadow-soft);
}

input[type="tel"],
input[type="text"],
input[type="date"],
input[type="time"],
select,
.checkbox-field {
  background: rgba(240, 244, 242, 0.9);
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-inset);
}

input[type="tel"]:focus,
input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus {
  border-color: rgba(128, 146, 173, 0.5);
  box-shadow: var(--shadow-inset), 0 0 0 3px rgba(128, 146, 173, 0.14);
}

.app-header {
  min-height: 72px;
  padding: 10px 16px 14px;
  border-bottom: 0;
  color: var(--accent-gold);
}

.workspace-grid {
  gap: 22px;
}

.archive-chart {
  --archive-bg: rgba(245, 248, 246, 0.9);
  --archive-ink: #20242a;
  --archive-muted: #6a737c;
  --archive-line: rgba(179, 187, 184, 0.48);
  --archive-blue: var(--accent-blue);
  --archive-teal: var(--stem-green);
  --archive-mint: var(--stem-green);
  position: relative;
  overflow: hidden;
}

.archive-chart::before {
  inset: 22px 32px auto auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 1px solid rgba(128, 146, 173, 0.12);
  box-shadow:
    inset 14px 16px 28px rgba(113, 123, 129, 0.12),
    inset -16px -16px 30px rgba(255, 255, 255, 0.7);
}

.archive-chart > * {
  position: relative;
  z-index: 1;
}

.archive-heading {
  align-items: center;
}

.archive-title {
  align-items: center;
}

.archive-info-grid,
.fortune-summary,
.fortune-inspector,
.strength-grid,
.score-step-grid,
.interpretation-grid {
  gap: 8px;
  background: transparent;
  border: 0;
}

.basic-chart-overview .archive-person,
.archive-info-grid div,
.fortune-summary div,
.inspector-card,
.strength-grid article,
.score-step-grid article,
.notes-heading > div:first-child,
.strength-badge,
.score-formula,
.calculation-section details,
.element-section,
.guidance-section,
.interpretation-card,
.fortune-paid-panel,
.paid-summary-card,
.paid-selector-panel,
.paid-detail-card,
.paid-dayun-card,
.paid-liunian-button,
.fortune-grid article,
.liunian-chip {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(231, 237, 234, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-soft);
}

.pillar-sheet,
.fortune-sheet-wrap {
  border-color: rgba(146, 155, 159, 0.22);
}

.sheet-row,
.fortune-row {
  border-bottom-color: rgba(146, 155, 159, 0.22);
}

.head-row,
.fortune-row.head-row,
.fortune-row.head-row .fortune-label {
  background: rgba(223, 229, 226, 0.72);
}

.row-cell,
.fortune-cell {
  border-left-color: rgba(146, 155, 159, 0.18);
}

.orb,
.mini-orb {
  box-shadow:
    5px 7px 14px rgba(93, 101, 106, 0.2),
    -3px -4px 10px rgba(255, 255, 255, 0.58),
    inset 2px 2px 4px rgba(255, 255, 255, 0.18),
    inset -2px -3px 5px rgba(52, 61, 66, 0.14);
}

.stem-chip,
.plain-chip {
  background: rgba(244, 247, 246, 0.86);
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow: 3px 4px 8px rgba(112, 121, 126, 0.12), -3px -3px 8px rgba(255, 255, 255, 0.68);
}

.fortune-cell.is-current,
.liunian-chip.is-current {
  background: rgba(128, 146, 173, 0.14);
  box-shadow: inset 0 2px 0 var(--accent-blue), var(--shadow-soft);
}

.notes-panel {
  gap: 20px;
}

.strength-badge.is-strong,
.strength-badge.is-weak,
.strength-badge.is-balanced {
  border-top-width: 0;
  box-shadow: inset 0 4px 0 currentColor, var(--shadow-soft);
}

.strength-badge.is-strong {
  color: var(--archive-red);
}

.strength-badge.is-weak {
  color: var(--archive-blue);
}

.strength-badge.is-balanced {
  color: var(--archive-green);
}

.strength-badge strong,
.strength-badge small,
.strength-badge span {
  color: var(--archive-ink);
}

.balance-track,
.element-bar div {
  background: rgba(216, 222, 219, 0.86);
  box-shadow: var(--shadow-inset);
}

.balance-track i,
.element-bar i {
  box-shadow: 0 2px 5px rgba(73, 82, 89, 0.18);
}

.fortune-cell.is-selected {
  color: var(--archive-ink);
  background:
    linear-gradient(145deg, rgba(252, 254, 253, 0.96), rgba(231, 240, 241, 0.88));
  border-left-color: rgba(111, 150, 170, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(111, 150, 170, 0.32),
    inset 0 4px 0 rgba(111, 150, 170, 0.72),
    6px 8px 18px rgba(92, 108, 116, 0.12),
    -5px -5px 14px rgba(255, 255, 255, 0.76);
}

.fortune-row.head-row .fortune-cell.is-selected {
  color: var(--archive-ink);
  font-weight: 700;
}

.fortune-cell.is-selected small,
.fortune-cell.is-selected .muted-text,
.fortune-cell.is-selected .plain-chip,
.fortune-cell.is-selected .tag-stack span {
  color: var(--archive-muted);
}

.fortune-cell.is-selected .orb,
.fortune-cell.is-selected .mini-orb {
  box-shadow:
    0 0 0 8px rgba(111, 150, 170, 0.12),
    4px 6px 14px rgba(89, 105, 112, 0.14),
    inset 1px 2px 4px rgba(255, 255, 255, 0.2);
}

.liunian-chip.is-selected {
  color: var(--archive-ink);
  background:
    linear-gradient(145deg, rgba(252, 254, 253, 0.96), rgba(232, 240, 239, 0.9));
  border-color: rgba(111, 150, 170, 0.42);
  box-shadow:
    inset 0 3px 0 rgba(111, 150, 170, 0.72),
    5px 7px 16px rgba(92, 108, 116, 0.12),
    -4px -4px 12px rgba(255, 255, 255, 0.76);
}

.liunian-chip.is-selected span,
.liunian-chip.is-selected small {
  color: var(--archive-muted);
}

.empty-state {
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  inset: auto 24px 24px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(128, 146, 173, 0.12);
  box-shadow:
    inset 12px 14px 24px rgba(113, 123, 129, 0.12),
    inset -14px -14px 26px rgba(255, 255, 255, 0.66);
}

@media (max-width: 860px) {
  .page-shell {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 32px 0;
  }

  .brand-panel {
    min-height: auto;
    padding: 12px 0 0;
  }

  .brand-copy {
    margin-bottom: 18px;
  }

  .chart-lines {
    position: static;
    width: 100%;
    max-width: 360px;
    margin-top: 24px;
  }

  .app-header,
  .result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .planner-panel {
    position: static;
  }

  .summary-strip,
  .pillar-grid,
  .hidden-grid,
  .flow-grid,
  .fortune-grid,
  .fortune-grid.compact,
  .fortune-summary,
  .fortune-inspector,
  .notes-heading,
  .record-archive-list,
  .strength-grid,
  .score-step-grid,
  .interpretation-grid,
  .guidance-section {
    grid-template-columns: repeat(2, 1fr);
  }

  .paid-detail-card.is-locked {
    grid-template-columns: 1fr;
  }

  .notes-heading > div:first-child {
    min-height: 132px;
  }

  .strength-badge {
    grid-template-columns: 1fr;
  }

  .interpretation-card.is-featured {
    grid-template-columns: 1fr;
  }

  .paid-detail-grid,
  .paid-summary-row {
    grid-template-columns: 1fr;
  }

  .paid-dayun-timeline {
    grid-template-columns: repeat(4, minmax(128px, 1fr));
  }

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

  .element-section header {
    display: grid;
  }

  .element-section p {
    max-width: none;
    text-align: left;
  }

  .basic-chart-overview {
    grid-template-columns: 1fr;
    padding: 20px 28px 18px;
  }

  .basic-chart-overview .archive-info-grid {
    padding: 0;
  }

  .pillar-sheet {
    overflow-x: auto;
  }

  .sheet-row {
    min-width: 560px;
  }

  .archive-heading,
  .archive-person {
    padding-left: 28px;
    padding-right: 28px;
  }

  .pillar-sheet,
  .fortune-section,
  .fortune-summary,
  .fortune-inspector {
    width: calc(100% - 56px);
    margin-left: 28px;
    margin-right: 28px;
  }

  .archive-info-grid {
    padding-left: 28px;
    padding-right: 28px;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: min(100% - 24px, 1120px);
    min-height: 100svh;
    align-content: start;
    gap: 10px;
    padding: 10px 0 16px;
  }

  .brand-panel {
    min-height: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 10px;
    row-gap: 4px;
    padding: 14px 16px 12px;
    border-radius: 16px;
  }

  .brand-panel::before {
    inset: -28px -18px auto auto;
    width: 132px;
    height: 132px;
    opacity: 0.36;
  }

  .brand-panel .ink-mark {
    width: 24px;
    height: 27px;
    grid-row: 1 / span 2;
  }

  .brand-panel .seal {
    margin: 0;
    font-size: 0.78rem;
  }

  .brand-panel h1 {
    font-size: 2.06rem;
    line-height: 0.98;
  }

  .brand-copy {
    grid-column: 1 / -1;
    margin-top: 4px;
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .brand-copy::after {
    width: 46px;
    height: 8px;
    margin-top: 8px;
    background:
      radial-gradient(circle, var(--mint) 0 45%, transparent 48%) 0 0 / 15px 8px no-repeat,
      radial-gradient(circle, var(--rust) 0 45%, transparent 48%) 15px 0 / 15px 8px no-repeat,
      radial-gradient(circle, var(--seal) 0 45%, transparent 48%) 30px 0 / 15px 8px no-repeat;
  }

  .chart-lines {
    display: none;
  }

  .login-panel {
    padding: 16px 14px;
    border-radius: 16px;
  }

  .panel-heading h2 {
    font-size: 1.32rem;
  }

  .login-tabs {
    gap: 4px;
    margin: 14px 0;
    padding: 4px;
    border-radius: 14px;
  }

  .tab-button {
    min-height: 38px;
    border-radius: 11px;
    font-size: 0.88rem;
  }

  .login-view {
    gap: 12px;
  }

  .qr-card {
    width: min(52vw, 176px);
    padding: 14px;
    border-radius: 14px;
  }

  .qr-grid {
    gap: 6px;
  }

  .wechat-view h3 {
    font-size: 1.12rem;
  }

  .wechat-view p {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .wechat-view .agreement {
    width: 100%;
    font-size: 0.72rem;
    line-height: 1.35;
    text-align: left;
  }

  .wechat-view .primary-button {
    min-height: 38px;
  }

  .code-row {
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 8px;
  }

  .ghost-button {
    width: 100%;
  }

  .app-shell {
    width: 100%;
    max-width: 100vw;
    padding-left: 12px;
    padding-right: 12px;
    overflow-x: clip;
  }

  .app-shell.is-chart-page {
    padding-top: 12px;
  }

  .app-shell.is-chart-page .app-header {
    display: none;
  }

  .planner-panel,
  .result-panel {
    padding: 20px 16px;
  }

  .result-panel {
    padding: 0;
  }

  .form-grid,
  .three-cols,
  .summary-strip,
  .pillar-grid,
  .hidden-grid,
  .flow-grid,
  .fortune-grid,
  .fortune-grid.compact,
  .fortune-summary,
  .fortune-inspector,
  .notes-heading,
  .strength-grid,
  .score-step-grid,
  .interpretation-grid,
  .guidance-section {
    grid-template-columns: 1fr;
  }

  .app-shell.is-form-page {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .app-shell.is-form-page .app-header {
    display: none;
  }

  .app-shell.is-form-page .workspace-grid {
    gap: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .app-shell.is-form-page .planner-panel {
    position: relative;
    width: 100%;
    max-width: 100%;
    gap: 9px;
    padding: 12px;
    border-radius: 16px;
    overflow: hidden;
  }

  .app-shell.is-form-page .panel-heading {
    display: grid;
    gap: 2px;
  }

  .app-shell.is-form-page .panel-heading p {
    font-size: 0.72rem;
  }

  .app-shell.is-form-page .panel-heading h2 {
    margin-top: 0;
    font-size: 1.08rem;
    line-height: 1.12;
  }

  .app-shell.is-form-page .segmented-control {
    gap: 3px;
    padding: 3px;
    border-radius: 12px;
  }

  .app-shell.is-form-page .segmented-control label {
    min-height: 31px;
    background: transparent;
    box-shadow: none;
    border-radius: 9px;
    font-size: 0.78rem;
  }

  .app-shell.is-form-page .segmented-control label:has(input:checked) {
    color: var(--white);
    background: var(--accent-blue);
    box-shadow: 4px 6px 12px rgba(92, 108, 116, 0.16);
  }

  .app-shell.is-form-page .form-grid {
    width: 100%;
    min-width: 0;
    gap: 8px;
  }

  .app-shell.is-form-page .three-cols,
  .app-shell.is-form-page #lunar-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-shell.is-form-page #solar-fields {
    grid-template-columns: 1fr;
  }

  .app-shell.is-form-page #lunar-fields .checkbox-field {
    grid-column: 1 / -1;
  }

  .app-shell.is-form-page .field {
    min-width: 0;
    gap: 4px;
  }

  .app-shell.is-form-page .field span {
    font-size: 0.66rem;
    line-height: 1.2;
  }

  .app-shell.is-form-page input[type="text"],
  .app-shell.is-form-page input[type="date"],
  .app-shell.is-form-page input[type="time"],
  .app-shell.is-form-page select {
    width: 100%;
    max-width: 100%;
    min-height: 38px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 16px;
  }

  .app-shell.is-form-page .date-input-wrap {
    min-width: 0;
  }

  .app-shell.is-form-page .time-select-wrap {
    gap: 7px;
  }

  .app-shell.is-form-page .date-picker-button {
    width: 34px;
    min-width: 34px;
  }

  .app-shell.is-form-page #profile-name,
  .app-shell.is-form-page #birth-hour,
  .app-shell.is-form-page #birth-minute {
    min-width: 0;
  }

  .app-shell.is-form-page .checkbox-field {
    grid-column: 1 / -1;
    min-height: 33px;
    padding: 0 8px;
    border-radius: 8px;
  }

  .app-shell.is-form-page .checkbox-field input {
    width: 14px;
    height: 14px;
  }

  .app-shell.is-form-page .primary-button {
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .notes-panel {
    padding: 20px;
  }

  .record-archive-panel {
    padding: 20px;
  }

  .record-archive-list {
    grid-template-columns: 1fr;
  }

  .record-card {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
  }

  .record-open-button {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .record-card b {
    width: 36px;
    height: 36px;
  }

  .record-delete-button {
    min-height: 30px;
    padding: 0 8px;
  }

  .fortune-paid-panel {
    padding: 14px;
  }

  .fortune-paid-heading {
    display: grid;
  }

  .paid-summary-row,
  .paid-detail-grid,
  .paid-detail-card.is-locked {
    grid-template-columns: 1fr;
  }

  .paid-dayun-timeline {
    grid-template-columns: repeat(8, minmax(112px, 1fr));
  }

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

  .interpretation-card,
  .interpretation-card.is-featured {
    min-height: auto;
    padding: 16px;
  }

  .pay-actions {
    display: grid;
  }

  .pay-actions .ghost-button,
  .pay-actions .primary-button,
  .unlock-button {
    width: 100%;
  }

  .strength-balance {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .strength-balance > div:last-child {
    justify-items: start;
    text-align: left;
  }

  .chart-tabs {
    flex-wrap: wrap;
    min-height: 48px;
    padding: 8px 18px 10px;
    font-size: 0.92rem;
  }

  .fortune-section {
    padding: 16px;
  }

  .fortune-section-heading {
    display: grid;
  }

  .archive-heading {
    align-items: center;
    flex-direction: row;
    padding: 12px 14px 4px;
  }

  .archive-actions .ghost-button {
    width: auto;
  }

  .archive-title {
    gap: 8px;
  }

  .archive-title h2 {
    font-size: 1.08rem;
  }

  .archive-title p {
    margin-top: 1px;
    font-size: 0.78rem;
  }

  .ink-dot {
    width: 18px;
    height: 21px;
  }

  .chart-tabs {
    min-height: 38px;
    padding: 5px 14px 7px;
    gap: 4px;
  }

  .chart-tabs button {
    min-height: 27px;
    padding: 0 8px;
    font-size: 0.8rem;
  }

  .basic-chart-overview {
    gap: 7px;
    padding: 10px 14px 8px;
  }

  .basic-chart-overview .archive-person {
    grid-template-columns: 1fr auto;
    column-gap: 10px;
    row-gap: 2px;
    padding: 10px 12px;
    border-radius: 10px;
  }

  .basic-chart-overview .archive-person h3 {
    font-size: 1.18rem;
    line-height: 1.12;
  }

  .basic-chart-overview .archive-person p {
    grid-column: 1 / -1;
    font-size: 0.76rem;
    line-height: 1.22;
  }

  .basic-chart-overview .tone-dots {
    align-self: center;
    justify-self: end;
    grid-row: 1;
    grid-column: 2;
  }

  .basic-chart-overview .tone-dots i {
    width: 7px;
    height: 7px;
  }

  .basic-chart-overview .archive-info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    padding: 0;
  }

  .basic-chart-overview .archive-info-grid div {
    gap: 2px;
    min-height: 48px;
    padding: 7px 8px;
    border-radius: 10px;
  }

  .basic-chart-overview .archive-info-grid .wide {
    display: none;
  }

  .basic-chart-overview .archive-info-grid span {
    font-size: 0.62rem;
  }

  .basic-chart-overview .archive-info-grid strong {
    font-size: 0.74rem;
    line-height: 1.18;
    overflow-wrap: anywhere;
  }

  .archive-person {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 30px 24px 34px;
  }

  .archive-person h3 {
    font-size: 2.7rem;
  }

  .archive-person p {
    font-size: 1.15rem;
  }

  .archive-info-grid {
    grid-template-columns: 1fr;
    padding: 0 20px 30px;
  }

  .pillar-sheet,
  .fortune-section,
  .fortune-summary,
  .fortune-inspector {
    width: calc(100% - 28px);
    margin-left: 14px;
    margin-right: 14px;
  }

  .pillar-sheet {
    overflow-x: visible;
  }

  .sheet-row {
    min-width: 0;
    grid-template-columns: 58px repeat(4, minmax(0, 1fr));
  }

  .head-row {
    min-height: 34px;
  }

  .compact-row {
    min-height: 42px;
  }

  .big-row {
    min-height: 74px;
  }

  .tall-row {
    min-height: 78px;
  }

  .shensha-row {
    min-height: 96px;
  }

  .row-label,
  .row-cell {
    padding: 6px 3px;
  }

  .row-label {
    font-size: 0.74rem;
  }

  .row-cell {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .head-row .row-cell {
    font-size: 0.7rem;
  }

  .detail-row .row-cell {
    font-size: 0.66rem;
  }

  .orb {
    width: 42px;
    height: 42px;
    font-size: 1.26rem;
  }

  .stem-chip,
  .plain-chip {
    min-width: 0;
    padding: 2px 3px;
    border-radius: 5px;
  }

  .stem-chip {
    grid-template-columns: auto auto;
    gap: 2px;
  }

  .stem-chip i {
    width: 16px;
    min-height: 14px;
    font-size: 0.52rem;
  }

  .stem-chip b {
    font-size: 0.72rem;
  }

  .stem-chip small {
    grid-column: 1 / -1;
    font-size: 0.55rem;
    white-space: normal;
  }

  .plain-chip {
    font-size: 0.58rem;
    white-space: normal;
  }

  .liunian-chip {
    flex-basis: 54px;
  }

  .fortune-label {
    width: 88px;
    font-size: 0.88rem;
  }

  .fortune-row {
    grid-template-columns: 88px repeat(var(--fortune-cols), minmax(96px, 1fr));
  }

  .tag-stack span {
    min-height: 22px;
    padding: 3px 6px;
    font-size: 0.68rem;
  }
}
