* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f2ec;
  --panel: #fffaf4;
  --panel-strong: #ffffff;
  --text: #1f1a17;
  --muted: #7d7269;
  --line: #e7ddd2;
  --accent: #111111;
  --accent-soft: #f1ece5;
  --shadow: 0 20px 60px rgba(39, 27, 19, 0.08);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #fafafa;
}

.mobile-topbar,
.drawer-backdrop {
  display: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 304px;
  padding: 0 20px 20px;
  overflow-y: auto;
  background: #ffffff;
  border-right: 1px solid #eeeeee;
  box-shadow: 10px 0 30px rgba(15, 23, 42, 0.04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 72px;
  margin-bottom: 8px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}

.brand-title {
  font-size: 22px;
  font-weight: 700;
  color: #273247;
}

.brand-subtitle {
  display: none;
}

.nav-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  padding: 0 2px;
  background: transparent;
  color: #1f2937;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item:hover,
.nav-item.active {
  background: #f5f5f5;
  color: #111827;
}

.nav-section-title {
  margin: 22px 0 8px;
  color: #8b919b;
  font-size: 15px;
  line-height: 1;
}

.nav-icon {
  width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #303846;
  font-size: 20px;
}

.unlock-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 10px;
  border: 0;
  border-radius: 10px;
  background: #050505;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.main-content {
  min-height: 100vh;
  margin-left: 304px;
  padding: 28px clamp(24px, 4vw, 56px) 40px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  max-width: 1080px;
  margin: 0 auto 18px;
  padding: 8px 4px 4px;
}

.page-header.meihua-title {
  max-width: 1120px;
  text-align: center;
  padding-top: 38px;
  margin-bottom: 118px;
}

.page-header.meihua-title .page-desc {
  margin-left: auto;
  margin-right: auto;
  font-size: 18px;
  line-height: 1.7;
}

.manual-lines {
  width: min(100%, 560px) !important;
}

.manual-line {
  grid-template-columns: 72px minmax(360px, 1fr) !important;
  gap: 18px !important;
}

.manual-select-shell {
  min-width: 360px !important;
  min-height: 58px !important;
}

.manual-select-preview {
  inset: 0 48px 0 24px !important;
  gap: 18px !important;
}

.manual-yao-line {
  width: 190px !important;
}

.manual-yao-line.yin i {
  width: 78px !important;
}

@media (max-width: 640px) {
  .meihua-panel[data-meihua-panel="manual"] {
    padding: 24px 18px 28px;
    border-radius: 14px;
  }
  .manual-lines {
    width: 100% !important;
  }
  .manual-line {
    grid-template-columns: 64px minmax(280px, 1fr) !important;
  }
  .manual-select-shell {
    min-width: 280px !important;
  }
  .manual-yao-line {
    width: 150px !important;
  }
  .manual-yao-line.yin i {
    width: 62px !important;
  }
}

.manual-lines {
  width: 520px;
}

.manual-line {
  grid-template-columns: 72px 420px;
}

.manual-line select {
  width: 100%;
  min-height: 58px;
  padding: 0 56px 0 28px;
  font-family: Consolas, 'Courier New', 'Microsoft YaHei', monospace;
  font-size: 18px;
}

.manual-select-shell {
  position: relative;
  display: block;
  width: 100%;
  min-height: 58px;
  border: 1px solid #1f1f1f;
  border-radius: 9px;
  background: #fff;
  overflow: hidden;
}

.manual-select-shell::after {
  content: '⌄';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-58%);
  font-size: 22px;
  color: #222;
  pointer-events: none;
}

.manual-select-shell select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.manual-select-preview {
  position: absolute;
  inset: 0 48px 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  pointer-events: none;
  color: #161616;
}

.manual-type-text,
.manual-placeholder {
  min-width: 44px;
  font-size: 18px;
  font-family: 'Microsoft YaHei', sans-serif;
}

.manual-yao-line {
  display: flex;
  align-items: center;
  width: 170px;
  height: 12px;
}

.manual-yao-line.yang {
  background: #222;
}

.manual-yao-line.yin {
  justify-content: space-between;
  background: transparent;
}

.manual-yao-line.yin i {
  display: block;
  width: 70px;
  height: 12px;
  background: #222;
}

.manual-change-mark {
  min-width: 24px;
  font-size: 34px;
  line-height: 1;
  color: #222;
}

.manual-lines {
  width: min(100%, 420px) !important;
  gap: 10px !important;
}

.manual-line {
  grid-template-columns: 56px minmax(280px, 1fr) !important;
  gap: 12px !important;
}

.manual-line-name {
  font-size: 17px !important;
}

.manual-select-shell {
  min-width: 280px !important;
  min-height: 44px !important;
  border-radius: 8px !important;
}

.manual-select-preview {
  inset: 0 38px 0 18px !important;
  gap: 12px !important;
}

.manual-select-shell::after {
  right: 14px !important;
  font-size: 18px !important;
}

.manual-type-text,
.manual-placeholder {
  min-width: 38px !important;
  font-size: 16px !important;
}

.manual-yao-line {
  width: 132px !important;
  height: 8px !important;
}

.manual-yao-line.yin i {
  width: 54px !important;
  height: 8px !important;
}

.manual-change-mark {
  min-width: 18px !important;
  font-size: 24px !important;
}

@media (max-width: 640px) {
  .manual-line {
    grid-template-columns: 52px minmax(240px, 1fr) !important;
  }
  .manual-select-shell {
    min-width: 240px !important;
  }
  .manual-yao-line {
    width: 112px !important;
  }
  .manual-yao-line.yin i {
    width: 46px !important;
  }
}

.meihua-analysis-intro {
  margin-bottom: 18px;
  font-size: 15px;
  line-height: 1.8;
  color: #342a22;
}

.meihua-key-grid {
  display: grid;
  gap: 14px;
}

.meihua-key-card {
  padding: 18px 20px;
  border: 1px solid #e6dccf;
  border-radius: 14px;
  background: #fff;
}

.meihua-key-card h4 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 600;
  color: #2d2118;
}

.meihua-key-card p {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.85;
  color: #2d2118;
}

.meihua-key-card p:last-child {
  margin-bottom: 0;
}

.meihua-key-card.summary {
  background: #fff8e8;
  border-color: #ead6a8;
}

.meihua-key-card.action {
  border-left: 5px solid #1f1f1f;
  background: #ffffff;
}

.meihua-key-card.timing {
  background: #f5fbf7;
  border-color: #bad8c2;
}

.manual-lines {
  width: 420px;
}

.manual-line {
  grid-template-columns: 72px 300px;
}

.manual-line select {
  min-height: 58px;
  padding: 0 48px 0 24px;
  font-family: Consolas, 'Courier New', 'Microsoft YaHei', monospace;
  font-size: 17px;
  letter-spacing: 0;
}

.meihua-note-card {
  display: grid;
  gap: 18px;
}

.meihua-note-time,
.meihua-note-gua-grid,
.meihua-note-question,
.meihua-note-card .meihua-skill-analysis {
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.meihua-note-time {
  padding: 22px 28px;
  font-size: 28px;
  line-height: 1.25;
  color: #1f1a17;
}

.meihua-note-gua-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  padding: 44px 36px 34px;
}

.meihua-note-gua {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.meihua-note-gua > span {
  color: #a7a7a7;
  font-size: 16px;
}

.meihua-note-gua strong {
  font-size: 22px;
  font-weight: 500;
  color: #222;
}

.hexagram-bars {
  display: grid;
  gap: 10px;
  width: 160px;
}

.yao-row {
  position: relative;
  height: 12px;
}

.yao-line {
  display: flex;
  width: 100%;
  height: 12px;
}

.yao-line.yang {
  background: #202020;
}

.yao-line.yin {
  justify-content: space-between;
}

.yao-line.yin i {
  display: block;
  width: 40%;
  height: 100%;
  background: #202020;
}

.meihua-moving-dot {
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border: 1px solid #d45b5b;
  border-radius: 50%;
}

.meihua-note-question {
  padding: 24px 28px;
}

.meihua-note-question h3,
.meihua-note-card .meihua-skill-analysis h3 {
  margin: 0 0 12px;
  color: #b8b8b8;
  font-size: 22px;
  font-weight: 400;
}

.meihua-note-question p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
}

.meihua-note-card .meihua-skill-analysis {
  padding: 28px;
}

.meihua-note-card .meihua-skill-analysis p {
  font-size: 16px;
  line-height: 1.85;
}

@media (max-width: 720px) {
  .meihua-note-time {
    padding: 20px;
    font-size: 22px;
  }
  .meihua-note-gua-grid {
    gap: 14px;
    padding: 34px 18px 28px;
  }
  .hexagram-bars {
    width: 86px;
    gap: 7px;
  }
  .yao-row,
  .yao-line {
    height: 8px;
  }
  .meihua-note-gua strong {
    font-size: 16px;
  }
  .meihua-note-question,
  .meihua-note-card .meihua-skill-analysis {
    padding: 20px;
  }
}

.manual-lines {
  gap: 14px;
  width: 220px;
}

.manual-line {
  grid-template-columns: 58px 120px;
  gap: 18px;
}

.manual-line select {
  min-height: 56px;
  padding: 0 42px 0 18px;
  border-radius: 9px;
  font-size: 14px;
}

.meihua-note-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.meihua-note-time .export-pdf-btn {
  flex: 0 0 auto;
  font-size: 14px;
}

.meihua-stream-status {
  margin: 0 0 12px;
  color: #7d7269;
  font-size: 14px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #8b6f57;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.page-header h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
}

.page-desc {
  margin: 10px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 15px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 440px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.form-card,
.results-panel,
.placeholder-card,
.analysis-box,
.result-card,
.loading-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.form-card {
  padding: 24px;
  backdrop-filter: blur(18px);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.field > span {
  font-size: 13px;
  color: #5e534b;
}

input[type="text"],
input[type="number"],
select,
.date-display,
.secondary-btn,
.primary-btn {
  width: 100%;
  border-radius: 16px;
  border: 1px solid #d8ccc1;
  background: #fff;
  color: var(--text);
  font-size: 15px;
}

input[type="text"],
input[type="number"],
select {
  min-height: 48px;
  padding: 0 14px;
  outline: none;
}

input:disabled {
  background: #f2ede6;
  color: #998b7d;
}

.location-row,
.time-row,
.segmented,
.inline-switch,
.action-row,
.modal-actions,
.modal-header,
.date-picker-grid {
  display: flex;
  gap: 10px;
}

.location-row {
  align-items: center;
}

.location-row input {
  flex: 1;
}

.secondary-btn,
.primary-btn,
.date-display,
.icon-btn {
  min-height: 48px;
  padding: 0 16px;
  cursor: pointer;
}

.date-display {
  text-align: left;
}

.secondary-btn {
  background: #fff;
}

.primary-btn {
  border-color: #111;
  background: #111;
  color: #fff;
  font-weight: 700;
}

.action-row {
  margin-top: 18px;
  justify-content: flex-end;
}

.segmented label,
.inline-switch {
  align-items: center;
  justify-content: center;
  border: 1px solid #d9cfc4;
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

.segmented {
  flex-wrap: wrap;
}

.segmented label {
  flex: 1;
}

.segmented input,
.inline-switch input {
  margin: 0;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.results-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.result-card {
  padding: 20px;
}

.result-card h3,
.placeholder-card h2,
.analysis-box h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.result-card ul {
  margin: 0;
  padding-left: 18px;
  color: #423932;
  line-height: 1.8;
}

.analysis-box {
  margin-top: 18px;
  padding: 24px;
  white-space: pre-wrap;
  line-height: 1.85;
}

.placeholder-card {
  max-width: 1080px;
  margin: 0 auto;
  padding: 42px;
}

.loading-card {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.loading-card.error {
  color: #b42318;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(19, 13, 9, 0.42);
  z-index: 30;
}

.modal.hidden,
.analysis-box.hidden {
  display: none;
}

.modal-card {
  width: min(500px, calc(100vw - 32px));
  padding: 22px;
  border-radius: 24px;
  background: #fffdf8;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-header {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.icon-btn {
  width: 42px;
  min-width: 42px;
  border: 1px solid #ddd0c4;
  border-radius: 999px;
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.date-picker-grid {
  flex-wrap: wrap;
}

.date-picker-grid label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-actions {
  margin-top: 18px;
  justify-content: flex-end;
}

.disabled {
  opacity: 0.65;
}

/* FateMaster-like right panel */
.bazi-title {
  max-width: 1040px;
  margin: 92px auto 44px;
  padding: 0;
  text-align: center;
}

.bazi-title h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.15;
  font-weight: 800;
  color: #050505;
}

.bazi-title .page-desc {
  margin: 28px auto 0;
  color: #6c7280;
  font-size: 20px;
}

.workspace {
  display: block;
  width: min(1120px, 100%);
  max-width: none;
  margin: 0 auto;
}

.form-card {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.form-section {
  margin-bottom: 34px;
}

.form-section h2,
.section-head h2 {
  margin: 0 0 22px;
  color: #60656f;
  font-size: 24px;
  font-weight: 800;
}

.basic-grid {
  display: grid;
  grid-template-columns: minmax(0, 320px) 200px;
  gap: 20px;
  align-items: start;
}

.basic-grid .field {
  width: 100%;
}

.basic-grid .field:first-child {
  max-width: 320px;
}

.basic-grid .field:last-child {
  max-width: 200px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.time-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 92px;
  align-items: start;
}

.time-right {
  padding-top: 34px;
  padding-left: 28px;
  max-width: 420px;
  justify-self: end;
}

.field > span {
  color: #050505;
  font-size: 14px;
  font-weight: 700;
}

input[type="text"],
input[type="number"],
select,
.date-display {
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid #dedede;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  font-size: 14px;
}

.input-mode {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #666;
  font-size: 14px;
}

.mode-pill,
.calendar-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #f3f3f3;
}

.mode-pill label,
.calendar-tabs label {
  flex: 1;
  padding: 8px 16px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  color: #5b5b5b;
}

.mode-pill label:has(input:checked),
.calendar-tabs label:has(input:checked) {
  background: #fff;
  color: #050505;
  font-weight: 800;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.1);
}

.mode-pill input,
.calendar-tabs input {
  display: none;
}

.date-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  text-align: left;
}

.calendar-icon {
  color: #777;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
}

.switch-line input {
  display: none;
}

.switch-ui {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #d9d9d9;
  flex: 0 0 auto;
}

.switch-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s ease;
}

.switch-line input:checked + .switch-ui {
  background: #111;
}

.switch-line input:checked + .switch-ui::after {
  transform: translateX(20px);
}

.time-select-row {
  display: grid;
  grid-template-columns: repeat(2, 170px);
  gap: 12px;
}

.location-field {
  margin-top: 24px;
}

.wide-location {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 0;
}

.wide-location input {
  border-radius: 8px 0 0 8px;
}

.search-btn {
  min-height: 46px;
  border: 1px solid #dedede;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6f747c;
  cursor: pointer;
}

.search-btn .search-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.solar-line {
  margin-top: 18px;
}

.help-dot {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #999;
  border-radius: 50%;
  color: #777;
  font-size: 12px;
}

.action-row {
  margin-top: 36px;
}

.primary-btn {
  min-height: 56px;
  border-radius: 8px;
}

.results-panel {
  margin-top: 36px;
}

.hidden {
  display: none !important;
}

.date-picker-grid-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.picker-field {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.picker-field > span {
  font-size: 18px;
  font-weight: 800;
}

.picker-field select {
  min-height: 46px;
  border-radius: 8px;
}

.bazi-mode-panel {
  margin-top: 34px;
}

.bazi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.pillar-card {
  display: grid;
  gap: 10px;
}

.pillar-title {
  color: #60656f;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.pillar-value {
  min-height: 28px;
  color: #050505;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.pillar-card select {
  min-height: 46px;
  border-radius: 8px;
}

.bazi-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.bazi-actions .secondary-btn {
  width: auto;
  min-width: 88px;
}

/* tighter typography and result layout */
body {
  font-size: 14px;
}

.brand-title {
  font-size: 18px;
}

.nav-item {
  min-height: 44px;
  font-size: 14px;
}

.bazi-title {
  margin-top: 70px;
  margin-bottom: 36px;
}

.bazi-title h1 {
  font-size: 30px;
}

.bazi-title .page-desc {
  margin-top: 20px;
  font-size: 15px;
}

.form-section h2,
.section-head h2 {
  font-size: 18px;
}

.field > span {
  font-size: 14px;
}

input[type="text"],
input[type="number"],
select,
.date-display {
  font-size: 14px;
}

.calendar-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.primary-btn.is-loading,
.primary-btn:disabled {
  border-color: #969696;
  background: #969696;
  color: #fff;
  cursor: wait;
}

.cards-grid {
  display: block;
}

.detail-card {
  position: relative;
  margin-top: 28px;
  padding: 34px 30px;
  border: 1px solid #e1e1e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08);
}

.detail-card h3 {
  margin: 0 0 14px;
  font-size: 20px;
  color: #050505;
}

.bazi-line {
  margin-bottom: 26px;
  color: #5f6672;
  font-size: 14px;
}

.info-grid {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px 20px;
  max-width: 580px;
}

.info-label {
  color: #68707c;
  font-size: 14px;
}

.info-value {
  color: #050505;
  font-size: 15px;
}

.bazi-table-card {
  padding: 28px 26px;
}

.bazi-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.bazi-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: #262626;
  font-size: 14px;
  line-height: 1.55;
}

.bazi-table th,
.bazi-table td {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  text-align: center;
  vertical-align: middle;
}

.bazi-table th {
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
}

.bazi-table tbody th {
  width: 112px;
  color: #4b5563;
}

.bazi-table .day-master-cell {
  color: #050505;
  font-weight: 800;
}

.wuxing-strength-card {
  margin-top: 20px;
}

.wuxing-strength-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 18px;
}

.wuxing-strength-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  color: #262626;
  font-size: 14px;
}

.wuxing-strength-row code {
  color: #111;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  white-space: nowrap;
}

.wuxing-strength-row strong {
  text-align: right;
}

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

.wuxing-disease-grid > div {
  padding: 14px;
  border: 1px solid #b7e4c7;
  border-radius: 8px;
  background: #f7fff9;
}

.wuxing-disease-grid span {
  display: block;
  color: #68707c;
  font-size: 13px;
}

.wuxing-disease-grid strong {
  display: block;
  margin: 6px 0;
  color: #050505;
  font-size: 20px;
}

.wuxing-disease-grid p {
  margin: 0;
  color: #5f6672;
  font-size: 13px;
  line-height: 1.55;
}

.yun-summary {
  margin: 0 0 12px;
  color: #262626;
  font-size: 14px;
  line-height: 1.6;
}

.yun-summary p {
  margin: 0 0 6px;
}

.yun-summary strong {
  color: #050505;
  font-weight: 800;
}

.sub-card-title {
  margin-top: 6px !important;
  margin-bottom: 4px;
}

.yun-table th:first-child,
.yun-table td:first-child {
  width: 72px;
}

.card-tools {
  position: absolute;
  top: 30px;
  right: 30px;
  display: flex;
  gap: 10px;
}

.tool-btn,
.copy-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-size: 14px;
  cursor: pointer;
}

.export-pdf-btn {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #111;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.analysis-box {
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08);
  font-size: 14px;
}

.card-subtitle {
  margin: -4px 0 30px;
  color: #5f6672;
  font-size: 14px;
}

.pillar-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 36px;
  align-items: start;
}

.pillar-detail {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.75;
  text-align: center;
}

.pillar-detail-title {
  margin-bottom: 6px;
  color: #6b7280;
  font-weight: 700;
}

.pillar-detail-value {
  margin-bottom: 10px;
  color: #050505;
  font-size: 24px;
  font-weight: 800;
}

.analysis-box {
  display: block;
  margin-top: 18px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  gap: 14px;
}

.analysis-card {
  margin-top: 18px;
  padding: 22px 30px 20px;
  border: 1px solid #e1e1e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.08);
}

.analysis-card h3 {
  margin: 0 0 14px;
  color: #050505;
  font-size: 22px;
}

.analysis-content {
  margin-top: 0;
  color: #262626;
  font-size: 14px;
  line-height: 1.65;
}

.analysis-content p {
  margin: 0 0 10px;
  line-height: 1.65;
}

.analysis-control-card {
  padding-bottom: 18px;
}

.analysis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.analysis-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid #111827;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.analysis-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.analysis-status {
  margin: -4px 0 10px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
}

.analysis-intro {
  max-width: 920px;
  margin: 4px 0 16px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.7;
}

.analysis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.analysis-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}

.dayun-timeline {
  display: grid;
  gap: 14px;
  max-width: 980px;
}

.dayun-step-card {
  position: relative;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #111;
  border-radius: 8px;
  background: #fafafa;
  overflow: hidden;
}

.dayun-step-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
}

.dayun-step-card summary::-webkit-details-marker {
  display: none;
}

.dayun-step-card summary::after {
  content: '-';
  flex: 0 0 auto;
  color: #6b7280;
  font-size: 20px;
}

.dayun-step-card:not([open]) summary::after {
  content: '+';
}

.dayun-step-card summary > span {
  color: #111827;
  font-size: 14px;
  font-weight: 800;
}

.dayun-step-card summary .analysis-tags {
  margin: 0 0 0 auto;
}

.dayun-step-card .analysis-content {
  padding: 0 16px 16px;
  border-top: 1px solid #f0f0f0;
  background: #fff;
}

.liunian-list {
  display: grid;
  gap: 10px;
  max-width: 980px;
}

.liunian-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.liunian-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 0 16px;
  cursor: pointer;
  list-style: none;
}

.liunian-item summary::-webkit-details-marker {
  display: none;
}

.liunian-item summary::after {
  content: '+';
  flex: 0 0 auto;
  color: #6b7280;
  font-size: 20px;
}

.liunian-item[open] summary::after {
  content: '-';
}

.liunian-item summary > span {
  color: #111827;
  font-size: 14px;
  font-weight: 800;
}

.liunian-item summary .analysis-tags {
  margin: 0 0 0 auto;
}

.liunian-item .analysis-content {
  padding: 0 16px 16px;
  border-top: 1px solid #f0f0f0;
}

.markdown-table-wrap {
  width: 100%;
  margin: 4px 0 10px;
  overflow-x: auto;
}

.markdown-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.65;
}

.markdown-table th,
.markdown-table td {
  padding: 9px 12px;
  border: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

.markdown-table th {
  background: #f8fafc;
  color: #111827;
  font-weight: 700;
}

.markdown-table td:first-child,
.markdown-table td:nth-child(2) {
  white-space: nowrap;
}

@media (max-width: 1180px) {




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

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

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

  .basic-grid .field:first-child,
  .basic-grid .field:last-child {
    max-width: none;
  }

  .time-layout {
    gap: 28px;
  }

  .time-right {
    max-width: none;
    padding-left: 0;
    justify-self: stretch;
  }
}

@media (max-width: 900px) {
  .main-content {
    padding: 16px 16px 28px;
  }

  .page-header {
    margin-bottom: 14px;
    padding: 0;
  }

  .bazi-title {
    margin: 28px auto 28px;
  }

  .bazi-title h1 {
    font-size: 28px;
  }

  .bazi-title .page-desc {
    margin-top: 14px;
    font-size: 14px;
  }

  .form-section {
    margin-bottom: 26px;
  }

  .form-section h2,
  .section-head h2 {
    margin-bottom: 14px;
    font-size: 18px;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .input-mode {
    justify-content: space-between;
    width: 100%;
  }

  .basic-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .time-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .time-right {
    padding: 0;
    max-width: none;
    justify-self: stretch;
  }

  .time-select-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

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

  .pillar-detail-grid {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

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

  .analysis-card,
  .detail-card,
  .bazi-table-card,
  .placeholder-card {
    padding-left: 16px;
    padding-right: 16px;
  }

  .markdown-table {
    min-width: 640px;
  }
}

@media (max-width: 640px) {
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 56px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #ececec;
  }

  .mobile-menu-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .mobile-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    margin-left: 11px;
    border-radius: 999px;
    background: #111;
  }

  .mobile-brand-title {
    font-size: 14px;
    font-weight: 700;
    color: #273247;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(82vw, 320px);
    height: 100vh;
    padding: 0 14px 14px;
    transform: translateX(-102%);
    transition: transform 0.25s ease;
    z-index: 50;
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.16);
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 45;
  }

  body.nav-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden;
  }

  .nav-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .nav-section-title,
  .unlock-btn {
    display: block;
  }

  .nav-item {
    width: 100%;
  }

  .brand {
    gap: 12px;
    height: 64px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 24px;
  }

  .brand-title {
    font-size: 14px;
  }

  .sidebar {
    overflow-y: auto;
  }

  .main-content {
    margin-left: 0;
    padding: 20px 24px 40px;
  }

  .bazi-title {
    margin: 20px auto 18px;
  }

  .form-section {
    margin-bottom: 22px;
  }

  .section-head {
    gap: 8px;
  }

  .section-head h2 {
    margin-right: auto;
  }

  .input-mode {
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
  }

  .basic-grid {
    gap: 12px;
  }

  .time-layout {
    gap: 14px;
  }

  .time-select-row {
    gap: 8px;
  }

  .analysis-card,
  .detail-card,
  .bazi-table-card,
  .placeholder-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .action-row {
    position: static;
    padding: 0;
    margin-top: 24px;
    background: transparent;
  }

  .action-row .primary-btn {
    width: 100%;
  }

  .time-right {
    display: block;
    gap: 0;
  }

  .switch-line.solar-line {
    margin: 0;
    flex: 0 0 auto;
  }

  #coord-preview {
    margin: 0;
    flex: 1 1 100%;
    min-width: 0;
  }

  .bazi-title h1 {
    font-size: 24px;
  }

  .bazi-title .page-desc {
    font-size: 13px;
    line-height: 1.5;
  }

  .form-card {
    padding: 16px;
  }

  .birth-shichen-field {
    display: none !important;
  }

  .birth-time-controls {
    display: block;
    width: 100%;
  }

  .birth-time-controls > span {
    display: block;
    margin: 0 0 10px;
    color: #050505;
    font-size: 14px;
    font-weight: 700;
  }

  .birth-time-controls .time-select-row {
    grid-template-columns: 170px 170px;
    max-width: 350px;
    margin-left: 0;
  }

  input[type="text"],
  input[type="number"],
  select,
  .date-display {
    min-height: 44px;
    font-size: 14px;
  }

  .mode-pill label,
  .calendar-tabs label {
    padding: 8px 10px;
  }

  .time-select-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

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

  .pillar-detail-grid {
    grid-template-columns: 1fr;
  }

  .wuxing-disease-grid {
    grid-template-columns: 1fr;
  }

  .wuxing-strength-row {
    grid-template-columns: 28px minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .wuxing-strength-row code {
    font-size: 12px;
  }

  .analysis-card {
    padding-left: 16px;
    padding-right: 16px;
  }

  .liunian-item summary {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }

  .dayun-step-card summary {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }

  .liunian-item summary::after {
    position: absolute;
    right: 14px;
    top: 10px;
  }

  .dayun-step-card summary::after {
    position: absolute;
    right: 14px;
    top: 10px;
  }

  .liunian-item summary .analysis-tags {
    margin-left: 0;
    padding-right: 24px;
  }

  .dayun-step-card summary .analysis-tags {
    margin-left: 0;
    padding-right: 24px;
  }

  .markdown-table {
    min-width: 520px;
  }
}

@media (max-width: 380px) {
  .main-content {
    padding-left: 24px;
    padding-right: 24px;
  }





}

@media print {
  body.printing-chart {
    background: #fff;
  }

  body.printing-chart .mobile-topbar,
  body.printing-chart .sidebar,
  body.printing-chart .drawer-backdrop,
  body.printing-chart .page-header,
  body.printing-chart .form-card,
  body.printing-chart .card-tools,
  body.printing-chart .copy-btn {
    display: none !important;
  }

  body.printing-chart .main-content {
    margin: 0;
    padding: 0;
  }

  body.printing-chart .page,
  body.printing-chart .results-panel,
  body.printing-chart .analysis-box {
    display: block !important;
  }

  body.printing-chart .detail-card,
  body.printing-chart .analysis-card {
    break-inside: avoid;
    box-shadow: none;
    border-color: #ddd;
    margin-top: 14px;
  }
}

/* Reference-style bazi form overrides */
/* Hehun matching page */
.hehun-title {
  max-width: 1040px;
  margin: 24px auto 28px;
  text-align: center !important;
}

.hehun-title h1 {
  font-size: 32px;
  line-height: 1.2;
  margin: 0;
  color: #0f172a;
}

.hehun-title .page-desc {
  text-align: center !important;
  margin: 14px auto 0;
  font-size: 14px;
}

.hehun-workspace {
  width: min(1120px, 100%);
  margin: 0 auto;
  font-size: 14px;
}

.hehun-form {
  background: transparent;
}

.hehun-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.hehun-person {
  width: 100%;
  max-width: 438px;
}

.hehun-person h2 {
  margin: 0 0 24px;
  font-size: 18px;
  color: #4b5563;
}

.hehun-basic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.hehun-person .field,
.hehun-person .field-group {
  margin-bottom: 16px;
}

.hehun-person .field > span,
.hehun-person .field-group > span,
.hehun-person .switch-line,
.hehun-person .field-hint,
.hehun-person .hint {
  font-size: 14px;
}

.hehun-person input,
.hehun-person select {
  font-size: 14px;
}

.hehun-calendar-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: 100%;
  height: 54px;
  padding: 5px;
  margin: 8px 0 10px;
  border-radius: 12px;
}

.hehun-date-input {
  width: 100%;
  max-width: 100%;
}

.hehun-date-trigger {
  width: 100% !important;
  max-width: 100% !important;
  font-size: 14px;
}

.hehun-person .time-select-row {
  grid-template-columns: 1fr 1fr;
  max-width: none;
}

.hehun-person .wide-location,
.hehun-person .hehun-calendar-switch,
.hehun-person .hehun-date-trigger {
  max-width: 438px !important;
}

.hehun-place .wide-location {
  width: 100%;
}

.hehun-submit {
  width: 100%;
  margin-top: 8px;
}

.hehun-result {
  margin-top: 24px;
}

.hehun-result-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.hehun-result-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.hehun-result-card .analysis-content {
  color: #111827;
  font-size: 14px;
}

@media (max-width: 900px) {
  .hehun-grid {
    grid-template-columns: 1fr;
  }

  .hehun-basic-grid {
    grid-template-columns: 1fr;
  }

  .hehun-person {
    max-width: 100%;
  }
}

@media (min-width: 901px) {
  .sidebar {
    transform: translateX(-102%);
  }

  .main-content {
    margin-left: 0;
    padding: 24px clamp(20px, 3vw, 40px) 40px;
  }

  .bazi-title {
    max-width: 1120px;
    margin: 48px auto 32px;
  }

  .bazi-title h1 {
    font-size: 32px;
  }

  .bazi-title .page-desc {
    margin-top: 16px;
    font-size: 15px;
  }

  .workspace {
    display: block;
    width: min(1040px, calc(100vw - 40px));
    max-width: 1040px;
    margin: 0 auto;
  }

  .form-section {
    margin-bottom: 32px;
  }

  .form-section h2,
  .section-head h2 {
    margin-bottom: 22px;
    font-size: 18px;
  }

  .basic-grid {
    grid-template-columns: 300px 200px;
    gap: 20px;
  }

  .section-head {
    align-items: center;
  }

  .date-mode-panel {
    display: grid;
    grid-template-columns: 350px minmax(360px, 1fr);
    column-gap: 96px;
    align-items: start;
  }

  .time-left,
  .time-right {
    max-width: none;
  }

  .time-right {
    padding-top: 34px;
    padding-left: 0;
    justify-self: stretch;
  }

  .date-trigger,
  .time-left select,
  .time-right select {
    max-width: 350px;
  }

  .time-select-row {
    grid-template-columns: 170px 170px;
    gap: 10px;
    max-width: 350px;
  }

  .location-field {
    grid-column: 1 / -1;
    margin-top: 22px;
  }

  .wide-location {
    width: 100%;
  }

  .action-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    margin-top: 28px;
  }

  .bazi-actions .secondary-btn {
    width: 88px;
    min-width: 88px;
    white-space: normal;
  }

  .action-row .primary-btn {
    width: 100%;
  }
}

/* Restore desktop sidebar and reference date field */
@media (min-width: 901px) {
  .mobile-topbar,
  .drawer-backdrop {
    display: none !important;
  }

  .sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: 304px !important;
    height: 100vh !important;
    padding: 0 20px 20px !important;
    transform: none !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    border-right: 1px solid #eeeeee !important;
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.04) !important;
  }

  .main-content {
    margin-left: 304px !important;
    padding: 28px clamp(24px, 4vw, 56px) 40px !important;
  }

  .workspace {
    width: min(1040px, 100%) !important;
    max-width: 1040px !important;
  }

  .time-left .field-group:first-child > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .time-left .mode-pill {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 350px;
    height: 44px;
    padding: 4px;
    border-radius: 10px;
  }

  .time-left .mode-pill label {
    display: grid;
    place-items: center;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
  }

  .date-trigger {
    width: 350px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border: 1px solid #dedede;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    color: #050505;
    font-size: 14px;
    cursor: pointer;
  }

  .date-trigger-icon {
    color: #777;
    font-size: 18px;
    line-height: 1;
  }

  #date-hint {
    display: none;
  }
}

/* Exact reference-style form layout */
@media (min-width: 901px) {
  .main-content {
    margin-left: 304px !important;
    padding: 26px 56px 40px !important;
  }

  .bazi-title {
    margin: 48px auto 42px !important;
  }

  .bazi-title h1 {
    font-size: 32px !important;
    font-weight: 800 !important;
  }

  .bazi-title .page-desc {
    margin-top: 18px !important;
    font-size: 15px !important;
    color: #6c7280 !important;
  }

  .workspace {
    width: min(1040px, 100%) !important;
    max-width: 1040px !important;
    display: block !important;
  }

  .form-card {
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .form-section {
    margin-bottom: 34px !important;
  }

  .form-section h2,
  .section-head h2 {
    margin: 0 0 22px !important;
    color: #60656f !important;
    font-size: 22px !important;
    font-weight: 800 !important;
  }

  .basic-grid {
    display: grid !important;
    grid-template-columns: 300px 200px !important;
    gap: 20px !important;
  }

  .field > span,
  .field-group > span,
  .birth-time-controls > span {
    display: block;
    margin: 0 0 10px;
    color: #050505 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
  }

  .basic-grid input,
  .basic-grid select {
    height: 46px !important;
  }

  .section-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 26px !important;
  }

  .input-mode {
    transform: translateY(18px);
  }

  .date-mode-panel {
    display: grid !important;
    grid-template-columns: 350px 1fr !important;
    column-gap: 186px !important;
    row-gap: 24px !important;
    align-items: start !important;
  }

  .time-left,
  .time-right {
    max-width: none !important;
    padding: 0 !important;
  }

  .birth-date-group > span {
    margin-bottom: 12px !important;
  }

  .calendar-switch {
    width: 350px !important;
    height: 44px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    padding: 4px !important;
    border-radius: 10px !important;
    background: #f3f3f3 !important;
  }

  .calendar-switch label {
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    color: #6b7280 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
  }

  .calendar-switch label:has(input:checked) {
    color: #050505 !important;
    background: #ffffff !important;
    box-shadow: 0 1px 5px rgba(15, 23, 42, 0.1) !important;
  }

  .date-trigger {
    width: 350px !important;
    height: 46px !important;
    min-height: 46px !important;
    margin-top: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 14px !important;
    border: 1px solid #dedede !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
    color: #050505 !important;
    font-size: 16px !important;
  }

  .date-trigger-icon {
    color: #777 !important;
    font-size: 18px !important;
  }

  #date-hint {
    display: none !important;
  }

  .birth-known-line {
    margin: 0 0 22px !important;
    color: #050505 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
  }

  .birth-time-hint {
    margin: 0 0 26px !important;
    color: #6c7280 !important;
    font-size: 15px !important;
  }

  .birth-shichen-field {
    display: none !important;
  }

  .birth-time-controls > span {
    margin-bottom: 10px !important;
  }

  .time-select-row {
    display: grid !important;
    grid-template-columns: 170px 170px !important;
    gap: 10px !important;
    max-width: 350px !important;
  }

  .time-select-row select {
    height: 46px !important;
  }

  .location-field {
    grid-column: 1 / -1 !important;
    margin-top: 18px !important;
  }

  .location-field .field > span {
    margin-bottom: 10px !important;
  }

  .wide-location {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 52px !important;
  }

  .wide-location input {
    height: 46px !important;
    font-size: 16px !important;
  }

  #geo-status {
    margin: 10px 0 0 !important;
    color: #6c7280 !important;
    font-size: 14px !important;
  }

  #coord-preview {
    margin: 4px 0 0 !important;
    color: #8a8f99 !important;
    font-size: 13px !important;
  }

  .solar-line {
    grid-column: 1 / -1 !important;
    margin: 0 !important;
    color: #050505 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
  }

  .action-row {
    display: block !important;
    margin-top: 34px !important;
  }

  .bazi-actions .secondary-btn {
    display: none !important;
  }

  .action-row .primary-btn {
    width: 100% !important;
    height: 46px !important;
    min-height: 46px !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
  }
}

/* Bazi mode and 14px body text correction */
body,
input,
select,
button,
textarea {
  font-size: 14px;
}

@media (min-width: 901px) {
  .date-mode-panel.hidden,
  .bazi-mode-panel.hidden,
  .hidden {
    display: none !important;
  }

  #bazi-mode-panel:not(.hidden) {
    display: block !important;
  }

  #bazi-mode-panel .bazi-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
    align-items: start !important;
    width: 100% !important;
  }

  #bazi-mode-panel .pillar-card {
    display: grid !important;
    gap: 10px !important;
  }

  #bazi-mode-panel .pillar-title {
    color: #60656f !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    text-align: center !important;
  }

  #bazi-mode-panel .pillar-value {
    min-height: 26px !important;
    color: #050505 !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    text-align: center !important;
  }

  #bazi-mode-panel .pillar-pair {
    display: grid !important;
    gap: 10px !important;
  }

  #bazi-mode-panel select {
    width: 100% !important;
    height: 46px !important;
    max-width: none !important;
    font-size: 14px !important;
  }

  .input-mode,
  .field-hint,
  .hint,
  .page-desc {
    font-size: 14px !important;
  }

  .form-section h2,
  .section-head h2 {
    font-size: 22px !important;
  }

  .field > span,
  .field-group > span,
  .birth-time-controls > span {
    font-size: 14px !important;
  }

  .birth-known-line,
  .solar-line,
  .action-row .primary-btn {
    font-size: 14px !important;
  }
}

/* Final requested title and date icon fixes */
.form-section h2,
.section-head h2 {
  font-size: 18px !important;
}

.date-trigger-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-block;
  border: 2px solid #8a8a8a;
  border-radius: 3px;
}

.date-trigger-icon::before {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: 3px;
  height: 2px;
  background: #8a8a8a;
}

.date-trigger-icon::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: #8a8a8a;
}

/* Cleaner calendar icon matching reference */
.date-trigger-icon {
  position: relative !important;
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  display: inline-block !important;
  border: 2px solid #8b8b8b !important;
  border-radius: 3px !important;
  background: transparent !important;
  box-shadow: none !important;
}

.date-trigger-icon::before {
  content: '' !important;
  position: absolute !important;
  left: -2px !important;
  right: -2px !important;
  top: 4px !important;
  height: 2px !important;
  background: #8b8b8b !important;
}

.date-trigger-icon::after {
  content: '' !important;
  position: absolute !important;
  left: 3px !important;
  right: 3px !important;
  top: -5px !important;
  height: 6px !important;
  border-left: 2px solid #8b8b8b !important;
  border-right: 2px solid #8b8b8b !important;
  background: transparent !important;
  border-radius: 0 !important;
}

/* Brand logo image */
.brand-mark {
  overflow: hidden;
  background: #fff;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Reliable selected background for segmented controls */
.mode-pill label > span {
  display: block;
  border-radius: 8px;
}

.mode-pill label > input:checked + span {
  background: #ffffff !important;
  color: #050505 !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.1) !important;
}

@media (min-width: 901px) {
  .input-mode .mode-pill label > input:checked + span {
    padding: 8px 16px;
  }

  .calendar-switch label > input:checked + span {
    display: grid !important;
    place-items: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
  }
}

/* Initial selected segmented state */
.mode-pill label.is-selected,
.mode-pill label.is-selected > span,
.mode-pill label:has(input:checked),
.mode-pill label > input:checked + span {
  background: #ffffff !important;
  color: #050505 !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.1) !important;
}

.calendar-switch label.is-selected,
.calendar-switch label.is-selected > span {
  display: grid !important;
  place-items: center !important;
}

/* Keep input-mode segmented buttons horizontal */
.input-mode .mode-pill {
  display: inline-grid !important;
  grid-template-columns: 1fr 1fr !important;
  width: 166px !important;
  height: 44px !important;
  align-items: center !important;
}

.input-mode .mode-pill label,
.input-mode .mode-pill label > span {
  min-width: 0 !important;
  width: 100% !important;
  height: 36px !important;
  display: grid !important;
  place-items: center !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  padding: 0 !important;
}

/* Mobile date picker matches desktop date field */
@media (max-width: 640px) {
  .date-mode-panel {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .time-left {
    width: 100% !important;
  }

  .birth-date-group {
    width: 100% !important;
    display: block !important;
  }

  .birth-date-group > span {
    display: block !important;
    margin: 0 0 10px !important;
    color: #050505 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
  }

  .calendar-switch {
    width: 100% !important;
    height: 44px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    padding: 4px !important;
    border-radius: 10px !important;
    background: #f3f3f3 !important;
  }

  .calendar-switch label,
  .calendar-switch label > span {
    width: 100% !important;
    height: 36px !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    white-space: nowrap !important;
    writing-mode: horizontal-tb !important;
  }

  .date-trigger {
    width: 100% !important;
    max-width: none !important;
    min-height: 46px !important;
    margin-top: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 14px !important;
    border: 1px solid #dedede !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06) !important;
    color: #050505 !important;
    font-size: 14px !important;
  }

  #date-hint {
    display: none !important;
  }
}


.meihua-workspace {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(28px, 6vw, 120px);
}

.meihua-shell {
  width: min(100%, 1040px);
  margin: 0 auto;
}

.meihua-card,
.meihua-result-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.meihua-card {
  max-width: 100%;
  padding: 0;
  margin: 0;
  width: 100%;
}

.meihua-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  width: 100%;
}

.meihua-form-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.meihua-form-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.meihua-history-btn {
  width: 48px;
  height: 48px;
  border: 1px solid #e2dfda;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  font-size: 18px;
}

.meihua-question {
  width: 100%;
  min-height: 46px;
  margin-bottom: 24px;
  padding: 0 16px;
  border: 1px solid #e1dfdb;
  border-radius: 10px;
  font-size: 15px;
  width: 100%;
}

.meihua-method-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  width: 100%;
}

.meihua-method-row > span {
  color: #5e534b;
  font-size: 14px;
}

.meihua-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 4px;
  border-radius: 999px;
  background: #f4f4f4;
  width: min(100%, 520px);
}

.meihua-tabs label {
  min-height: 34px;
  padding: 8px 18px;
  border-radius: 999px;
  color: #666;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
}

.meihua-tabs label.is-selected {
  background: #fff;
  color: #111;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.meihua-tabs input {
  display: none;
}

.liuyao-card .meihua-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 680px);
}

.liuyao-card .meihua-tabs label {
  padding-inline: 14px;
}


.meihua-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
}

.meihua-panel input[type="number"],
.meihua-panel input[type="text"] {
  min-height: 44px;
}

.meihua-panel[data-meihua-panel="number"] {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
  width: min(100%, 700px);
}

.number-mode-picker {
  display: flex;
  align-items: center;
  gap: 34px;
}

.number-mode-picker label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #2c2925;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.number-mode-picker input {
  width: 16px;
  height: 16px;
  accent-color: #b73322;
}

.number-inputs {
  min-width: 0;
}

.number-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.number-input-group input {
  width: 118px;
  min-height: 38px;
  border: 1px solid #dedede;
  border-radius: 8px;
  background: #fff;
  padding: 0 14px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.number-separator,
.number-hint {
  color: #5e534b;
  font-size: 14px;
  white-space: nowrap;
}
.meihua-panel[data-meihua-panel="random"] {
  color: var(--muted);
  font-size: 14px;
}

.meihua-panel[data-meihua-panel="manual"] {
  width: min(100%, 1040px);
  margin: 8px 0 22px;
  padding: 32px 34px 36px;
  border: 1px solid #e6e1da;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.meihua-panel[data-meihua-panel="manual"] h3 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.3;
}

.meihua-panel[data-meihua-panel="manual"] > p {
  margin: 0 0 24px;
  color: #6f665f;
  font-size: 15px;
  line-height: 1.7;
}

.meihua-manual {
  margin-top: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fafafa;
}

.manual-lines {
  display: grid;
  gap: 14px;
  width: 220px;
}

.manual-line {
  display: grid;
  grid-template-columns: 58px 120px;
  align-items: center;
  gap: 18px;
}

.manual-line-name {
  color: #25221e;
  font-size: 18px;
  text-align: right;
  white-space: nowrap;
}

.manual-line select {
  width: 100%;
  min-height: 56px;
  padding: 0 42px 0 18px;
  border: 1px solid #1f1f1f;
  border-radius: 9px;
  background: #fff;
  color: #222;
  font-size: 14px;
}
.meihua-rule-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 26px;
  border: 0;
  background: transparent;
  color: #5e534b;
  font-size: 14px;
  text-align: left;
  padding: 0;
}

.meihua-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 0;
  border: 0;
  border-radius: 10px;
  background: #b7b7b7;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: not-allowed;
  transition: none;
}

.meihua-submit.is-ready {
  background: #050505;
  cursor: pointer;
}





.meihua-result {
  display: grid;
  gap: 16px;
  width: 100%;
  margin-top: 26px;
}

.meihua-result-card {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.meihua-result-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  margin: 0 0 14px;
  display: none;
}

.meihua-result-head span {
  color: var(--muted);
  font-size: 14px;
}

.meihua-gua-grid,
.meihua-analysis-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 1120px);
}

.meihua-gua-grid > div,
.meihua-analysis-grid > section,
.meihua-lines {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.meihua-gua-grid span,
.meihua-analysis-grid h3,
.meihua-lines h3 {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  color: #666;
}

.meihua-gua-grid strong {
  display: block;
  margin-bottom: 6px;
  font-size: 24px;
}

.meihua-lines p,
.meihua-analysis-grid p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .meihua-workspace {
    grid-template-columns: 1fr;
  }
  .meihua-workspace {
    width: 100%;
    padding: 0 18px;
  }
  .meihua-panel[data-meihua-panel="number"],
  .meihua-panel[data-meihua-panel="three"] {
    grid-template-columns: 1fr;
  }
  .manual-line {
    grid-template-columns: 44px 64px 56px auto;
  }
  .meihua-gua-grid,
  .meihua-analysis-grid {
    grid-template-columns: 1fr;
  }
  .meihua-tabs {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .meihua-tabs label {
    min-height: 66px;
    font-size: 14px;
  }
  .meihua-question,
  .meihua-submit,
  .meihua-panel,
  .meihua-gua-grid {
    width: 100%;
  }
}









.number-input-group input.is-missing {
  border-color: #c93324;
  background: #fff5f2;
  box-shadow: 0 0 0 3px rgba(201, 51, 36, 0.12);
}

html {
  scrollbar-gutter: stable;
}

.meihua-skill-analysis {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.meihua-skill-analysis h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #666;
}

.meihua-skill-analysis p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}




.meihua-key-card.intro {
  margin-bottom: 14px;
  background: #fafafa;
  border-color: #e8e8e8;
}

.meihua-key-card.intro h4 {
  color: #8d8d8d;
}

.history-calibration-card {
  border-color: #ead6a8;
  background: #fffaf0;
}

.history-calibration-list {
  margin: 10px 0 0 20px;
  padding: 0;
}

.history-calibration-list li {
  margin: 0 0 8px;
  line-height: 1.7;
}

.liunian-text-list {
  display: grid;
  gap: 16px;
  max-width: 980px;
}

.liunian-text-item {
  padding: 0;
  border: 0;
  background: transparent;
}

.liunian-text-item h4 {
  margin: 0 0 6px;
  color: #111827;
  font-size: 15px;
  font-weight: 800;
}

.history-calibration-card {
  padding: 16px 22px 14px;
}

.history-calibration-card h3 {
  margin-bottom: -40px;
  font-size: 20px;
}

.history-calibration-card .analysis-content p {
  margin-bottom: 8px;
}

.history-calibration-card .history-calibration-list {
  margin-top: -30px;
}

.history-calibration-card .history-calibration-list li {
  margin-bottom: 6px;
}

.analysis-content strong {
  color: #050505;
  font-weight: 800;
}

.history-calibration-card {
  padding: 12px 22px 10px !important;
  min-height: 0 !important;
  height: auto !important;
}

.history-calibration-card h3 {
  margin: 0 0 8px !important;
}

.history-calibration-card .analysis-content p {
  margin: 0 0 8px !important;
}

.history-calibration-card .history-calibration-list {
  margin: 0 0 0 20px !important;

}
.history-calibration-card .history-calibration-list li {
  margin-bottom: 4px !important;
}
.page-header.liuyao-title {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.page-header.liuyao-title h1 {
  margin: 0 0 22px;
  color: #050505;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.2;
}

.page-header.liuyao-title .page-desc {
  margin: 0;
  color: #6b7280;
  font-size: 18px;
}

@media (max-width: 720px) {
  .page-header.liuyao-title {
    min-height: 210px;
  }
  .page-header.liuyao-title h1 {
    font-size: 28px;
  }
  .page-header.liuyao-title .page-desc {
    font-size: 15px;
  }
}

.liuyao-card .meihua-panel[data-liuyao-panel="number"] {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 14px;
  width: min(100%, 700px);
}

.liuyao-card .meihua-panel[data-liuyao-panel="random"] {
  color: var(--muted);
  font-size: 14px;
}

.liuyao-card .meihua-panel[data-liuyao-panel="manual"] {
  width: min(100%, 1040px);
  margin: 8px 0 22px;
  padding: 32px 34px 36px;
  border: 1px solid #e6e1da;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.liuyao-card .meihua-panel[data-liuyao-panel="manual"] h3 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.3;
}

.liuyao-card .meihua-panel[data-liuyao-panel="manual"] > p {
  margin: 0 0 24px;
  color: #6f665f;
  font-size: 15px;
  line-height: 1.7;
}

.liuyao-shake-panel {
  width: min(100%, 1040px);
  margin: 8px 0 22px;
  padding: 26px 28px 28px;
  border: 1px solid #efc8ad;
  border-radius: 10px;
  background: #fff8f2;
  justify-items: center;
  gap: 20px;
}

.liuyao-shake-panel h3 {
  margin: 0;
  color: #9aa0aa;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
}

.liuyao-coin-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 62px;
  width: 100%;
  min-height: 130px;
  cursor: pointer;
  user-select: none;
}

.liuyao-coin-area img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  transform-style: preserve-3d;
}

.liuyao-coin-area.is-shaking img {
  animation: liuyaoCoinShake 0.22s linear infinite;
}

@keyframes liuyaoCoinShake {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

.liuyao-shake-tip {
  width: 100%;
  margin: 0;
  padding: 18px 20px;
  border-radius: 8px;
  background: #fff0e4;
  color: #c77742;
  font-size: 18px;
  line-height: 1.7;
}

.liuyao-shake-lines {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.liuyao-shake-line-row {
  display: grid;
  grid-template-columns: 70px 52px 240px 28px;
  align-items: center;
  color: #c77742;
  font-size: 22px;
  line-height: 1.25;
}

.liuyao-shake-line-row b {
  color: #9aa0aa;
  font-weight: 600;
}

.coin-line {
  display: inline-block;
  height: 32px;
  width: 224px;
  background: #333;
}

.coin-line.broken {
  background: linear-gradient(90deg, #333 0 34%, transparent 34% 66%, #333 66% 100%);
}

.coin-moving {
  color: #cf3a25;
  font-size: 28px;
  font-weight: 800;
}

.liuyao-analysis-paper {
  width: min(100%, 980px);
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  margin: 24px auto 0;
  padding: 34px 42px 44px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.85;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.liuyao-plain-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1f2937;
  font: inherit;
  line-height: 1.85;
}

.liuyao-analysis-paper h2 {
  margin: 34px 0 16px;
  padding-top: 4px;
  color: #111827;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
}

.liuyao-analysis-paper h2:first-child {
  margin-top: 0;
}

.liuyao-analysis-paper h3 {
  margin: 26px 0 12px;
  color: #111827;
  font-size: 20px;
  font-weight: 800;
}

.liuyao-analysis-paper h4 {
  margin: 22px 0 8px;
  color: #111827;
  font-size: 17px;
  font-weight: 800;
}

.liuyao-analysis-paper p {
  margin: 0 0 14px;
}

.liuyao-analysis-paper ul {
  margin: 0 0 16px 22px;
  padding: 0;
}

.liuyao-analysis-paper li {
  margin: 0 0 8px;
}

.liuyao-analysis-paper .markdown-table-wrap {
  margin: 12px 0 22px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.liuyao-analysis-paper .markdown-table {
  min-width: 640px;
  max-width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}

.liuyao-analysis-paper .markdown-table th,
.liuyao-analysis-paper .markdown-table td {
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  color: #1f2937;
  vertical-align: top;
}

.liuyao-analysis-paper .markdown-table th {
  background: #f5f6f8;
  color: #111827;
  font-weight: 800;
}

.liuyao-analysis-paper .liuyao-red {
  color: #c61f12;
  font-weight: 800;
}

.liuyao-analysis-paper .liuyao-wangshuai-table {
  table-layout: fixed;
}

.liuyao-analysis-paper .liuyao-wangshuai-table th:nth-child(1),
.liuyao-analysis-paper .liuyao-wangshuai-table td:nth-child(1) {
  width: 24%;
}

.liuyao-analysis-paper .liuyao-wangshuai-table th:nth-child(2),
.liuyao-analysis-paper .liuyao-wangshuai-table td:nth-child(2) {
  width: 28%;
}

.liuyao-analysis-paper .liuyao-wangshuai-table th:nth-child(3),
.liuyao-analysis-paper .liuyao-wangshuai-table td:nth-child(3) {
  width: 48%;
}

.liuyao-analysis-paper .liuyao-wangshuai-table td {
  word-break: break-word;
  text-wrap: pretty;
}

.liuyao-stream-status {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f5f6f8;
  color: #4b5563;
  font-size: 14px;
}

.liuyao-text-card {
  margin: 0 0 14px;
  padding: 20px 24px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}

.liuyao-text-card h2 {
  margin: 0 0 10px;
  color: #111827;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}


.liuyao-text-card p {
  margin: 0 0 8px;
  color: #1f2937;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.liuyao-text-card p:last-child {
  margin-bottom: 0;
}

.liuyao-pending-line {
  color: #6b7280;
  font-style: italic;
}

.liuyao-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-top: 4px;
}

.liuyao-info-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid #d9f0df;
  border-radius: 8px;
  background: #ffffff;
}

.liuyao-info-item.is-wide {
  grid-column: 1 / -1;
}

.liuyao-info-item span {
  color: #5b6b60;
  font-size: 13px;
  font-weight: 700;
}

.liuyao-info-item strong {
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
.liuyao-info-text {
  display: grid;
  gap: 6px;
  color: #111827;
  font-size: 15px;
  line-height: 1.85;
  white-space: normal;
}

.liuyao-info-text div {
  display: flex;
  flex-wrap: wrap;
  column-gap: 46px;
  row-gap: 2px;
}

.liuyao-info-text strong {
  font-weight: 800;
}

.liuyao-info-grid {
    grid-template-columns: 1fr;
  }
}

.liuyao-wait-shell h2 {
  margin-top: 28px;
}

.liuyao-skeleton-table {
  width: 100%;
  height: 122px;
  margin: 12px 0 22px;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  background:
    linear-gradient(90deg, #f5f6f8 0 32%, transparent 32% 33%, #f5f6f8 33% 100%) top / 100% 44px no-repeat,
    repeating-linear-gradient(180deg, transparent 0 38px, #e5e7eb 38px 39px),
    repeating-linear-gradient(90deg, transparent 0 34%, #e5e7eb 34% 34.2%);
}

.liuyao-skeleton-table.large {
  height: 260px;
}

@media (max-width: 720px) {
  .liuyao-analysis-paper {
    margin-top: 18px;
    padding: 22px 18px 28px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.75;
  }
  .liuyao-analysis-paper h2 {
    margin: 26px 0 12px;
    font-size: 20px;
  }
  .liuyao-analysis-paper h3 {
    font-size: 18px;
  }
  .liuyao-analysis-paper h4 {
    font-size: 16px;
  }
  .liuyao-analysis-paper .markdown-table {
    min-width: 520px;
  }
}
/* Ziwei page */
.ziwei-title {
  max-width: 1040px;
  margin: 24px auto 44px;
  text-align: center !important;
}

.ziwei-title h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.15;
  color: #020617;
  font-weight: 800;
}

.ziwei-title .page-desc {
  margin: 18px auto 0;
  text-align: center !important;
  color: #6b7280;
  font-size: 18px;
}

.ziwei-workspace {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.ziwei-form {
  background: transparent;
}

.ziwei-form .form-section {
  margin-bottom: 34px;
}

.ziwei-form .form-section h2 {
  margin: 0 0 24px;
  font-size: 22px;
  color: #4b5563;
}

.ziwei-form .basic-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ziwei-form .basic-grid .field:first-child,
.ziwei-form .basic-grid .field:last-child {
  max-width: none;
}

.ziwei-time-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.ziwei-calendar-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 350px;
  max-width: 100%;
  height: 42px;
  padding: 4px;
  margin: 12px 0 10px;
  border-radius: 10px;
}

.ziwei-date-input {
  width: 350px;
  max-width: 100%;
  height: 46px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.ziwei-form .time-select-row {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: none;
}

.ziwei-place-field {
  margin-top: 22px;
}

.ziwei-submit {
  width: 100%;
  height: 46px;
  border-radius: 7px;
  background: #171717;
  font-weight: 700;
}



.ziwei-result {
  margin-top: 28px;
}

.ziwei-result-card {
  display: grid;
  gap: 18px;
}

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

.ziwei-summary-grid > div,
.ziwei-palace-card,
.ziwei-analysis-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.ziwei-summary-grid > div {
  padding: 14px 16px;
}

.ziwei-analysis-card {
  padding: 20px;
}

.ziwei-analysis-card h3 {
  margin: 0 0 14px;
  color: #111827;
  font-size: 20px;
  line-height: 1.3;
}

.ziwei-analysis-sections {
  display: grid;
  gap: 14px;
}

.ziwei-text-section {
  padding: 18px 20px;
  border: 1px solid #b9dfc6;
  border-radius: 8px;
  background: #f8fffb;
}

.ziwei-text-section h4 {
  margin: 0 0 12px;
  color: #111827;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 800;
}

.ziwei-text-section .analysis-content p {
  margin: 0 0 10px;
}

.ziwei-text-section .analysis-content p:last-child {
  margin-bottom: 0;
}
.bazi-analysis-sections {
  display: grid;
  gap: 14px;
}
.bazi-text-section {
  padding: 18px 20px;
  border: 1px solid #b9dfc6;
  border-radius: 8px;
  background: #f8fffb;
}
.bazi-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}
.bazi-section-head h4 {
  margin: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 800;
}
.bazi-text-section .analysis-content p {
  margin: 0 0 10px;
}
.bazi-text-section .analysis-content p:last-child {
  margin-bottom: 0;
}

.analysis-module-card {
  padding: 24px 28px;
  border: 1px solid #d9e5dc;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(33, 37, 41, 0.06);
}

.analysis-module-card + .analysis-module-card {
  margin-top: 16px;
}

.analysis-module-card h4 {
  margin: 0 0 12px;
  color: #020617;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 800;
}

.analysis-module-card .analysis-content {
  color: #111827;
  font-size: 15px;
  line-height: 1.75;
}

.analysis-module-card .analysis-content p {
  margin: 0 0 10px;
}

.analysis-module-card .analysis-content p:last-child {
  margin-bottom: 0;
}
.analysis-prose-card {
  padding: 24px 28px;
  border: 1px solid #d9e5dc;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(33, 37, 41, 0.06);
}
.analysis-prose-card .analysis-content {
  color: #111827;
  font-size: 15px;
  line-height: 1.8;
}
.analysis-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 10px;
}
.analysis-inline-head:first-child {
  margin-top: 0;
}
.analysis-inline-head h4 {
  margin: 0;
  color: #020617;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 800;
}
.analysis-prose-card .analysis-content p {
  margin: 0 0 10px;
}
.analysis-prose-card .analysis-content > h4 {
  margin: 18px 0 8px;
  color: #111827;
  font-size: 18px;
  line-height: 1.4;
  font-weight: 800;
}
.analysis-text-version {
  white-space: pre-wrap;
  line-height: 1.7;
  color: #111827;
  font-size: 15px;
}

.analysis-text-version h2,
.analysis-text-version h3,
.analysis-text-version h4 {
  margin: 18px 0 10px;
  line-height: 1.35;
}

.analysis-text-version table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

.analysis-text-version th,
.analysis-text-version td {
  border: 1px solid #d7e4db;
  padding: 8px 10px;
  vertical-align: top;
}

.analysis-text-version p {
  margin: 0 0 10px;
}
.ziwei-summary-grid span {
  display: block;
  margin-bottom: 6px;
  color: #6b7280;
  font-size: 13px;
}

.ziwei-summary-grid strong {
  color: #111827;
  font-size: 15px;
}

.ziwei-palace-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(128px, auto));
  position: relative;
  gap: 10px;
}

.ziwei-palace-center {
  grid-row: 2 / span 2;
  grid-column: 2 / span 2;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 100%;
  padding: 18px;
  text-align: center;
  color: #111827;
  background: #f8fafc;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
}

.ziwei-palace-center strong {
  font-size: 16px;
}

.ziwei-palace-center span {
  color: #6b7280;
  font-size: 13px;
}

.ziwei-palace-card {
  position: relative;
  min-height: 128px;
  padding: 14px;
  overflow: hidden;
}





.ziwei-palace-stars {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 48px;
  bottom: 48px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-content: start;
  justify-content: start;
  gap: 0 6px;
  overflow: hidden;
}

.ziwei-palace-body-flag {
  color: #dc2626;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  margin-bottom: 3px;
}

.ziwei-palace-star {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  color: #111827;
  font-size: 11px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: 0;
}

.ziwei-palace-star-minor {
  color: #4b5563;
  font-weight: 500;
  font-size: 11px;
}

.ziwei-star-name {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.ziwei-star-name > span,
.ziwei-vertical-text > span {
  display: block;
}

.ziwei-star-level {
  display: block;
  margin-top: 1px;
  color: #6b7280;
  font-size: 10px;
  line-height: 1;
  font-weight: 600;
}

.ziwei-star-badge {
  display: inline-flex;
  align-items: center;
  min-height: 15px;
  padding: 0 4px;
  margin: 1px 0 0;
  border-radius: 4px;
  background: #86cfa3;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}





.ziwei-palace-legend {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 5px;
  max-width: calc(100% - 16px);
}

.ziwei-palace-flag-wrap {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  justify-self: center;
  min-height: 26px;
}

.ziwei-palace-flag {
  display: flex;
  gap: 2px;
  color: #dc2626;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
}

.ziwei-palace-name-wrap {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
}

.ziwei-palace-name {
  color: #111827;
  font-size: 17px;
  line-height: 1.15;
  font-weight: 800;
  white-space: nowrap;
}

.ziwei-vertical-text {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
}

.ziwei-palace-branch-wrap {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  justify-self: center;
}

.ziwei-palace-branch {
  color: #6b7280;
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
}

.ziwei-palace-branch-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.ziwei-palace-ming-flag {
  color: #dc2626;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
}

.ziwei-palace-flags-inline {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.2;
}

.ziwei-star-badge-?,
.ziwei-star-badge-?,
.ziwei-star-badge-?,
.ziwei-star-badge-? {
  background: #86cfa3;
}

@media (max-width: 900px) {
  .ziwei-title h1 { font-size: 32px; }
  .ziwei-title .page-desc { font-size: 15px; }
  .ziwei-time-grid,
  .ziwei-summary-grid,
  .ziwei-palace-grid {
    grid-template-columns: 1fr;
  }
  .ziwei-palace-card,
  .ziwei-palace-center {
    grid-row: auto !important;
    grid-column: auto !important;
  }
  .ziwei-form .basic-grid {
    grid-template-columns: 1fr;
  }
}

#ziwei-hehun-page .calendar-switch {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  width: 100% !important;
  max-width: 438px !important;
  height: 54px !important;
  padding: 5px !important;
  margin: 8px 0 10px !important;
  border-radius: 12px !important;
  background: #f3f3f3 !important;
}

#ziwei-hehun-page .calendar-switch label {
  display: grid !important;
  place-items: center !important;
  border-radius: 9px !important;
  color: #6b7280 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#ziwei-hehun-page .calendar-switch label.is-selected,
#ziwei-hehun-page .calendar-switch label:has(input:checked) {
  color: #050505 !important;
  background: #fff !important;
  box-shadow: 0 1px 5px rgba(15, 23, 42, 0.1) !important;
}

#ziwei-hehun-page .date-trigger {
  width: 100% !important;
  max-width: 438px !important;
  height: 56px !important;
  min-height: 56px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  cursor: pointer !important;
}

#ziwei-hehun-page .date-trigger-icon {
  pointer-events: none;
  flex: 0 0 auto;
}

.liuyao-text-plain {
  display: block;
  padding: 4px 0;
}

.liuyao-text-line {
  margin: 0 0 12px;
  color: #2f2a25;
  font-size: 16px;
  line-height: 1.9;
}

.liuyao-text-heading {
  margin-top: 18px;
  margin-bottom: 8px;
  color: #15110d;
  font-size: 18px;
}

.liuyao-text-heading:first-child {
  margin-top: 0;
}


.liuyao-gua-section {
  margin: 0 0 28px;
}

.liuyao-gua-section h2 {
  margin: 0 0 18px;
  color: #111827;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
}

.liuyao-gua-intro {
  margin: 0 0 14px;
  color: #374151;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.8;
}

.liuyao-gua-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 12px 0 22px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.liuyao-gua-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  table-layout: fixed;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.8;
}

.liuyao-gua-table th,
.liuyao-gua-table td {
  border: 1px solid #e5e7eb;
  padding: 12px 14px;
  vertical-align: middle;
}

.liuyao-gua-table th {
  background: #f5f6f8;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.liuyao-gua-table th:nth-child(1),
.liuyao-gua-table td:nth-child(1) {
  width: 76px;
  text-align: center;
  font-weight: 800;
}

.liuyao-gua-table th:nth-child(2),
.liuyao-gua-table td:nth-child(2) {
  width: 120px;
  color: #6b6259;
}

.liuyao-gua-table th:nth-child(3),
.liuyao-gua-table td:nth-child(3),
.liuyao-gua-table th:nth-child(4),
.liuyao-gua-table td:nth-child(4) {
  width: calc((100% - 196px) / 2);
}

.liuyao-gua-table .liuyao-red {
  color: #d11f1f;
  font-weight: 800;
}

@media (max-width: 720px) {
  .liuyao-analysis-paper {
    padding: 24px 16px 32px;
  }

  .liuyao-gua-table {
    min-width: 680px;
    font-size: 16px;
  }

  .liuyao-gua-table th,
  .liuyao-gua-table td {
    padding: 9px 12px;
  }
}
  order: 1;
  order: 3;
.account-fab {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 40;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  background: #111827;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.account-entry-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 16px;
  border: 1px solid #e7ddd2;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}
.account-entry-btn:hover { background: #faf7f2; }
.account-entry-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #444;
}

.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.55);
  padding: 16px;
}
.auth-card {
  position: relative;
  width: min(460px, calc(100vw - 32px));
  background: #fff;
  border-radius: 12px;
  padding: 24px 22px 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}
.auth-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: #666;
  cursor: pointer;
}
.auth-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  text-align: center;
}
.auth-subtitle {
  margin: 0 0 18px;
  text-align: center;
  color: #666;
}
.auth-status {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8f5ef;
  color: #7c2d12;
}
.auth-form {
  display: grid;
  gap: 10px;
}
.auth-form label {
  font-size: 14px;
  font-weight: 700;
}
.auth-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d8d3cc;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
}
.auth-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.auth-primary-btn, .auth-secondary-btn {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  border: 1px solid #d8d3cc;
  cursor: pointer;
  font-weight: 700;
}
.auth-primary-btn {
  flex: 1;
  background: #111;
  color: #fff;
  border-color: #111;
}
.auth-secondary-btn {
  background: #fff;
  color: #111;
}
.account-panel {
  margin-top: 16px;
  border-top: 1px solid #eee;
  padding-top: 16px;
}
.account-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.account-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f3eee7;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.account-head span {
  display: block;
  color: #666;
  font-size: 13px;
}
.account-meta {
  display: grid;
  gap: 8px;
  margin: 0;
}
.account-meta > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #f0ece6;
}
.account-meta dt {
  color: #666;
}
.account-meta dd {
  margin: 0;
  font-weight: 700;
}
.account-actions-panel {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
@media (max-width: 720px) {
  .auth-card { width: min(100vw - 24px, 420px); padding: 20px 16px 16px; }
  .auth-actions, .account-actions-panel { flex-direction: column; }
  .account-entry-btn { min-height: 50px; }
}
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.45);
  z-index: 50;
}
.hidden { display: none !important; }
.modal-card {
  width: min(760px, calc(100vw - 32px));
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}
.auth-modal-card { max-height: calc(100vh - 32px); overflow: auto; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tab {
  border: 1px solid #e7ddd2;
  background: #fff;
  border-radius: 6px;
  padding: 8px 12px;
}
.auth-tab.is-active { background: #111; color: #fff; }
.auth-panels { display: grid; gap: 12px; }
.auth-panel {
  padding: 0;
  border: 0;
  box-shadow: none;
}
.account-grid, .admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.admin-list { margin-top: 16px; display: grid; gap: 8px; }
.admin-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #e7ddd2;
  border-radius: 6px;
}

.analysis-module-head,
.ziwei-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.analysis-module-head h4,
.ziwei-section-head h4 {
  margin: 0;
}
.ai-analysis-btn {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.ai-analysis-btn:hover {
  background: #2a2a2a;
}
.ai-analysis-btn:disabled {
  background: #999;
  cursor: wait;
}
@media (max-width: 720px) {
  .analysis-module-head,
  .ziwei-section-head {
    align-items: stretch;
    flex-direction: column;
  }
  .ai-analysis-btn {
    width: 100%;
  }
}
