:root {
  color-scheme: dark;
  --page: #171513;
  --page-soft: #211e1b;
  --paper: #f4f0e8;
  --paper-soft: #fbf9f4;
  --ink: #2c2621;
  --muted: #7c7368;
  --line: #ded7cb;
  --red: #852d24;
  --red-dark: #6f241d;
  --white: #fff;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* 新版命盘工作台 */
.workspace-page {
  color-scheme: light;
  min-width: 320px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 14% 4%, rgba(142, 51, 40, 0.22), transparent 28rem),
    radial-gradient(circle at 92% 18%, rgba(170, 132, 72, 0.1), transparent 25rem),
    #171513;
}

.workspace-page button,
.workspace-page input,
.workspace-page select {
  font: inherit;
}

.workspace-page input:focus-visible,
.workspace-page select:focus-visible,
.workspace-page a:focus-visible,
.workspace-page summary:focus-visible {
  outline: 3px solid rgba(160, 58, 45, 0.28);
  outline-offset: 3px;
}

.ws-skip-link {
  position: fixed;
  z-index: 100;
  top: -60px;
  left: 20px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: #231f1b;
  transition: top 0.2s ease;
}

.ws-skip-link:focus {
  top: 12px;
}

.ws-page-shell {
  width: min(1440px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 28px 32px;
}

.ws-site-header {
  position: relative;
  z-index: 20;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.ws-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #f4eee5;
  text-decoration: none;
}

.ws-global-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-global-nav a,
.ws-global-nav button {
  padding: 9px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #aaa094;
  font-size: 13px;
  text-decoration: none;
}

.ws-global-nav a:hover,
.ws-global-nav button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.ws-app {
  min-height: calc(100dvh - 114px);
  color: var(--ink);
}

.ws-loading-shell {
  display: grid;
  min-height: 60vh;
  place-content: center;
  text-align: center;
}

.ws-loading-shell h1 {
  color: #f3ede5;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 28px;
}

.ws-eyebrow {
  color: #9a3328;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.ws-home {
  overflow: hidden;
  border: 1px solid rgba(224, 216, 204, 0.82);
  border-radius: 30px;
  background:
    linear-gradient(rgba(86, 68, 49, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(86, 68, 49, 0.035) 1px, transparent 1px),
    #f5f1e9;
  background-size: 28px 28px;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.3);
}

.ws-hero {
  position: relative;
  display: grid;
  min-height: 510px;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  align-items: end;
  gap: 64px;
  padding: clamp(50px, 8vw, 110px) clamp(28px, 7vw, 96px) 70px;
  border-bottom: 1px solid #d9d0c4;
}

.ws-hero::before {
  position: absolute;
  top: 45px;
  right: 8%;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(142, 51, 40, 0.12);
  border-radius: 50%;
  box-shadow: inset 0 0 0 34px rgba(142, 51, 40, 0.025), inset 0 0 0 66px rgba(142, 51, 40, 0.025);
  content: "";
  pointer-events: none;
}

.ws-hero-copy {
  position: relative;
  z-index: 1;
}

.ws-hero-copy h1 {
  margin: 16px 0 22px;
  color: #27211d;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(54px, 8vw, 96px);
  font-weight: 650;
  letter-spacing: -0.07em;
  line-height: 1.04;
}

.ws-hero-copy h1 em {
  color: #8a3026;
  font-style: normal;
}

.ws-hero-copy > p {
  width: min(650px, 100%);
  margin: 0;
  color: #665d54;
  font-size: 17px;
  line-height: 1.9;
}

.ws-principle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin-top: 34px;
  color: #554c44;
  font-size: 13px;
}

.ws-principle-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ws-principle-row i {
  color: #9a3328;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  font-style: normal;
}

.ws-hero-note {
  position: relative;
  z-index: 1;
  padding: 26px;
  border-top: 2px solid #8a3026;
  background: rgba(238, 232, 220, 0.75);
}

.ws-hero-note > span {
  color: #8a3026;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.ws-hero-note blockquote {
  margin: 18px 0;
  color: #332c27;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 20px;
  line-height: 1.65;
}

.ws-hero-note p {
  margin: 0;
  color: #7b7167;
  font-size: 12px;
  line-height: 1.7;
}

.ws-method-section,
.ws-recent-section {
  padding: 58px clamp(24px, 6vw, 80px);
  border-bottom: 1px solid #ddd5ca;
}

.ws-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 30px;
}

.ws-section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 13px;
}

.ws-section-heading > div > span {
  color: #9a3328;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.ws-section-heading h2 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(24px, 3vw, 34px);
}

.ws-section-heading > p {
  width: min(520px, 50%);
  margin: 0;
  color: #786f65;
  font-size: 13px;
  line-height: 1.7;
  text-align: right;
}

.ws-section-heading > button {
  border: 0;
  background: none;
  color: #8a3026;
  font-size: 13px;
}

.ws-primary-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ws-method-card {
  position: relative;
  display: grid;
  min-height: 238px;
  grid-template-columns: auto 1fr;
  grid-template-rows: 1fr auto;
  gap: 24px;
  padding: 32px;
  overflow: hidden;
  border: 1px solid #d7cec2;
  border-radius: 22px;
  background: #fbf9f4;
  color: #2c2621;
  text-align: left;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ws-method-card::after {
  position: absolute;
  right: -60px;
  bottom: -100px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(139, 48, 38, 0.1);
  border-radius: 50%;
  content: "";
}

.ws-method-card:hover {
  z-index: 1;
  border-color: rgba(138, 48, 38, 0.45);
  box-shadow: 0 20px 48px rgba(54, 39, 27, 0.12);
  transform: translateY(-3px);
}

.ws-method-card.ziwei {
  background: #27221e;
  color: #f4eee6;
}

.ws-method-card.ziwei .ws-method-copy small,
.ws-method-card.ziwei .ws-method-index {
  color: #aaa094;
}

.ws-method-card.ziwei .ws-method-action {
  border-color: #554b43;
}

.ws-method-index {
  position: absolute;
  top: 24px;
  right: 28px;
  color: #9a9085;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.ws-method-seal {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(139, 48, 38, 0.25);
  border-radius: 10px;
  background: rgba(139, 48, 38, 0.08);
  color: #8a3026;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 16px;
}

.ws-method-seal.large {
  width: 66px;
  height: 66px;
  align-self: start;
  border-radius: 18px;
  font-size: 29px;
}

.ziwei .ws-method-seal {
  border-color: rgba(220, 195, 160, 0.3);
  background: rgba(220, 195, 160, 0.08);
  color: #dbc7a9;
}

.ws-method-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.ws-method-copy strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(25px, 3vw, 36px);
}

.ws-method-copy small {
  color: #756b61;
  font-size: 14px;
  line-height: 1.7;
}

.ws-method-action {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid #dfd7cc;
  font-size: 13px;
  font-weight: 700;
}

.ws-method-action i {
  color: #9a3328;
  font-size: 19px;
  font-style: normal;
}

.ws-legacy-section {
  background: rgba(238, 232, 220, 0.55);
}

.ws-legacy-methods {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ws-legacy-card {
  display: grid;
  min-height: 160px;
  grid-template-columns: auto 1fr;
  align-content: start;
  gap: 18px 14px;
  padding: 22px;
  border: 1px solid #d7cec2;
  border-radius: 17px;
  background: rgba(251, 249, 244, 0.84);
  color: #302923;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ws-legacy-card:hover {
  background: #fff;
  transform: translateY(-2px);
}

.ws-legacy-card > span:nth-child(2) {
  display: grid;
  gap: 7px;
}

.ws-legacy-card strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 17px;
}

.ws-legacy-card small {
  color: #7b7167;
  font-size: 12px;
  line-height: 1.55;
}

.ws-legacy-card em {
  grid-column: 1 / -1;
  align-self: end;
  color: #968a7f;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.1em;
}

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

.ws-record-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid #ddd4c8;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.56);
  color: #322b25;
  text-align: left;
  text-decoration: none;
}

.ws-record-card:hover {
  border-color: #b9aa9b;
  background: #fff;
}

.ws-record-main {
  display: grid;
  gap: 4px;
}

.ws-record-main small,
.ws-record-state {
  color: #847a70;
  font-size: 11px;
}

.ws-record-card > i {
  color: #9a3328;
  font-style: normal;
}

.ws-empty-records {
  padding: 28px;
  border: 1px dashed #cfc4b7;
  border-radius: 16px;
  color: #696056;
  text-align: center;
}

.ws-empty-records p {
  margin: 8px 0 0;
  font-size: 12px;
}

.ws-home-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 34px clamp(24px, 6vw, 80px);
  color: #736960;
  font-size: 12px;
}

.ws-home-footer p {
  margin: 0;
}

.ws-home-footer button {
  flex: 0 0 auto;
  border: 0;
  background: none;
  color: #8a3026;
}

/* 问卷 */
.ws-intake-shell {
  min-height: calc(100dvh - 114px);
  overflow: hidden;
  border: 1px solid #ded6ca;
  border-radius: 28px;
  background: #f5f1e9;
  box-shadow: 0 32px 92px rgba(0, 0, 0, 0.28);
}

.ws-intake-topbar,
.ws-result-topbar {
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 12px 24px;
  border-bottom: 1px solid #ddd5ca;
  background: rgba(251, 249, 244, 0.92);
}

.ws-intake-topbar > button,
.ws-result-topbar button {
  border: 0;
  background: transparent;
  color: #72685f;
  font-size: 13px;
}

.ws-intake-topbar > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ws-intake-topbar > span {
  color: #91867b;
  font-size: 11px;
}

.ws-stepper {
  display: grid;
  width: min(720px, calc(100% - 48px));
  margin: 34px auto 28px;
  padding: 0;
  grid-template-columns: repeat(3, 1fr);
  list-style: none;
}

.ws-stepper li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #9c9186;
  font-size: 11px;
}

.ws-stepper li:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 15px;
  left: calc(50% + 20px);
  width: calc(100% - 40px);
  height: 1px;
  background: #d4cbbf;
  content: "";
}

.ws-stepper li.done:not(:last-child)::after {
  background: #9a3328;
}

.ws-stepper li span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #cfc5b8;
  border-radius: 50%;
  background: #f5f1e9;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.ws-stepper li.active,
.ws-stepper li.done {
  color: #7f2b22;
  font-weight: 700;
}

.ws-stepper li.active span,
.ws-stepper li.done span {
  border-color: #9a3328;
  background: #9a3328;
  color: #fff;
}

.ws-stepper li em {
  font-style: normal;
}

.ws-intake-card {
  position: relative;
  width: min(900px, calc(100% - 40px));
  min-height: 540px;
  margin: 0 auto 50px;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid #d8cfc3;
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 18px 48px rgba(61, 45, 31, 0.08);
}

.ws-intake-form {
  display: grid;
  gap: 34px;
}

.ws-form-heading {
  max-width: 690px;
}

.ws-form-heading h1 {
  margin: 10px 0 12px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(27px, 4vw, 40px);
  line-height: 1.25;
}

.ws-form-heading p {
  margin: 0;
  color: #766d63;
  font-size: 14px;
  line-height: 1.8;
}

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

.ws-field {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
  color: #3b332d;
}

.ws-field-wide {
  grid-column: 1 / -1;
}

.ws-field > span,
.ws-field legend {
  padding: 0;
  font-size: 13px;
  font-weight: 750;
}

.ws-field > span small,
.ws-field legend small {
  margin-left: 5px;
  color: #9a8f84;
  font-size: 10px;
  font-weight: 500;
}

.ws-field > input,
.ws-field select,
.ws-time-row select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid #d7cec3;
  border-radius: 12px;
  background: #fbfaf7;
  color: #302923;
}

.ws-field > input:focus,
.ws-field select:focus {
  border-color: #9a3328;
}

.ws-field > small {
  color: #91867b;
  font-size: 11px;
  line-height: 1.55;
}

.ws-field.muted {
  opacity: 0.7;
}

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

.ws-segmented-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ws-segmented label {
  position: relative;
}

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

.ws-segmented span {
  display: grid;
  min-height: 48px;
  place-items: center;
  border: 1px solid #d7cec3;
  border-radius: 12px;
  background: #fbfaf7;
  color: #6c6259;
  font-size: 13px;
  cursor: pointer;
}

.ws-segmented input:checked + span {
  border-color: #9a3328;
  background: rgba(154, 51, 40, 0.07);
  color: #842d24;
  font-weight: 750;
  box-shadow: inset 0 0 0 1px rgba(154, 51, 40, 0.15);
}

.ws-segmented input:focus-visible + span,
.ws-radio-cards input:focus-visible + span {
  outline: 3px solid rgba(154, 51, 40, 0.22);
  outline-offset: 2px;
}

.ws-time-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ws-time-row.disabled {
  opacity: 0.45;
}

.ws-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6c6259;
  font-size: 12px;
}

.ws-check input {
  width: 16px;
  height: 16px;
  accent-color: #8a3026;
}

.ws-radio-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ws-radio-cards label {
  position: relative;
}

.ws-radio-cards input {
  position: absolute;
  opacity: 0;
}

.ws-radio-cards label > span {
  display: grid;
  min-height: 100px;
  align-content: start;
  gap: 7px;
  padding: 16px;
  border: 1px solid #d8cfc4;
  border-radius: 14px;
  background: #fbfaf7;
  cursor: pointer;
}

.ws-radio-cards input:checked + span {
  border-color: #9a3328;
  background: rgba(154, 51, 40, 0.06);
}

.ws-radio-cards small,
.ws-option-line small {
  color: #8d8278;
  font-size: 11px;
  line-height: 1.5;
}

.ws-radio-cards label.muted {
  opacity: 0.45;
}

.ws-advanced {
  overflow: hidden;
  border: 1px solid #ddd4c9;
  border-radius: 15px;
  background: #f8f5ef;
}

.ws-advanced summary {
  display: flex;
  padding: 16px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.ws-advanced summary span {
  color: #91867b;
  font-size: 10px;
  font-weight: 500;
}

.ws-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding: 6px 18px 20px;
}

.ws-option-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 9px;
  margin-top: 12px;
}

.ws-option-line input {
  grid-row: 1 / 3;
  margin-top: 3px;
  accent-color: #8a3026;
}

.ws-option-line span {
  display: grid;
  gap: 3px;
}

.ws-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 5px;
}

.ws-button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid #d5ccc0;
  border-radius: 12px;
  background: #fff;
  color: #4d443c;
  font-size: 13px;
  font-weight: 700;
}

.ws-button.primary {
  border-color: #79271f;
  background: #862f25;
  color: #fff;
  box-shadow: 0 9px 22px rgba(134, 47, 37, 0.2);
}

.ws-button.primary:hover {
  background: #74271f;
}

.ws-button.ghost {
  background: transparent;
}

.ws-button.danger {
  border-color: rgba(143, 46, 37, 0.24);
  color: #8a3026;
}

.ws-page-error {
  padding: 15px 18px;
  border: 1px solid rgba(154, 51, 40, 0.28);
  border-radius: 13px;
  background: rgba(154, 51, 40, 0.06);
  color: #7f2b22;
}

.ws-page-error p {
  margin: 5px 0 0;
  font-size: 12px;
}

.ws-busy-cover {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  border-radius: inherit;
  background: rgba(255, 253, 249, 0.94);
  text-align: center;
}

.ws-busy-cover i {
  width: 34px;
  height: 34px;
  border: 2px solid #dbcfc3;
  border-top-color: #8a3026;
  border-radius: 50%;
  animation: ws-spin 0.8s linear infinite;
}

.ws-busy-cover span {
  color: #887d73;
  font-size: 11px;
}

@keyframes ws-spin {
  to { transform: rotate(360deg); }
}

.ws-time-audit {
  overflow: hidden;
  border: 1px solid #d5ccc0;
  border-radius: 18px;
  background: #f7f3ec;
}

.ws-time-audit.crossed {
  border-color: rgba(154, 51, 40, 0.45);
}

.ws-audit-status {
  padding: 22px 24px;
  border-bottom: 1px solid #d8cfc3;
}

.ws-audit-status span {
  color: #8a3026;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ws-audit-status strong {
  display: block;
  margin-top: 7px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 22px;
}

.ws-audit-status p {
  margin: 8px 0 0;
  color: #736a61;
  font-size: 12px;
  line-height: 1.6;
}

.ws-audit-grid {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ws-audit-grid > div {
  padding: 17px 20px;
  border-right: 1px solid #ddd4c8;
  border-bottom: 1px solid #ddd4c8;
}

.ws-audit-grid > div:nth-child(3n) {
  border-right: 0;
}

.ws-audit-grid > div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.ws-audit-grid dt {
  color: #8a7f75;
  font-size: 10px;
}

.ws-audit-grid dd {
  margin: 6px 0 0;
  color: #342d27;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
  font-weight: 750;
}

.ws-audit-grid .accent {
  background: rgba(154, 51, 40, 0.06);
}

.ws-audit-grid .accent dd {
  color: #8a3026;
}

.ws-confirm-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ws-confirm-notes article {
  padding: 17px;
  border: 1px solid #ded5ca;
  border-radius: 14px;
}

.ws-confirm-notes span {
  display: block;
  color: #91867b;
  font-size: 10px;
}

.ws-confirm-notes strong {
  display: block;
  margin-top: 6px;
}

.ws-confirm-notes p {
  margin: 8px 0 0;
  color: #7b7167;
  font-size: 11px;
  line-height: 1.55;
}

.ws-limitations,
.ws-chart-boundary {
  padding: 14px 16px;
  border: 1px solid #ded5ca;
  border-radius: 13px;
  background: #faf8f3;
}

.ws-limitations summary,
.ws-chart-boundary summary {
  color: #6f655c;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.ws-limitations li {
  margin-top: 8px;
  color: #766d63;
  font-size: 12px;
  line-height: 1.6;
}

/* 初始结果工作台 */
.ws-result-shell {
  min-height: calc(100dvh - 114px);
  overflow: clip;
  border: 1px solid #ded6ca;
  border-radius: 26px;
  background: #f7f4ee;
  box-shadow: 0 32px 92px rgba(0, 0, 0, 0.28);
}

.ws-result-topbar {
  position: sticky;
  z-index: 15;
  top: 0;
}

.ws-result-back,
.ws-result-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ws-result-back > span {
  width: 1px;
  height: 20px;
  background: #d9d0c5;
}

.ws-result-meta > span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(154, 51, 40, 0.08);
  color: #8a3026;
  font-size: 11px;
  font-weight: 750;
}

.ws-result-layout {
  display: grid;
  grid-template-columns: minmax(390px, 40%) minmax(0, 60%);
  align-items: start;
}

.ws-result-ziwei .ws-result-layout {
  grid-template-columns: minmax(500px, 48%) minmax(0, 52%);
}

.ws-chart-column {
  align-self: stretch;
  padding: 28px;
  border-right: 1px solid #ded6ca;
  background: #eee8de;
}

.ws-chart-sticky {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}

.ws-result-audit {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 13px 15px;
  border: 1px solid #d4cabe;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.64);
}

.ws-result-audit span {
  color: #8a3026;
  font-size: 10px;
  font-weight: 800;
}

.ws-result-audit strong {
  grid-row: 1 / 3;
  grid-column: 2;
  align-self: center;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

.ws-result-audit small {
  color: #857a70;
  font-size: 10px;
}

.ws-chart-preview {
  overflow: hidden;
  border: 1px solid #cfc4b7;
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: 0 15px 34px rgba(62, 47, 34, 0.1);
}

.ws-chart-preview > header,
.ws-chart-preview > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
}

.ws-chart-preview > header {
  border-bottom: 1px solid #ddd4c8;
}

.ws-chart-preview > header span {
  color: #8a3026;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ws-chart-preview > header h2 {
  margin: 3px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 20px;
}

.ws-chart-preview > header em,
.ws-chart-preview > footer {
  color: #8b8076;
  font-size: 9px;
  font-style: normal;
}

.ws-chart-preview > footer {
  border-top: 1px solid #ddd4c8;
}

.ws-mini-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 24px 18px;
}

.ws-mini-pillars > div {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 8px;
  border-right: 1px solid #e2dad0;
}

.ws-mini-pillars > div:last-child {
  border-right: 0;
}

.ws-mini-pillars span {
  color: #8c8176;
  font-size: 10px;
}

.ws-mini-pillars strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
}

.ws-mini-facts {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #ddd4c8;
  background: #f7f3ec;
}

.ws-mini-facts div {
  padding: 13px;
  border-right: 1px solid #ddd4c8;
  text-align: center;
}

.ws-mini-facts div:last-child { border-right: 0; }
.ws-mini-facts dt { color: #897e73; font-size: 9px; }
.ws-mini-facts dd { margin: 5px 0 0; font-size: 12px; font-weight: 750; }

.ws-ziwei-mini-core {
  display: grid;
  min-height: 150px;
  place-content: center;
  justify-items: center;
  background: radial-gradient(circle, rgba(154, 51, 40, 0.08), transparent 60%);
}

.ws-ziwei-mini-core span { color: #8a3026; font-size: 9px; letter-spacing: 0.12em; }
.ws-ziwei-mini-core strong { margin-top: 9px; font-family: "Noto Serif SC", "Songti SC", serif; font-size: 23px; }
.ws-ziwei-mini-core p { margin: 7px 0 0; color: #786e64; font-size: 11px; }

.ws-palace-name-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #ddd4c8;
}

.ws-palace-name-grid span {
  padding: 10px 4px;
  border-right: 1px solid #e0d8cd;
  border-bottom: 1px solid #e0d8cd;
  color: #70665d;
  font-size: 10px;
  text-align: center;
}

.ws-chart-boundary p {
  margin: 9px 0 0;
  color: #7d7369;
  font-size: 11px;
  line-height: 1.6;
}

.ws-reading-column {
  min-width: 0;
  padding: 28px clamp(28px, 5vw, 70px) 80px;
}

.ws-view-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: #e9e3da;
}

.ws-view-switch button {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #756b62;
  font-size: 13px;
}

.ws-view-switch button.active {
  background: #fff;
  color: #302923;
  font-weight: 750;
  box-shadow: 0 3px 12px rgba(64, 49, 36, 0.1);
}

.ws-topic-tabs {
  display: flex;
  gap: 4px;
  margin: 18px 0 40px;
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ws-topic-tabs button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #83786e;
  font-size: 12px;
}

.ws-topic-tabs button.active {
  background: #fff;
  color: #812b23;
  font-weight: 750;
  box-shadow: 0 4px 14px rgba(64, 49, 36, 0.08);
}

.ws-topic-heading {
  max-width: 780px;
  padding-bottom: 34px;
  border-bottom: 1px solid #ddd5ca;
}

.ws-topic-heading > span,
.ws-content-heading span {
  color: #8a3026;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ws-topic-heading h1 {
  margin: 10px 0 14px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.22;
}

.ws-topic-heading p {
  margin: 0;
  color: #5f574f;
  font-size: 17px;
  line-height: 1.9;
}

.ws-fixed-reading {
  display: grid;
  gap: 24px;
  max-width: 860px;
  margin-top: 30px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid #d9cfc2;
  border-radius: 20px;
  background: linear-gradient(145deg, #fffdf9, #f6efe6);
  box-shadow: 0 16px 40px rgba(77, 57, 40, 0.07);
}

.ws-fixed-reading-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.ws-fixed-reading-header span {
  color: #8a3026;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ws-fixed-reading-header h2 {
  margin: 6px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(24px, 3vw, 32px);
}

.ws-fixed-reading-header em {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #d8cabc;
  border-radius: 999px;
  background: #fffaf3;
  color: #73685f;
  font-size: 11px;
  font-style: normal;
}

.ws-fixed-reading-header em[data-source="deepseek"] {
  border-color: rgba(132, 43, 36, 0.25);
  background: rgba(145, 49, 40, 0.08);
  color: #812b23;
}

.ws-reading-lead {
  margin: 0;
  color: #3d352f;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 19px;
  line-height: 1.9;
}

.ws-reading-claims {
  display: grid;
  gap: 12px;
}

.ws-reading-claims article {
  padding: 18px 20px;
  border-left: 3px solid #96352b;
  background: rgba(255, 255, 255, 0.7);
}

.ws-reading-claims p,
.ws-reading-block p,
.ws-reading-block li,
.ws-reading-glossary p,
.ws-fixed-reading footer p {
  color: #554b43;
  font-size: 16px;
  line-height: 1.8;
}

.ws-reading-claims p,
.ws-reading-block p,
.ws-fixed-reading footer p {
  margin: 0;
}

.ws-reading-claims small {
  display: block;
  margin-top: 10px;
  color: #8b8076;
  font-size: 11px;
}

.ws-reading-claim-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.ws-reading-claim-evidence button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #d6c7b9;
  border-radius: 8px;
  background: #fffaf3;
  color: #812b23;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.ws-reading-block {
  display: grid;
  gap: 10px;
  padding-top: 22px;
  border-top: 1px solid #ded4c8;
}

.ws-reading-block h3 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 21px;
}

.ws-reading-counter ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.25em;
}

.ws-reading-glossary {
  padding: 16px 18px;
  border: 1px solid #ded4c8;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.ws-reading-glossary summary {
  cursor: pointer;
  font-size: 16px;
  font-weight: 750;
}

.ws-reading-glossary p {
  margin: 12px 0 0;
}

.ws-reading-glossary strong {
  margin-right: 10px;
  color: #812b23;
}

.ws-fixed-reading footer {
  padding-top: 18px;
  border-top: 1px dashed #d4c8ba;
}

.ws-fixed-reading footer small {
  display: block;
  margin-top: 8px;
  color: #877b70;
  font-size: 12px;
  line-height: 1.6;
}

.ws-reading-loading {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 104px;
}

.ws-reading-loading > span {
  width: 24px;
  height: 24px;
  border: 3px solid #dfd3c5;
  border-top-color: #913128;
  border-radius: 50%;
  animation: ws-reading-spin 0.8s linear infinite;
}

.ws-reading-loading strong,
.ws-reading-error strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 19px;
}

.ws-reading-loading p,
.ws-reading-error p {
  margin: 5px 0 0;
  color: #756a60;
  font-size: 16px;
  line-height: 1.6;
}

.ws-reading-error button {
  justify-self: start;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid #913128;
  border-radius: 9px;
  background: #913128;
  color: #fff;
}

@keyframes ws-reading-spin {
  to { transform: rotate(360deg); }
}

.ws-program-facts,
.ws-evidence-section,
.ws-topic-limitations {
  margin-top: 36px;
}

.ws-program-facts h2,
.ws-topic-limitations h2 {
  margin: 0 0 14px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 21px;
}

.ws-program-facts ul,
.ws-topic-limitations ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ws-program-facts li,
.ws-topic-limitations li {
  position: relative;
  padding-left: 18px;
  color: #5f574f;
  font-size: 16px;
  line-height: 1.75;
}

.ws-program-facts li::before,
.ws-topic-limitations li::before {
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9a3328;
  content: "";
}

.ws-content-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 17px;
}

.ws-content-heading h2 {
  margin: 5px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 24px;
}

.ws-content-heading p {
  max-width: 320px;
  margin: 0;
  color: #8a8076;
  font-size: 11px;
  line-height: 1.55;
  text-align: right;
}

.ws-evidence-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ws-evidence-card {
  padding: 18px;
  border: 1px solid #ddd4c9;
  border-radius: 15px;
  background: #fffdf9;
}

.ws-evidence-card header,
.ws-evidence-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #92877d;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
}

.ws-evidence-card header em {
  padding: 4px 7px;
  border-radius: 999px;
  background: #ece7df;
  font-family: inherit;
  font-style: normal;
}

.ws-evidence-card header em[data-direction="tension"] { background: rgba(154, 51, 40, 0.1); color: #8a3026; }
.ws-evidence-card header em[data-direction="pending"] { background: #eee8d3; color: #756326; }

.ws-evidence-card h3 {
  margin: 15px 0 8px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 17px;
}

.ws-evidence-card p {
  margin: 0 0 16px;
  color: #625950;
  font-size: 14px;
  line-height: 1.7;
}

.ws-topic-limitations {
  padding: 22px;
  border-left: 3px solid #a28f72;
  background: #eee8de;
}

.ws-empty-evidence {
  color: #7e746a;
  font-size: 14px;
}

.ws-mobile-consult {
  display: none;
}

/* 证据约束咨询 */
.ws-consultation {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.ws-consultation-context {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid #ddd5ca;
}

.ws-consultation-context span {
  color: #8a3026;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ws-consultation-context h1 {
  margin: 8px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(28px, 3.3vw, 42px);
}

.ws-consultation-context > p {
  display: grid;
  max-width: 340px;
  gap: 6px;
  margin: 0;
  text-align: right;
}

.ws-consultation-context > p strong { color: #812b23; font-size: 13px; }
.ws-consultation-context > p small { color: #80766d; font-size: 11px; line-height: 1.55; }

.ws-consultation-prompts {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.ws-consultation-prompts button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid #d8cec2;
  border-radius: 999px;
  background: #fffdf9;
  color: #655c54;
  font-size: 11px;
}

.ws-consultation-thread {
  display: grid;
  gap: 16px;
}

.ws-consultation-empty {
  padding: 34px;
  border: 1px dashed #cfc4b7;
  border-radius: 17px;
  background: rgba(255, 253, 249, 0.55);
  text-align: center;
}

.ws-consultation-empty strong { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 21px; }
.ws-consultation-empty p { max-width: 580px; margin: 10px auto 0; color: #746a61; font-size: 14px; line-height: 1.7; }

.ws-consultation-message {
  border-radius: 17px;
}

.ws-consultation-message.user {
  justify-self: end;
  max-width: min(640px, 88%);
  padding: 15px 18px;
  background: #e5ddd2;
}

.ws-consultation-message.user span { color: #8a3026; font-size: 9px; font-weight: 800; }
.ws-consultation-message.user p { margin: 6px 0 0; color: #403831; font-size: 16px; line-height: 1.65; }

.ws-consultation-message.assistant {
  padding: 23px;
  border: 1px solid #d9cfc3;
  background: #fffdf9;
  box-shadow: 0 12px 28px rgba(63, 48, 35, 0.07);
}

.ws-consultation-message.assistant > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #8a3026;
  font-size: 11px;
  font-weight: 800;
}

.ws-consultation-message.assistant > header em { color: #8b8178; font-size: 9px; font-style: normal; font-weight: 500; }
.ws-consultation-direct { margin: 20px 0 24px; color: #342d27; font-family: "Noto Serif SC", "Songti SC", serif; font-size: 21px; line-height: 1.75; }
.ws-consultation-message section { display: grid; gap: 10px; margin-top: 20px; }
.ws-consultation-message h3 { margin: 0; font-size: 15px; }

.ws-consultation-claim {
  padding: 16px;
  border-left: 3px solid #913128;
  background: #f2ede5;
}

.ws-consultation-claim p { margin: 0; color: #4f463e; font-size: 16px; line-height: 1.7; }
.ws-consultation-claim small { display: block; margin-top: 8px; color: #887d73; font-size: 10px; }
.ws-consultation-evidence { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ws-consultation-evidence button { padding: 6px 9px; border: 1px solid #d2c5b8; border-radius: 8px; background: #fffaf3; color: #7f2b24; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }

.ws-consultation-message details { margin-top: 18px; border-top: 1px solid #e2d9ce; padding-top: 14px; }
.ws-consultation-message summary { cursor: pointer; font-size: 14px; font-weight: 750; }
.ws-consultation-message ul { display: grid; gap: 7px; margin: 12px 0 0; padding-left: 20px; }
.ws-consultation-message li { color: #625950; font-size: 14px; line-height: 1.65; }
.ws-consultation-next { margin-top: 18px; padding: 16px; border-radius: 12px; background: rgba(132, 45, 36, 0.08); }
.ws-consultation-next strong { color: #812b23; font-size: 12px; }
.ws-consultation-next p { margin: 6px 0 0; color: #514841; font-size: 15px; line-height: 1.65; }
.ws-consultation-boundary { margin: 18px 0 0; color: #746a61; font-size: 12px; line-height: 1.65; }
.ws-consultation-notice { display: block; margin-top: 10px; color: #8b8178; }

.ws-consultation-form {
  position: sticky;
  z-index: 12;
  bottom: 14px;
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #cec2b5;
  border-radius: 17px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 18px 38px rgba(54, 40, 30, 0.16);
  backdrop-filter: blur(14px);
}

.ws-consultation-form label { display: grid; gap: 8px; }
.ws-consultation-form label span { color: #5f564e; font-size: 11px; font-weight: 750; }
.ws-consultation-form textarea { width: 100%; min-height: 76px; resize: vertical; border: 0; outline: 0; background: transparent; color: #302923; font: inherit; font-size: 16px; line-height: 1.6; }
.ws-consultation-form > div { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.ws-consultation-form > div small { color: #8b8178; font-size: 10px; line-height: 1.5; }
.ws-consultation-form button { flex: 0 0 auto; min-height: 40px; padding: 0 18px; border: 1px solid #75271f; border-radius: 10px; background: #862f25; color: #fff; font-weight: 750; }
.ws-consultation-form button:disabled { cursor: wait; opacity: 0.55; }
.ws-consultation-error { margin: 0; padding: 12px 14px; border: 1px solid #d39c94; border-radius: 10px; background: #f7e5e1; color: #812b23; font-size: 13px; }

/* 新版结果反馈 */
.ws-result-feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 36px;
  padding: 20px;
  border: 1px solid #d8cec2;
  border-radius: 15px;
  background: #fffdf9;
}

.ws-result-feedback > div:first-child { display: grid; gap: 5px; }
.ws-result-feedback span { color: #8a3026; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.ws-result-feedback strong { font-family: "Noto Serif SC", "Songti SC", serif; font-size: 17px; }
.ws-result-feedback small { color: #867b71; font-size: 10px; line-height: 1.5; }
.ws-feedback-ratings,
.ws-feedback-reasons,
.ws-feedback-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-result-feedback button { min-height: 34px; padding: 0 12px; border: 1px solid #d5c9bc; border-radius: 9px; background: #f8f3ec; color: #655b52; }
.ws-result-feedback button:hover,
.ws-result-feedback button.selected { border-color: #913128; background: rgba(145, 49, 40, 0.09); color: #812b23; }
.ws-result-feedback.detail { display: grid; }
.ws-feedback-actions { justify-content: flex-end; }
.ws-feedback-actions button.primary { border-color: #75271f; background: #862f25; color: #fff; }

/* 抽屉 */
.ws-overlay-open {
  overflow: hidden;
}

.ws-overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(19, 17, 15, 0.62);
  backdrop-filter: blur(4px);
}

.ws-side-panel {
  display: flex;
  width: min(440px, 94vw);
  height: 100%;
  flex-direction: column;
  background: #f6f2ea;
  color: #302923;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.28);
}

.ws-side-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid #ddd4c8;
}

.ws-side-panel > header span {
  color: #8a3026;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ws-side-panel > header h2 {
  margin: 5px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 25px;
}

.ws-side-panel > header button {
  width: 38px;
  height: 38px;
  border: 1px solid #d8cfc3;
  border-radius: 50%;
  background: #fff;
  color: #766c62;
  font-size: 23px;
}

.ws-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.ws-panel-group + .ws-panel-group { margin-top: 24px; }
.ws-panel-group > h3 { margin: 0; padding: 0 0 8px; border-bottom: 1px solid #d9d0c5; color: #8a3026; font-size: 11px; letter-spacing: 0.08em; }

.ws-side-panel > footer {
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid #ddd4c8;
}

.ws-panel-record {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #e1d9cf;
}

.ws-panel-record > button:first-child,
.ws-panel-record > a:first-child {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  border: 0;
  background: none;
  color: #332c27;
  text-align: left;
  text-decoration: none;
}

.ws-panel-record > button:first-child > span:last-child,
.ws-panel-record > a:first-child > span:last-child {
  display: grid;
  gap: 4px;
}

.ws-panel-record small {
  color: #897f74;
  font-size: 10px;
}

.ws-panel-record > button:last-child {
  border: 0;
  background: none;
  color: #9b5149;
  font-size: 11px;
}

.ws-empty-panel {
  padding: 60px 20px;
  color: #756b62;
  text-align: center;
}

.ws-method-chain {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ws-method-chain li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 17px 0;
  border-bottom: 1px solid #e0d8cd;
}

.ws-method-chain li > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #8a3026;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.ws-method-chain strong { font-size: 14px; }
.ws-method-chain p { margin: 5px 0 0; color: #776d64; font-size: 12px; line-height: 1.6; }

.ws-boundary-note {
  margin-top: 18px;
  padding: 17px;
  border: 1px solid #ddd4c8;
  border-radius: 14px;
  background: #fffdf9;
}

.ws-boundary-note p {
  margin: 7px 0 0;
  color: #746a61;
  font-size: 12px;
  line-height: 1.7;
}

.ws-toast {
  position: fixed;
  z-index: 100;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  max-width: min(440px, calc(100vw - 32px));
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: #28231f;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 12px;
  transform: translateX(-50%);
}

.legacy-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.legacy-header-actions > a {
  color: #b8aea2;
  font-size: 12px;
  text-decoration: none;
}

@media (max-width: 960px) {
  .ws-page-shell { padding: 0 18px 24px; }
  .ws-hero { grid-template-columns: 1fr; align-items: start; gap: 36px; }
  .ws-hero-note { max-width: 560px; }
  .ws-legacy-methods { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-result-layout { grid-template-columns: minmax(330px, 42%) minmax(0, 58%); }
  .ws-chart-column { padding: 18px; }
  .ws-reading-column { padding-right: 28px; padding-left: 28px; }
  .ws-evidence-list { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .workspace-page { background: #171513; }
  .ws-page-shell { padding: 0; }
  .ws-site-header { min-height: 66px; padding: 0 16px; }
  .ws-brand .brand-copy small { display: none; }
  .ws-global-nav { gap: 0; }
  .ws-global-nav a { display: none; }
  .ws-global-nav a,
  .ws-global-nav button { padding: 8px; font-size: 11px; }
  .ws-global-nav button[data-open-about] { display: none; }
  .ws-app { min-height: calc(100dvh - 66px); }
  .ws-home,
  .ws-intake-shell,
  .ws-result-shell { min-height: calc(100dvh - 66px); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 22px 22px 0 0; }
  .ws-hero { min-height: 0; padding: 54px 22px 40px; }
  .ws-hero::before { top: 36px; right: -100px; width: 220px; height: 220px; }
  .ws-hero-copy h1 { margin-top: 12px; font-size: clamp(49px, 16vw, 68px); }
  .ws-hero-copy > p { font-size: 16px; line-height: 1.8; }
  .ws-principle-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .ws-principle-row span { display: grid; justify-items: start; gap: 4px; font-size: 11px; }
  .ws-hero-note { padding: 20px; }
  .ws-hero-note blockquote { font-size: 18px; }
  .ws-method-section,
  .ws-recent-section { padding: 38px 18px; }
  .ws-section-heading { display: grid; gap: 12px; }
  .ws-section-heading > p { width: 100%; text-align: left; }
  .ws-primary-methods,
  .ws-record-grid { grid-template-columns: 1fr; }
  .ws-method-card { min-height: 205px; padding: 24px; }
  .ws-method-seal.large { width: 55px; height: 55px; font-size: 24px; }
  .ws-method-copy strong { font-size: 26px; }
  .ws-legacy-methods { display: flex; gap: 10px; margin: 0 -18px; padding: 0 18px 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
  .ws-legacy-card { min-width: 245px; scroll-snap-align: start; }
  .ws-home-footer { display: grid; padding: 28px 18px; }
  .ws-intake-topbar { min-height: 58px; padding: 10px 14px; }
  .ws-intake-topbar > span { display: none; }
  .ws-stepper { width: calc(100% - 34px); margin: 24px auto 20px; }
  .ws-stepper li em { font-size: 10px; }
  .ws-intake-card { width: calc(100% - 22px); min-height: 0; margin-bottom: 24px; padding: 25px 18px; border-radius: 19px; }
  .ws-intake-form { gap: 28px; }
  .ws-form-heading h1 { font-size: 28px; }
  .ws-form-heading p { font-size: 13px; }
  .ws-form-grid { grid-template-columns: 1fr; gap: 19px; }
  .ws-field-wide { grid-column: auto; }
  .ws-segmented-three { grid-template-columns: 1fr; }
  .ws-radio-cards { grid-template-columns: 1fr; }
  .ws-radio-cards label > span { min-height: 76px; }
  .ws-advanced-grid { grid-template-columns: 1fr; }
  .ws-advanced summary { align-items: start; }
  .ws-advanced summary span { max-width: 55%; text-align: right; }
  .ws-form-actions { position: sticky; z-index: 3; bottom: 0; margin: 0 -18px -25px; padding: 13px 18px calc(13px + env(safe-area-inset-bottom)); border-top: 1px solid #ddd4c9; background: rgba(255, 253, 249, 0.96); }
  .ws-form-actions .ws-button { flex: 1; }
  .ws-audit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-audit-grid > div:nth-child(3n) { border-right: 1px solid #ddd4c8; }
  .ws-audit-grid > div:nth-child(2n) { border-right: 0; }
  .ws-audit-grid > div:nth-last-child(-n + 3) { border-bottom: 1px solid #ddd4c8; }
  .ws-audit-grid > div:nth-last-child(-n + 2) { border-bottom: 0; }
  .ws-confirm-notes { grid-template-columns: 1fr; }
  .ws-result-topbar { min-height: 56px; padding: 9px 12px; }
  .ws-result-meta button[data-delete-record] { display: none; }
  .ws-result-layout { display: block; }
  .ws-chart-column { padding: 14px; border-right: 0; border-bottom: 1px solid #ddd5ca; }
  .ws-chart-sticky { position: static; }
  .ws-chart-preview > header em,
  .ws-chart-preview > footer span:last-child { display: none; }
  .ws-mini-pillars strong { font-size: 23px; }
  .ws-reading-column { padding: 18px 16px calc(104px + env(safe-area-inset-bottom)); }
  .ws-topic-tabs { position: sticky; z-index: 10; top: 56px; margin: 14px -16px 28px; padding: 9px 16px; background: rgba(247, 244, 238, 0.96); }
  .ws-topic-heading h1 { font-size: 30px; }
  .ws-topic-heading p { font-size: 16px; }
  .ws-program-facts li,
  .ws-topic-limitations li { font-size: 16px; }
  .ws-content-heading { display: grid; gap: 8px; }
  .ws-content-heading p { max-width: none; text-align: left; }
  .ws-mobile-consult { position: fixed; z-index: 30; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); left: 14px; display: block; min-height: 52px; border: 1px solid #76271f; border-radius: 14px; background: #862f25; box-shadow: 0 12px 30px rgba(55, 31, 24, 0.3); color: #fff; font-size: 14px; font-weight: 750; }
  .ws-result-feedback { display: grid; }
  .ws-feedback-ratings { display: grid; grid-template-columns: repeat(3, 1fr); }
  .ws-consultation { margin-top: 20px; }
  .ws-consultation-context { display: grid; gap: 12px; }
  .ws-consultation-context h1 { font-size: 28px; }
  .ws-consultation-context > p { max-width: none; text-align: left; }
  .ws-consultation-empty { padding: 26px 18px; }
  .ws-consultation-message.user { max-width: 94%; }
  .ws-consultation-message.assistant { padding: 18px; }
  .ws-consultation-direct { font-size: 21px; }
  .ws-consultation-claim p { font-size: 16px; }
  .ws-consultation-form { bottom: calc(10px + env(safe-area-inset-bottom)); padding: 13px; }
  .ws-consultation-form > div { align-items: end; }
  .ws-consultation-form > div small { max-width: 62%; }
}

@media (max-width: 390px) {
  .ws-site-header { padding-right: 12px; padding-left: 12px; }
  .ws-global-nav button { font-size: 10px; }
  .ws-hero { padding-right: 18px; padding-left: 18px; }
  .ws-principle-row { grid-template-columns: 1fr; }
  .ws-method-card { grid-template-columns: auto 1fr; gap: 16px; padding: 21px; }
  .ws-record-card { grid-template-columns: auto 1fr auto; }
  .ws-record-state { display: none; }
  .ws-intake-card { width: calc(100% - 14px); padding-right: 15px; padding-left: 15px; }
  .ws-form-actions { margin-right: -15px; margin-left: -15px; padding-right: 15px; padding-left: 15px; }
  .ws-time-row { grid-template-columns: 1fr 1fr; }
  .ws-audit-grid dd { font-size: 12px; }
  .ws-result-meta > span { display: none; }
  .ws-result-audit { grid-template-columns: 1fr; }
  .ws-result-audit strong { grid-row: auto; grid-column: auto; }
  .ws-mini-pillars { padding-right: 8px; padding-left: 8px; }
  .ws-mini-pillars > div { padding: 5px; }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(133, 45, 36, 0.16), transparent 36%),
    var(--page);
  color: #ece7df;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(133, 45, 36, 0.25);
  outline-offset: 2px;
}

.page-shell {
  display: flex;
  width: min(1080px, 100%);
  height: 100dvh;
  margin: 0 auto;
  flex-direction: column;
  padding: 0 22px 22px;
}

.site-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #4d443d;
  border-radius: 13px;
  background: #332d28;
  color: #d8c8b5;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 20px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 17px;
  letter-spacing: 0.08em;
}

.brand-copy small {
  color: #9d9386;
  font-size: 11px;
  letter-spacing: 0.15em;
}

.header-button,
.chat-tools button {
  border: 0;
  background: transparent;
  color: #a99f93;
  font-size: 13px;
}

.header-button:hover,
.chat-tools button:hover {
  color: #fff;
}

.chat-shell {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(225, 219, 208, 0.8);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.chat-header {
  display: flex;
  min-height: 82px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 249, 244, 0.96);
}

.chat-kicker {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.chat-header h1 {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 700;
}

.chat-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.method-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.method-badge {
  padding: 6px 10px;
  background: rgba(133, 45, 36, 0.1);
  color: var(--red);
}

.status-pill {
  gap: 7px;
  padding: 6px 10px;
  background: #e9e4da;
  color: #70675c;
}

.status-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2e9862;
  box-shadow: 0 0 0 4px rgba(46, 152, 98, 0.1);
}

.chat-log {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding: 28px clamp(18px, 5vw, 56px);
  scrollbar-width: thin;
  scrollbar-color: #c8c0b4 transparent;
}

.message {
  display: flex;
  width: min(820px, 96%);
  flex-direction: column;
  gap: 7px;
}

.message.user {
  align-self: flex-end;
  align-items: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.message-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.message.assistant .message-label::before {
  width: 3px;
  height: 14px;
  border-radius: 4px;
  background: var(--red);
  content: "";
}

.message.user .message-label {
  color: var(--red);
}

.message-label {
  justify-content: space-between;
}

.message-edit-button {
  padding: 2px 7px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  opacity: 0.68;
  transition: opacity 160ms ease, background 160ms ease;
}

.message.user:hover .message-edit-button,
.message-edit-button:focus-visible {
  opacity: 1;
}

.message-edit-button:hover {
  background: rgba(133, 45, 36, 0.09);
  color: var(--red);
}

.message-edit-form {
  display: grid;
  gap: 10px;
  min-width: min(520px, 68vw);
}

.message-edit-form textarea {
  width: 100%;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 10px;
  outline: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  line-height: 1.6;
}

.message-edit-form > div {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.message-edit-form button {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 11px;
}

.message-edit-form button[type="submit"] {
  background: #fff;
  color: var(--red);
}

.message-bubble {
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.message.assistant .message-bubble {
  padding: 20px 22px;
  border: 1px solid #e6dfd4;
  background: var(--white);
  box-shadow: 0 5px 18px rgba(63, 49, 38, 0.06);
  color: #4a433a;
}

.message.user .message-bubble {
  width: fit-content;
  padding: 13px 16px;
  background: var(--red);
  color: #fff;
  box-shadow: 0 8px 20px rgba(133, 45, 36, 0.18);
}

.message-bubble p {
  margin: 0;
}

.message-bubble p + p {
  margin-top: 10px;
}

.welcome-bubble {
  max-width: 650px;
}

.prompt-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.prompt-examples button,
.question-chip,
.method-option {
  border: 1px solid #ddd4c7;
  background: #fbf8f2;
  color: #544a40;
}

.prompt-examples button,
.question-chip {
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 12px;
}

.prompt-examples button:hover,
.question-chip:hover {
  border-color: var(--red);
  color: var(--red);
}

.method-options {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.method-option {
  position: relative;
  display: grid;
  width: 100%;
  gap: 3px;
  padding: 13px 14px;
  border-radius: 13px;
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.method-option:hover {
  border-color: var(--red);
  background: #fff;
  transform: translateY(-1px);
}

.method-option strong {
  padding-right: 58px;
  color: var(--ink);
  font-size: 14px;
}

.method-option small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.method-option em {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(133, 45, 36, 0.1);
  color: var(--red);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.method-option[disabled] {
  cursor: default;
  opacity: 0.58;
  transform: none;
}

.method-option.selected {
  border-color: var(--red);
  background: rgba(133, 45, 36, 0.06);
  opacity: 1;
}

.intake-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e8e1d6;
}

.intake-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.intake-heading strong {
  color: var(--ink);
  font-size: 16px;
}

.intake-heading small,
.intake-field small {
  color: var(--muted);
  font-size: 11px;
}

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

.intake-field {
  display: grid;
  min-width: 0;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
}

.intake-field > span,
.intake-field legend {
  color: #5a5148;
  font-size: 12px;
  font-weight: 800;
}

.intake-wide {
  grid-column: 1 / -1;
}

.intake-field input:not([type="radio"]):not([type="checkbox"]),
.intake-field select,
.intake-field textarea {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #ddd5ca;
  border-radius: 11px;
  outline: 0;
  background: #fcfaf6;
  color: var(--ink);
  font: inherit;
}

.intake-field textarea {
  height: auto;
  min-height: 82px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.55;
}

.intake-field input:focus,
.intake-field select:focus,
.intake-field textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(133, 45, 36, 0.08);
}

.intake-subheading {
  padding: 3px 0 1px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.intake-subheading small {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 500;
}

.love-partner-panel {
  padding: 14px;
  border: 1px solid #e4d9cc;
  border-radius: 14px;
  background: rgba(133, 45, 36, 0.025);
}

.love-partner-panel[hidden],
[data-love-partner-precise][hidden] {
  display: none;
}

.love-partner-grid {
  margin-top: 10px;
}

.intake-segmented,
.intake-gender {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
}

.intake-segmented legend,
.intake-gender legend {
  grid-column: 1 / -1;
}

.intake-segmented label,
.intake-gender label,
.intake-check {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid #ddd5ca;
  border-radius: 10px;
  background: #fcfaf6;
  font-size: 12px;
}

.intake-segmented select {
  grid-column: 1 / -1;
}

.intake-time-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.intake-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 15px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.intake-submit:hover {
  background: var(--red);
}

.intake-complete {
  margin-top: 12px !important;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f5f1ea;
  color: var(--muted);
  font-size: 12px;
}

.question-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.final-report {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e8e1d6;
}

.final-report h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 23px;
  line-height: 1.45;
}

.final-report > p {
  margin: 0 0 14px;
  font-size: 16px;
  line-height: 1.9;
}

.life-guidance {
  display: grid;
  gap: 16px;
  margin: 20px 0 24px;
}

.life-portrait,
.life-current-stage {
  padding: 17px 18px;
  border-left: 3px solid var(--red);
  border-radius: 0 12px 12px 0;
  background: #faf6ef;
}

.life-portrait > span,
.life-current-stage > span {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.life-portrait p,
.life-current-stage p {
  margin-top: 8px;
  color: #4d453d;
  font-size: 16px;
  line-height: 1.9;
}

.life-stage-map {
  border: 1px solid #e5ddd2;
  border-radius: 10px;
  background: #fff;
}

.life-stage-map > summary {
  cursor: pointer;
  padding: 14px 16px;
  color: #544b42;
  font-size: 15px;
  font-weight: 900;
}

.life-stage-map > div {
  display: grid;
  gap: 1px;
  border-top: 1px solid #ebe4da;
  background: #ebe4da;
}

.life-stage-map article {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 14px 16px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.life-stage-map article span { color: var(--red); font-weight: 800; }
.life-stage-map article strong { color: var(--ink); }
.life-stage-map article p { margin: 0; }

.planning-advice {
  display: grid;
  gap: 10px;
}

.planning-advice h4 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 17px;
}

.planning-advice article {
  padding: 15px 16px;
  border: 1px solid #e6ded3;
  border-radius: 10px;
  background: #fffdf9;
}

.planning-advice article header {
  display: grid;
  gap: 3px;
}

.planning-advice article header strong { color: var(--red); font-size: 15px; }
.planning-advice article header span { color: var(--muted); font-size: 13px; }
.planning-advice article p { margin-top: 8px; color: #564e46; font-size: 15px; line-height: 1.8; }
.planning-advice article small { display: block; margin-top: 7px; color: #8b8177; font-size: 13px; line-height: 1.7; }

.report-disclaimer {
  margin-top: 14px !important;
  padding: 10px 12px;
  border-radius: 9px;
  background: #f3eee7;
  color: #796f65;
  font-size: 12px;
  line-height: 1.75;
}

.bazi-chart {
  margin: 22px 0 18px;
  padding: 22px;
  border: 1px solid #e4dbcf;
  border-radius: 16px;
  background: #fffdf9;
}

.bazi-chart-heading {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  text-align: left;
}

.bazi-chart-heading > span {
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.28em;
}

.bazi-chart-heading h4 {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 22px;
  line-height: 1.45;
}

.bazi-chart-heading p,
.bazi-chart-heading small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

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

.bazi-pillar {
  min-width: 0;
  padding: 15px;
  border: 1px solid #e3d9cc;
  border-radius: 12px;
  background: #fff;
}

.bazi-pillar.day-pillar {
  border-color: rgba(133, 45, 36, 0.55);
  background: #fcf6f1;
  box-shadow: inset 0 0 0 1px rgba(133, 45, 36, 0.09);
}

.bazi-pillar header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.bazi-pillar header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bazi-pillar header em {
  color: var(--red);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.bazi-pillar > strong {
  display: block;
  margin: 10px 0 12px;
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 27px;
  letter-spacing: 0.14em;
}

.bazi-pillar dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.bazi-pillar dl div {
  display: grid;
  gap: 2px;
}

.bazi-pillar dt {
  color: #9a8f83;
  font-size: 11px;
}

.bazi-pillar dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #5b5249;
  font-size: 13px;
  line-height: 1.55;
}

.bazi-core-facts {
  display: grid;
  gap: 1px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #e7ded2;
  border-radius: 12px;
  background: #e7ded2;
}

.bazi-core-facts > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 11px 14px;
  background: #fff;
}

.bazi-core-facts span {
  color: var(--muted);
  font-size: 13px;
}

.bazi-core-facts strong {
  color: var(--ink);
  font-size: 14px;
}

.bazi-theme-details {
  margin-top: 12px;
  border: 1px solid #e7ded2;
  border-radius: 12px;
  background: #fff;
}

.bazi-theme-details summary {
  cursor: pointer;
  padding: 13px 14px;
  color: #564d44;
  font-size: 14px;
  font-weight: 800;
}

.bazi-theme-details > div {
  display: grid;
  gap: 1px;
  border-top: 1px solid #eee7dd;
  background: #eee7dd;
}

.bazi-theme-details p {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px;
  margin: 0;
  padding: 11px 14px;
  background: #fff;
}

.bazi-theme-details p strong {
  color: var(--red);
  font-size: 13px;
}

.bazi-theme-details p span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.bazi-dayun {
  margin-top: 18px;
}

.bazi-dayun > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.bazi-dayun > header strong {
  color: var(--ink);
  font-size: 16px;
}

.bazi-dayun > header span {
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.bazi-dayun > div {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: thin;
}

.bazi-dayun article {
  display: grid;
  flex: 0 0 112px;
  gap: 3px;
  padding: 11px 9px;
  border: 1px solid #e4dbcf;
  border-radius: 10px;
  background: #fff;
  text-align: center;
}

.bazi-dayun article.current {
  border-color: var(--red);
  background: #fcf1ed;
  box-shadow: inset 0 0 0 1px rgba(133, 45, 36, 0.15);
}

.bazi-dayun article strong { color: #675d53; font-size: 13px; }
.bazi-dayun article span { color: var(--red); font-size: 16px; font-weight: 900; }
.bazi-dayun article small { color: var(--muted); font-size: 11px; }

.bazi-reading {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #e5dccf;
}

.bazi-reading > header {
  display: grid;
  gap: 3px;
}

.bazi-reading > header span {
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 20px;
  font-weight: 900;
}

.bazi-reading > header small {
  color: var(--muted);
  font-size: 13px;
}

.bazi-reading-overview {
  margin: 0;
  color: #4f473f;
  font-size: 16px;
  line-height: 1.9;
}

.bazi-reading-signals {
  display: grid;
  gap: 10px;
}

.bazi-reading-signal {
  padding: 15px 16px;
  border-left: 3px solid var(--red);
  border-radius: 0 10px 10px 0;
  background: #faf6ef;
}

.bazi-reading-signal h5 {
  margin: 0;
  color: var(--red);
  font-size: 16px;
}

.bazi-reading-signal small {
  display: block;
  margin-top: 5px;
  color: #8b8177;
  font-size: 12px;
  line-height: 1.65;
}

.bazi-reading-signal p {
  margin-top: 8px;
  color: #50483f;
  font-size: 15px;
  line-height: 1.85;
}

.bazi-stage-thread {
  padding: 15px 16px;
  border: 1px solid #e5dbce;
  border-radius: 11px;
  background: #fff;
}

.bazi-stage-thread span {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.bazi-stage-thread p {
  margin-top: 6px;
  color: #554d45;
  font-size: 15px;
  line-height: 1.85;
}

.bazi-source {
  margin: 12px 0 0 !important;
  color: #8f857a;
  font-size: 11px;
  line-height: 1.7;
}

.ziwei-chart {
  margin: 14px 0;
}

.ziwei-chart-heading {
  display: grid;
  justify-items: center;
  gap: 3px;
  margin-bottom: 18px;
  text-align: center;
}

.ziwei-chart-heading span {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.42em;
}

.ziwei-chart-heading strong {
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 16px;
  letter-spacing: 0.12em;
}

.ziwei-chart-heading small {
  color: var(--muted);
  font-size: 9px;
}

.ziwei-board-shell {
  position: relative;
  padding: 18px 22px;
}

.ziwei-direction {
  position: absolute;
  color: #7c746b;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ziwei-direction.top { top: 0; left: 50%; transform: translateX(-50%); }
.ziwei-direction.bottom { bottom: 0; left: 50%; transform: translateX(-50%); }
.ziwei-direction.left { top: 50%; left: 2px; writing-mode: vertical-rl; transform: translateY(-50%); }
.ziwei-direction.right { top: 50%; right: 2px; writing-mode: vertical-rl; transform: translateY(-50%); }

.ziwei-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(112px, auto));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #cfc6b9;
  border-radius: 14px;
  background: #cfc6b9;
  box-shadow: 0 8px 24px rgba(55, 42, 30, 0.08);
}

.ziwei-palace,
.ziwei-center {
  min-width: 0;
  background: #fffdf9;
}

.ziwei-palace {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 6px;
  padding: 8px 9px;
  border: 0;
  border-radius: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.ziwei-palace:hover,
.ziwei-palace.selected {
  background: #f7efe8;
  box-shadow: inset 0 0 0 2px rgba(133, 45, 36, 0.55);
}

.ziwei-palace.related {
  background: #f7f3ea;
  box-shadow: inset 0 0 0 1px rgba(133, 45, 36, 0.22);
}

.ziwei-palace.current-period::after {
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: #7c5ac7;
  content: "";
}

.ziwei-palace header {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  color: var(--red);
  font-size: 10px;
}

.ziwei-palace header > span {
  color: var(--muted);
  font-size: 8px;
}

.ziwei-palace-stars {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 3px 5px;
  min-height: 54px;
}

.ziwei-star {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: #5f574e;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
}

.ziwei-star.major { color: #9d3029; font-size: 12px; }
.ziwei-star.minor { color: #315da7; }
.ziwei-star.adjective { color: #302e2b; font-weight: 500; }
.ziwei-star.bright { font-weight: 900; }
.ziwei-star.dim { opacity: 0.55; }
.ziwei-star small { color: currentColor; font-size: 7px; font-weight: 500; }
.ziwei-star i {
  min-width: 15px;
  padding: 1px 3px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-size: 8px;
  font-style: normal;
  text-align: center;
}

.ziwei-star i[data-mutagen="禄"] { background: #3f825d; }
.ziwei-star i[data-mutagen="权"] { background: #416da5; }
.ziwei-star i[data-mutagen="科"] { background: #9b762a; }
.ziwei-star i[data-mutagen="忌"] { background: #9a3430; }

.ziwei-palace footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  color: #4b443d;
  font-size: 10px;
}

.ziwei-palace footer em {
  color: #7250ba;
  font-size: 7px;
  font-style: normal;
}

.ziwei-center {
  display: grid;
  grid-area: 2 / 2 / 4 / 4;
  place-content: center;
  gap: 8px;
  padding: 16px;
  text-align: center;
}

.ziwei-center > span {
  color: var(--red);
  font-size: 11px;
  letter-spacing: 0.24em;
}

.ziwei-center strong {
  color: var(--ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 15px;
}

.ziwei-center dl {
  display: grid;
  gap: 3px;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  text-align: left;
}

.ziwei-center dl div {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 6px;
}

.ziwei-center dt { color: #968d83; }
.ziwei-center dd { margin: 0; color: #504940; }

.ziwei-center > b {
  padding: 5px 8px;
  border: 1px solid rgba(114, 80, 186, 0.25);
  border-radius: 8px;
  background: rgba(114, 80, 186, 0.07);
  color: #7250ba;
  font-size: 10px;
}

.ziwei-center small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.ziwei-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 12px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 8px;
}

.ziwei-legend .major { color: #9d3029; }
.ziwei-legend .minor { color: #315da7; }
.ziwei-legend .adjective { color: #302e2b; }

.ziwei-palace-detail,
.ziwei-time-axis {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid #e4dcd1;
  border-radius: 12px;
  background: #fcfaf6;
}

.ziwei-palace-detail > header,
.ziwei-time-axis > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ziwei-palace-detail h4 { margin: 2px 0 0; color: var(--ink); font-size: 14px; }
.ziwei-palace-detail header span,
.ziwei-palace-detail header small,
.ziwei-time-axis header span { color: var(--muted); font-size: 9px; }
.ziwei-detail-stars { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 12px; }
.ziwei-palace-detail > p { margin-top: 10px; color: var(--muted); font-size: 9px; }

.ziwei-time-axis > header + div {
  display: flex;
  gap: 7px;
  margin: 8px 0 13px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.ziwei-time-axis button {
  display: grid;
  flex: 0 0 86px;
  gap: 2px;
  padding: 8px 6px;
  border: 1px solid #e2dacf;
  border-radius: 9px;
  background: #fff;
  color: #635b53;
  text-align: center;
}

.ziwei-time-axis button.active {
  border-color: #8a6ac9;
  background: #f0ebfa;
  color: #6545a9;
  box-shadow: inset 0 0 0 1px #8a6ac9;
}

.ziwei-time-axis button strong { font-size: 10px; }
.ziwei-time-axis button span { font-size: 9px; }
.ziwei-time-axis button small { color: inherit; font-size: 8px; }

.ziwei-source {
  margin-top: 7px !important;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.ziwei-patterns {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e5ddd2;
  border-radius: 10px;
  background: #faf7f1;
}

.ziwei-patterns > strong {
  color: var(--ink);
  font-size: 15px;
}

.ziwei-patterns details {
  border-top: 1px solid #ebe3d8;
}

.ziwei-patterns summary {
  cursor: pointer;
  padding: 7px 0;
  color: var(--red);
  font-size: 14px;
  font-weight: 800;
}

.ziwei-patterns p {
  padding-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.report-section {
  margin-top: 10px;
  border-top: 1px solid #eee8df;
}

.report-section summary {
  cursor: pointer;
  padding: 14px 0;
  color: #534940;
  font-weight: 800;
  font-size: 16px;
}

.report-section p {
  padding: 0 0 14px;
  color: #675e55;
  font-size: 15px;
  line-height: 1.85;
}

.feedback-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 14px;
}

.feedback-row button {
  padding: 5px 9px;
  border: 1px solid #ded6ca;
  border-radius: 999px;
  background: #fff;
  color: #6a6056;
  font-size: 14px;
}

.feedback-row button:hover,
.feedback-row button.selected {
  border-color: #a85b4d;
  background: #fff4f1;
  color: var(--red);
}

.feedback-detail {
  display: grid;
  align-items: stretch;
}

.feedback-detail > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.feedback-detail > div:first-child strong {
  color: var(--ink);
}

.feedback-reasons,
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.feedback-actions {
  justify-content: flex-end;
}

.feedback-actions button.primary {
  border-color: var(--red);
  background: var(--red);
  color: #fff;
}

.feedback-result {
  justify-content: space-between;
}

.feedback-result span small {
  display: block;
  margin-top: 3px;
  color: #948a7f;
}

.direct-method-welcome .message-bubble {
  border-color: rgba(133, 45, 36, 0.3);
}

.direct-method-label {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(133, 45, 36, 0.1);
  color: #812b23;
  font-size: 11px;
  font-weight: 750;
}

.direct-method-note {
  margin-top: 10px !important;
  color: #81766d;
  font-size: 12px !important;
}

.typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 52px;
}

.typing-bubble i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  animation: typing 1.1s infinite ease-in-out;
}

.typing-bubble i:nth-child(2) {
  animation-delay: 120ms;
}

.typing-bubble i:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes typing {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.composer {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 10px;
  margin: 0 clamp(14px, 4vw, 44px);
  padding: 6px;
  border: 1px solid #d9d1c5;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(61, 47, 37, 0.08);
}

.composer:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(133, 45, 36, 0.09);
}

.composer textarea {
  min-height: 44px;
  max-height: 130px;
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.55;
  padding: 11px 10px;
}

.composer textarea::placeholder {
  color: #9a9187;
}

.composer button {
  min-width: 76px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.composer button:hover {
  background: var(--red-dark);
}

.composer button:disabled,
.composer textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.composer-tip {
  flex: 0 0 auto;
  margin: 9px 16px 4px;
  color: #938a7f;
  font-size: 10px;
  text-align: center;
}

.composer-notices {
  flex: 0 0 auto;
  padding-bottom: 10px;
  text-align: center;
}

.privacy-notice {
  margin: 0 auto;
  max-width: 620px;
  color: #8a8177;
  font-size: 10px;
}

.privacy-notice summary {
  cursor: pointer;
  list-style-position: inside;
}

.privacy-notice p {
  margin: 6px 18px 0;
  line-height: 1.6;
}

.engine-status {
  margin: 12px 0 0;
  color: #82796f;
  font-size: 13px;
}

.engine-status.degraded {
  padding: 8px 10px;
  border: 1px solid #ead8bd;
  border-radius: 8px;
  background: #fff9ef;
  color: #86622e;
}

.drawer-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  background: rgba(17, 14, 12, 0.5);
  backdrop-filter: blur(2px);
}

.history-drawer {
  position: fixed;
  z-index: 21;
  top: 0;
  right: 0;
  display: flex;
  width: min(390px, 92vw);
  height: 100dvh;
  flex-direction: column;
  padding: 22px;
  background: #f7f3ec;
  color: var(--ink);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.24);
  transform: translateX(105%);
  transition: transform 220ms ease;
}

.history-drawer.open {
  transform: translateX(0);
}

.history-drawer > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.history-drawer h2 {
  margin: 3px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 23px;
}

.history-drawer header span {
  color: var(--muted);
  font-size: 11px;
}

.history-drawer header button {
  border: 0;
  background: transparent;
  color: var(--muted);
}

.history-list {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.history-item {
  display: grid;
  width: 100%;
  gap: 5px;
  padding: 13px;
  border: 1px solid #e1d9ce;
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.history-item:hover,
.history-item.active {
  border-color: var(--red);
}

.history-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item span {
  color: var(--red);
  font-size: 11px;
}

.history-item small,
.history-empty {
  color: var(--muted);
  font-size: 11px;
}

.history-empty {
  margin: 28px 0;
  text-align: center;
}

.clear-history-button {
  padding: 11px;
  border: 1px solid #d9d0c4;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 24px;
  padding: 10px 15px;
  border-radius: 999px;
  background: #2c2621;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 700px) {
  .page-shell {
    padding: 0;
  }

  .site-header {
    min-height: 64px;
    padding: 0 14px;
  }

  .brand-mark {
    width: 37px;
    height: 37px;
    border-radius: 11px;
    font-size: 18px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .chat-shell {
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .chat-header {
    min-height: 68px;
    padding: 12px 14px;
  }

  .chat-kicker,
  .status-pill {
    display: none;
  }

  .chat-header h1 {
    font-size: 17px;
  }

  .chat-tools {
    gap: 7px;
  }

  .method-badge {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-log {
    gap: 17px;
    padding: 20px 14px;
  }

  .message {
    width: 100%;
  }

  .message-bubble {
    font-size: 16px;
  }

  .message.assistant .message-bubble {
    padding: 16px;
  }

  .message-edit-button {
    opacity: 1;
  }

  .message-edit-form {
    min-width: 0;
  }

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

  .life-stage-map article {
    grid-template-columns: 1fr;
    padding: 13px 14px;
  }

  .bazi-chart {
    padding: 16px 14px;
  }

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

  .bazi-pillar {
    padding: 13px;
  }

  .bazi-pillar > strong {
    font-size: 24px;
  }

  .bazi-core-facts > div {
    grid-template-columns: 92px 1fr;
    gap: 10px;
  }

  .bazi-theme-details p {
    grid-template-columns: 72px 1fr;
  }

  .bazi-dayun > header {
    display: grid;
    gap: 3px;
  }

  .intake-wide {
    grid-column: auto;
  }

  .intake-heading {
    display: grid;
    gap: 2px;
  }

  .ziwei-board {
    grid-template-rows: repeat(4, minmax(92px, auto));
  }

  .ziwei-board-shell {
    padding: 15px 8px;
  }

  .ziwei-direction.left,
  .ziwei-direction.right {
    display: none;
  }

  .ziwei-palace {
    padding: 6px;
  }

  .ziwei-palace b {
    font-size: 9px;
  }

  .ziwei-palace small {
    display: none;
  }

  .ziwei-palace-stars {
    gap: 2px 4px;
    min-height: 42px;
  }

  .ziwei-star.major { font-size: 10px; }
  .ziwei-star.minor,
  .ziwei-star.adjective { font-size: 8px; }

  .ziwei-center {
    gap: 5px;
    padding: 8px;
  }

  .ziwei-center dl div {
    grid-template-columns: 34px 1fr;
  }

  .ziwei-center dl div:nth-child(1),
  .ziwei-center dl div:nth-child(2) {
    display: none;
  }

  .ziwei-center strong { font-size: 12px; }
  .ziwei-center > b { padding: 4px; font-size: 8px; }

  .composer {
    margin: 0 10px;
  }

  .composer button {
    min-width: 62px;
  }

  .composer-tip {
    margin-right: 10px;
    margin-left: 10px;
  }

  .composer-notices {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }
}

/* 新版八字结果工作台 */
.ws-mobile-result-summary,
.ws-bazi-compact {
  display: none;
}

.ws-result-audit.crossed {
  border-color: rgba(138, 48, 38, 0.38);
  background: rgba(138, 48, 38, 0.055);
}

.ws-bazi-full-chart {
  overflow: hidden;
  border: 1px solid #cfc4b7;
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: 0 15px 34px rgba(62, 47, 34, 0.1);
}

.ws-bazi-chart-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border-bottom: 1px solid #ddd4c8;
}

.ws-bazi-chart-heading span {
  color: #8a3026;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.ws-bazi-chart-heading h2 {
  margin: 4px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 21px;
}

.ws-bazi-chart-heading p {
  display: grid;
  justify-items: end;
  gap: 4px;
  margin: 0;
  color: #554d46;
  font-size: 11px;
  font-weight: 700;
}

.ws-bazi-chart-heading p small {
  color: #8d8278;
  font-size: 9px;
  font-weight: 500;
}

.ws-bazi-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 18px;
  border-bottom: 1px solid #ddd4c8;
}

.ws-bazi-pillar {
  min-width: 0;
  padding: 0 10px 12px;
  border-right: 1px solid #e1d9cf;
}

.ws-bazi-pillar:last-child {
  border-right: 0;
}

.ws-bazi-pillar.day {
  border-radius: 10px;
  background: rgba(138, 48, 38, 0.055);
}

.ws-bazi-pillar header {
  display: grid;
  justify-items: center;
  gap: 3px;
  color: #7f756b;
  font-size: 9px;
}

.ws-bazi-pillar header em {
  color: #8a3026;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}

.ws-pillar-ganzhi {
  display: grid;
  justify-items: center;
  gap: 3px;
  margin: 13px 0 16px;
}

.ws-pillar-ganzhi strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 650;
  line-height: 1.05;
}

.ws-pillar-ganzhi strong:first-child {
  color: #8a3026;
}

.ws-pillar-fallback {
  margin: -7px 0 12px;
  color: #8a3026;
  font-size: 9px;
  text-align: center;
}

.ws-bazi-pillar dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.ws-bazi-pillar dl div {
  display: grid;
  gap: 2px;
  text-align: center;
}

.ws-bazi-pillar dt {
  color: #9a8f84;
  font-size: 8px;
}

.ws-bazi-pillar dd {
  min-width: 0;
  margin: 0;
  color: #5f574f;
  font-size: 9px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ws-bazi-core-facts {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid #ddd4c8;
  background: #f7f3ec;
}

.ws-bazi-core-facts div {
  min-width: 0;
  padding: 12px 8px;
  border-right: 1px solid #ddd4c8;
  text-align: center;
}

.ws-bazi-core-facts div:last-child {
  border-right: 0;
}

.ws-bazi-core-facts dt {
  color: #91867b;
  font-size: 8px;
}

.ws-bazi-core-facts dd {
  margin: 5px 0 0;
  color: #3e3731;
  font-size: 11px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.ws-bazi-count-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid #ddd4c8;
}

.ws-bazi-count-block {
  min-width: 0;
  padding: 16px;
  border-right: 1px solid #ddd4c8;
}

.ws-bazi-count-block:last-child {
  border-right: 0;
}

.ws-bazi-count-block > header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.ws-bazi-count-block > header div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.ws-bazi-count-block > header span {
  color: #8a3026;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ws-bazi-count-block > header strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
}

.ws-bazi-count-block > header small {
  color: #91867b;
  font-size: 8px;
  line-height: 1.45;
}

.ws-element-counts,
.ws-ten-god-counts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-top: 13px;
}

.ws-element-counts div,
.ws-ten-god-counts div {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 4px;
  padding: 8px 3px;
  border: 1px solid #e0d8cd;
  border-radius: 9px;
  background: #faf8f3;
}

.ws-element-counts span,
.ws-ten-god-counts span {
  color: #766c62;
  font-size: 8px;
}

.ws-element-counts strong,
.ws-ten-god-counts strong {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 14px;
}

.ws-element-counts i {
  min-height: 10px;
  color: #9a3328;
  font-size: 6px;
  font-style: normal;
  letter-spacing: -0.08em;
  overflow-wrap: anywhere;
}

.ws-bazi-themes {
  margin-top: 12px;
}

.ws-bazi-themes summary {
  color: #7c7167;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.ws-bazi-themes > div {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.ws-bazi-themes p {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 7px;
  margin: 0;
  color: #756b62;
  font-size: 8px;
  line-height: 1.45;
}

.ws-bazi-themes p strong {
  color: #8a3026;
}

.ws-bazi-timeline {
  padding: 18px;
}

.ws-bazi-timeline > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.ws-bazi-timeline > header span {
  color: #8a3026;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.ws-bazi-timeline > header h3 {
  margin: 3px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 16px;
}

.ws-bazi-timeline > header p {
  max-width: 260px;
  margin: 0;
  color: #8c8177;
  font-size: 8px;
  line-height: 1.45;
  text-align: right;
}

.ws-dayun-scroll,
.ws-liunian-scroll {
  display: flex;
  gap: 7px;
  padding-bottom: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.ws-dayun-card,
.ws-liunian-card {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  gap: 4px;
  border: 1px solid #ded5ca;
  border-radius: 10px;
  background: #faf8f3;
  color: #4d453e;
  scroll-snap-align: start;
}

.ws-dayun-card {
  width: 98px;
  min-height: 82px;
  padding: 10px 7px;
}

.ws-dayun-card strong,
.ws-liunian-card strong {
  color: #776d63;
  font-size: 9px;
}

.ws-dayun-card span,
.ws-liunian-card span {
  color: #8a3026;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 15px;
  font-weight: 750;
}

.ws-dayun-card small,
.ws-liunian-card small {
  color: #94897e;
  font-size: 8px;
}

.ws-dayun-card em {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 2px 4px;
  border-radius: 999px;
  background: #332d28;
  color: #fff;
  font-size: 7px;
  font-style: normal;
}

.ws-dayun-card.current {
  border-color: #594f46;
}

.ws-dayun-card.active,
.ws-liunian-card.active {
  border-color: #9a3328;
  background: rgba(154, 51, 40, 0.07);
  box-shadow: inset 0 0 0 1px rgba(154, 51, 40, 0.12);
}

.ws-liunian-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 9px;
}

.ws-liunian-heading strong {
  font-size: 10px;
}

.ws-liunian-heading span {
  color: #93887d;
  font-size: 8px;
}

.ws-liunian-card {
  width: 68px;
  min-height: 70px;
  padding: 9px 5px;
}

.ws-liunian-card.current::after {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2c7a55;
  content: "";
}

.ws-bazi-chart-source {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid #ddd4c8;
  color: #968b80;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
}

.ws-claim-references {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-top: 24px;
}

.ws-claim-references > span {
  align-self: center;
  margin-right: 3px;
  color: #8d8278;
  font-size: 10px;
}

.ws-claim-references button {
  display: grid;
  max-width: 260px;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid #dcd3c8;
  border-radius: 10px;
  background: #fffdf9;
  color: #4e463f;
  text-align: left;
}

.ws-claim-references button strong {
  color: #8a3026;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 8px;
}

.ws-claim-references button small {
  font-size: 10px;
  line-height: 1.35;
}

.ws-fact-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 14px;
}

.ws-fact-refs code {
  padding: 4px 6px;
  border-radius: 6px;
  background: #eee8df;
  color: #74695f;
  font-size: 8px;
  overflow-wrap: anywhere;
}

.ws-evidence-card.highlighted {
  border-color: #9a3328;
  box-shadow: 0 0 0 4px rgba(154, 51, 40, 0.1);
}

@media (max-width: 1180px) and (min-width: 721px) {
  .ws-bazi-count-layout {
    grid-template-columns: 1fr;
  }

  .ws-bazi-count-block {
    border-right: 0;
    border-bottom: 1px solid #ddd4c8;
  }

  .ws-bazi-count-block:last-child {
    border-bottom: 0;
  }

  .ws-bazi-core-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ws-bazi-core-facts div:nth-child(3) {
    border-right: 0;
  }
}

@media (max-width: 720px) {
  .ws-mobile-result-summary {
    display: block;
    padding: 28px 18px 22px;
    border-bottom: 1px solid #ddd5ca;
    background: #f7f4ee;
  }

  .ws-mobile-result-summary > span {
    color: #8a3026;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
  }

  .ws-mobile-result-summary h1 {
    margin: 9px 0 15px;
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 23px;
    line-height: 1.45;
  }

  .ws-mobile-result-summary div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
  }

  .ws-mobile-result-summary em {
    padding: 6px 8px;
    border-radius: 999px;
    background: #e9e2d8;
    color: #675e56;
    font-size: 10px;
    font-style: normal;
  }

  .ws-result-bazi .ws-chart-column {
    background: #eee8de;
  }

  .ws-bazi-compact {
    display: block;
    overflow: hidden;
    border: 1px solid #cfc4b7;
    border-radius: 15px;
    background: #fffdf9;
  }

  .ws-bazi-compact > div {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ws-bazi-compact > div span {
    display: grid;
    min-width: 0;
    justify-items: center;
    gap: 5px;
    padding: 14px 5px;
    border-right: 1px solid #e0d8cd;
  }

  .ws-bazi-compact > div span:last-child {
    border-right: 0;
  }

  .ws-bazi-compact small {
    color: #90857a;
    font-size: 8px;
  }

  .ws-bazi-compact strong {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 18px;
    white-space: nowrap;
  }

  .ws-bazi-compact p {
    margin: 0;
    padding: 10px 13px;
    border-top: 1px solid #e0d8cd;
    color: #70665d;
    font-size: 10px;
  }

  .ws-bazi-compact button {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-top: 1px solid #ded5ca;
    background: #f8f4ed;
    color: #8a3026;
    font-size: 11px;
    font-weight: 750;
  }

  .ws-bazi-full-chart {
    display: none;
    margin-top: 12px;
    box-shadow: none;
  }

  .ws-bazi-full-chart.mobile-expanded {
    display: block;
  }

  .ws-bazi-chart-heading {
    align-items: start;
    padding: 15px;
  }

  .ws-bazi-chart-heading p {
    max-width: 48%;
    font-size: 9px;
    text-align: right;
  }

  .ws-bazi-pillars {
    padding: 12px 5px;
  }

  .ws-bazi-pillar {
    padding: 0 5px 10px;
  }

  .ws-pillar-ganzhi strong {
    font-size: 25px;
  }

  .ws-bazi-pillar dd {
    font-size: 8px;
  }

  .ws-bazi-core-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ws-bazi-core-facts div:nth-child(3) {
    border-right: 0;
  }

  .ws-bazi-count-layout {
    grid-template-columns: 1fr;
  }

  .ws-bazi-count-block {
    border-right: 0;
    border-bottom: 1px solid #ddd4c8;
  }

  .ws-bazi-count-block:last-child {
    border-bottom: 0;
  }

  .ws-bazi-timeline {
    padding: 16px 12px;
  }

  .ws-bazi-timeline > header {
    display: grid;
    gap: 6px;
  }

  .ws-bazi-timeline > header p {
    max-width: none;
    text-align: left;
  }

  .ws-dayun-scroll,
  .ws-liunian-scroll {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .ws-liunian-heading {
    align-items: start;
  }

  .ws-liunian-heading span {
    max-width: 47%;
    text-align: right;
  }

  .ws-claim-references {
    display: grid;
    grid-template-columns: 1fr;
  }

  .ws-claim-references button {
    max-width: none;
  }

  .ws-evidence-card p {
    font-size: 16px;
  }
}

@media (max-width: 390px) {
  .ws-bazi-compact > div span {
    padding-right: 3px;
    padding-left: 3px;
  }

  .ws-bazi-compact strong {
    font-size: 16px;
  }

  .ws-bazi-pillar header em {
    font-size: 9px;
  }

  .ws-pillar-ganzhi strong {
    font-size: 23px;
  }
}

/* 新版紫微结果工作台 */
.ws-ziwei-compact {
  display: none;
}

.ws-ziwei-full-chart {
  overflow: hidden;
  border: 1px solid #cfc4b7;
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: 0 15px 34px rgba(62, 47, 34, 0.1);
}

.ws-ziwei-chart-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border-bottom: 1px solid #ddd4c8;
}

.ws-ziwei-chart-heading span {
  color: #5f55b6;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.ws-ziwei-chart-heading h2 {
  margin: 4px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 24px;
}

.ws-ziwei-chart-heading p {
  display: grid;
  justify-items: end;
  gap: 4px;
  margin: 0;
  color: #6e655c;
  font-size: 13px;
}

.ws-ziwei-chart-heading p small {
  color: #958a7f;
  font-size: 11px;
}

.ws-ziwei-time-navigation {
  padding: 14px 16px;
  border-bottom: 1px solid #ddd4c8;
  background: #f7f4ee;
}

.ws-ziwei-time-navigation > nav {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border-radius: 10px;
  background: #e8e2d9;
}

.ws-ziwei-time-navigation > nav button {
  min-width: 68px;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #766c62;
  font-size: 13px;
}

.ws-ziwei-time-navigation > nav button.active {
  background: #fff;
  color: #564ca8;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(61, 48, 39, 0.1);
}

.ws-ziwei-natal-note {
  margin: 10px 0 0;
  color: #83786e;
  font-size: 12px;
  line-height: 1.55;
}

.ws-ziwei-decadal-scroll,
.ws-ziwei-annual-scroll {
  display: flex;
  gap: 7px;
  margin-top: 12px;
  padding-bottom: 7px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.ws-ziwei-decadal-scroll button,
.ws-ziwei-annual-scroll button {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  gap: 3px;
  padding: 8px 6px;
  border: 1px solid #dcd3c8;
  border-radius: 9px;
  background: #fffdf9;
  color: #4f4740;
  scroll-snap-align: start;
}

.ws-ziwei-decadal-scroll button {
  width: 86px;
  min-height: 68px;
}

.ws-ziwei-annual-scroll button {
  width: 67px;
  min-height: 62px;
}

.ws-ziwei-decadal-scroll button.active,
.ws-ziwei-annual-scroll button.active {
  border-color: #6358ba;
  background: rgba(99, 88, 186, 0.08);
  box-shadow: inset 0 0 0 1px rgba(99, 88, 186, 0.12);
}

.ws-ziwei-decadal-scroll button.current {
  border-color: #4f473f;
}

.ws-ziwei-decadal-scroll strong,
.ws-ziwei-annual-scroll strong {
  color: #756b61;
  font-size: 11px;
}

.ws-ziwei-decadal-scroll span,
.ws-ziwei-annual-scroll span {
  color: #5c51b0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 15px;
  font-weight: 750;
}

.ws-ziwei-decadal-scroll small,
.ws-ziwei-annual-scroll small {
  color: #94897e;
  font-size: 10px;
}

.ws-ziwei-decadal-scroll em {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 4px;
  border-radius: 999px;
  background: #39332e;
  color: #fff;
  font-size: 9px;
  font-style: normal;
}

.ws-ziwei-annual-scroll button.current::after {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2d895d;
  content: "";
}

.ws-ziwei-annual-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.ws-ziwei-annual-heading strong {
  font-size: 12px;
}

.ws-ziwei-annual-heading span {
  color: #94897e;
  font-size: 11px;
}

.ws-ziwei-board-shell {
  position: relative;
  padding: 23px 13px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  background: #fbfaf7;
  scrollbar-width: thin;
}

.ws-ziwei-direction {
  position: absolute;
  z-index: 2;
  left: 50%;
  color: #8e8378;
  font-size: 11px;
  transform: translateX(-50%);
}

.ws-ziwei-direction.north {
  top: 7px;
}

.ws-ziwei-direction.south {
  bottom: 7px;
}

.ws-ziwei-board {
  display: grid;
  min-width: 500px;
  width: min(100%, 720px);
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  border: 1px solid #cfc5b9;
  border-radius: 12px;
  overflow: hidden;
  background: #fffdf9;
  box-shadow: 0 12px 26px rgba(61, 47, 35, 0.08);
}

.ws-ziwei-palace {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-rows: auto 1fr auto;
  gap: 7px;
  padding: 9px;
  border: 0;
  border-right: 1px solid #ded6cb;
  border-bottom: 1px solid #ded6cb;
  background: #fffdf9;
  color: #3f3832;
  text-align: left;
}

.ws-ziwei-palace[data-branch="巳"] { grid-area: 1 / 1; }
.ws-ziwei-palace[data-branch="午"] { grid-area: 1 / 2; }
.ws-ziwei-palace[data-branch="未"] { grid-area: 1 / 3; }
.ws-ziwei-palace[data-branch="申"] { grid-area: 1 / 4; }
.ws-ziwei-palace[data-branch="辰"] { grid-area: 2 / 1; }
.ws-ziwei-palace[data-branch="酉"] { grid-area: 2 / 4; }
.ws-ziwei-palace[data-branch="卯"] { grid-area: 3 / 1; }
.ws-ziwei-palace[data-branch="戌"] { grid-area: 3 / 4; }
.ws-ziwei-palace[data-branch="寅"] { grid-area: 4 / 1; }
.ws-ziwei-palace[data-branch="丑"] { grid-area: 4 / 2; }
.ws-ziwei-palace[data-branch="子"] { grid-area: 4 / 3; }
.ws-ziwei-palace[data-branch="亥"] { grid-area: 4 / 4; }

.ws-ziwei-palace:hover {
  z-index: 2;
  box-shadow: inset 0 0 0 1px rgba(99, 88, 186, 0.35);
}

.ws-ziwei-palace.related {
  background: rgba(99, 88, 186, 0.045);
}

.ws-ziwei-palace.opposite {
  background: rgba(154, 51, 40, 0.045);
}

.ws-ziwei-palace.selected {
  z-index: 3;
  background: rgba(99, 88, 186, 0.1);
  box-shadow: inset 0 0 0 2px #6358ba;
}

.ws-ziwei-palace.current-period::before,
.ws-ziwei-palace.annual::after {
  position: absolute;
  z-index: 2;
  top: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  content: "";
}

.ws-ziwei-palace.current-period::before {
  right: 4px;
  background: #2d895d;
}

.ws-ziwei-palace.annual::after {
  right: 12px;
  background: #9a3328;
}

.ws-ziwei-palace header,
.ws-ziwei-palace footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.ws-ziwei-palace header strong {
  color: #8a3026;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 13px;
}

.ws-ziwei-palace header span,
.ws-ziwei-palace footer span {
  color: #8f8479;
  font-size: 10px;
}

.ws-ziwei-palace > div {
  display: flex;
  align-content: start;
  flex-wrap: wrap;
  gap: 3px 5px;
}

.ws-ziwei-palace footer em {
  color: #2d7754;
  font-size: 9px;
  font-style: normal;
}

.ws-ziwei-center {
  display: grid;
  grid-area: 2 / 2 / 4 / 4;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 16px;
  background:
    radial-gradient(circle, rgba(99, 88, 186, 0.09), transparent 56%),
    #f8f5ef;
  text-align: center;
}

.ws-ziwei-center > span {
  color: #5f55b6;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ws-ziwei-center > strong {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 22px;
}

.ws-ziwei-center > p {
  display: grid;
  gap: 2px;
  margin: 0;
  color: #655c54;
  font-size: 12px;
}

.ws-ziwei-center > p small {
  color: #91867b;
  font-size: 11px;
}

.ws-ziwei-center dl {
  display: grid;
  gap: 4px;
  margin: 0;
}

.ws-ziwei-center dl div {
  display: grid;
  grid-template-columns: 45px 1fr;
  gap: 6px;
  text-align: left;
}

.ws-ziwei-center dt {
  color: #91867b;
  font-size: 11px;
}

.ws-ziwei-center dd {
  margin: 0;
  color: #4c443d;
  font-size: 11px;
}

.ws-ziwei-center > b {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(99, 88, 186, 0.1);
  color: #574da8;
  font-size: 11px;
}

.ws-ziwei-star {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: #645b53;
  font-size: 12px;
}

.ws-ziwei-star.major {
  color: #5e53b1;
  font-size: 16px;
}

.ws-ziwei-star.minor {
  color: #8a3026;
}

.ws-ziwei-star.bright b {
  font-weight: 900;
}

.ws-ziwei-star.dim {
  opacity: 0.64;
}

.ws-ziwei-star small {
  font-size: 10px;
}

.ws-ziwei-star i {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 3px;
  background: #8a3026;
  color: #fff;
  font-size: 10px;
  font-style: normal;
}

.ws-ziwei-empty {
  color: #9b9085;
  font-size: 12px;
  font-style: normal;
}

.ws-ziwei-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 16px;
  border-top: 1px solid #ddd4c8;
  border-bottom: 1px solid #ddd4c8;
  color: #90857a;
  font-size: 11px;
}

.ws-ziwei-legend .major { color: #5e53b1; }
.ws-ziwei-legend .minor { color: #8a3026; }

.ws-ziwei-palace-detail {
  padding: 17px;
  border-bottom: 1px solid #ddd4c8;
}

.ws-ziwei-palace-detail > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.ws-ziwei-palace-detail > header span {
  color: #5d53ae;
  font-size: 11px;
  font-weight: 800;
}

.ws-ziwei-palace-detail > header h3 {
  margin: 3px 0 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 19px;
}

.ws-ziwei-palace-detail > header small {
  color: #8b8076;
  font-size: 11px;
  text-align: right;
}

.ws-ziwei-detail-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  margin-top: 13px;
}

.ws-ziwei-detail-stars .ws-ziwei-star {
  font-size: 12px;
}

.ws-ziwei-detail-stars .ws-ziwei-star.major {
  font-size: 16px;
}

.ws-ziwei-palace-detail > p {
  margin: 12px 0 0;
  color: #796f65;
  font-size: 12px;
  line-height: 1.55;
}

.ws-ziwei-patterns {
  padding: 14px 17px;
  border-bottom: 1px solid #ddd4c8;
  background: #f8f5ef;
}

.ws-ziwei-patterns > summary {
  color: #6258b4;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.ws-ziwei-patterns > div {
  display: grid;
  gap: 8px;
  margin-top: 11px;
}

.ws-ziwei-patterns article {
  padding: 10px;
  border: 1px solid #dfd7cc;
  border-radius: 9px;
  background: #fffdf9;
}

.ws-ziwei-patterns article header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.ws-ziwei-patterns article header span {
  color: #8a3026;
  font-size: 10px;
}

.ws-ziwei-patterns article p {
  margin: 7px 0;
  color: #70675e;
  font-size: 12px;
  line-height: 1.5;
}

.ws-ziwei-patterns article small {
  display: block;
  margin-top: 4px;
  color: #93887d;
  font-size: 10px;
  line-height: 1.45;
}

.ws-ziwei-chart-source {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 17px;
  color: #978c81;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.ws-ziwei-reading-context {
  margin-top: 24px;
  padding: 17px 19px;
  border-left: 3px solid #655bb6;
  background: rgba(99, 88, 186, 0.07);
}

.ws-ziwei-reading-context > span {
  color: #5d53ae;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ws-ziwei-reading-context h2 {
  margin: 6px 0 8px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 21px;
}

.ws-ziwei-reading-context p {
  margin: 0;
  color: #60584f;
  font-size: 16px;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .ws-ziwei-compact {
    display: block;
    overflow: hidden;
    border: 1px solid #cfc4b7;
    border-radius: 15px;
    background: #fffdf9;
  }

  .ws-ziwei-compact > div {
    display: grid;
    grid-template-columns: 0.7fr 1.6fr 0.7fr;
  }

  .ws-ziwei-compact > div span {
    display: grid;
    min-width: 0;
    align-content: center;
    gap: 5px;
    padding: 13px 9px;
    border-right: 1px solid #e0d8cd;
  }

  .ws-ziwei-compact > div span:last-child {
    border-right: 0;
  }

  .ws-ziwei-compact small {
    color: #91867b;
    font-size: 8px;
  }

  .ws-ziwei-compact strong {
    min-width: 0;
    color: #3f3832;
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ws-ziwei-compact p {
    margin: 0;
    padding: 10px 13px;
    border-top: 1px solid #e0d8cd;
    color: #70665d;
    font-size: 10px;
  }

  .ws-ziwei-compact button {
    width: 100%;
    min-height: 42px;
    border: 0;
    border-top: 1px solid #ded5ca;
    background: #f8f4ed;
    color: #5d53ae;
    font-size: 11px;
    font-weight: 750;
  }

  .ws-ziwei-full-chart {
    display: none;
    margin-top: 12px;
    box-shadow: none;
  }

  .ws-ziwei-full-chart.mobile-expanded {
    display: block;
  }

  .ws-ziwei-chart-heading {
    align-items: start;
    padding: 15px;
  }

  .ws-ziwei-chart-heading p {
    max-width: 50%;
    text-align: right;
  }

  .ws-ziwei-time-navigation {
    padding-right: 12px;
    padding-left: 12px;
  }

  .ws-ziwei-decadal-scroll,
  .ws-ziwei-annual-scroll {
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .ws-ziwei-board-shell {
    padding-right: 8px;
    padding-left: 8px;
  }

  .ws-ziwei-board {
    min-width: 590px;
  }

  .ws-ziwei-palace-detail > header {
    align-items: start;
  }

  .ws-ziwei-chart-source {
    display: grid;
  }
}

@media (max-width: 390px) {
  .ws-ziwei-mobile-summary h1 {
    font-size: 22px;
  }

  .ws-ziwei-compact > div {
    grid-template-columns: 0.75fr 1.5fr 0.75fr;
  }

  .ws-ziwei-compact > div span {
    padding-right: 6px;
    padding-left: 6px;
  }
}
