* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: linear-gradient(
    160deg,
    #0e0a08 0%,
    #1c1208 40%,
    #120e0a 70%,
    #0e0a06 100%
  );
  color: #e8e0d0;
  min-height: 100vh;
}

.app_container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  text-align: center;
  padding: 40px 0 30px;
}

.header .title {
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, #f0c27f, #fc5c7d, #f0c27f);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.header .subtitle {
  margin-top: 10px;
  font-size: 14px;
  color: #9a8868;
  letter-spacing: 4px;
}

.input_section {
  background: rgba(255, 240, 210, 0.05);
  border: 1px solid rgba(255, 220, 160, 0.12);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
}

.input_section .section_title {
  font-size: 18px;
  color: #f0c27f;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form_grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form_group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form_group label {
  font-size: 13px;
  color: #a89878;
  font-weight: 500;
}

.form_group input,
.form_group select {
  background: rgba(255, 235, 190, 0.07);
  border: 1px solid rgba(255, 215, 140, 0.18);
  border-radius: 10px;
  padding: 12px 16px;
  color: #e8e0d0;
  font-size: 15px;
  outline: none;
  transition:
    border-color 0.3s,
    box-shadow 0.3s;
}

.form_group input:focus,
.form_group select:focus {
  border-color: #f0c27f;
  box-shadow: 0 0 0 3px rgba(240, 194, 127, 0.15);
}

.form_group select option {
  background: #1c1208;
  color: #e8e0d0;
}

.submit_compare_row {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 20px;
}

.submit_compare_row .submit_btn {
  flex: 1;
  min-width: 0;
  width: auto;
  margin-top: 0;
}

.submit_compare_row .compare_switch_label {
  align-self: center;
}

.submit_btn {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #f0c27f, #fc5c7d);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  letter-spacing: 2px;
}

.submit_btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(252, 92, 125, 0.3);
}

.submit_btn:active {
  transform: translateY(0);
}

.compare_switch_label {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(255, 235, 190, 0.04);
  border: 1px solid rgba(255, 215, 140, 0.1);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: #a89878;
  font-weight: 500;
  white-space: nowrap;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.compare_switch_label:hover {
  border-color: rgba(240, 194, 127, 0.28);
  background: rgba(255, 235, 190, 0.06);
}

.compare_switch_label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #f0c27f;
  cursor: pointer;
  flex-shrink: 0;
}

.screenshot_btn {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #f0c27f;
  background: rgba(240, 194, 127, 0.1);
  border: 1px solid rgba(240, 194, 127, 0.35);
  border-radius: 12px;
  cursor: pointer;
  transition:
    transform 0.2s,
    background 0.2s,
    border-color 0.2s;
  letter-spacing: 1px;
}

.screenshot_btn:hover:not(:disabled) {
  background: rgba(240, 194, 127, 0.16);
  border-color: rgba(240, 194, 127, 0.5);
  transform: translateY(-1px);
}

.screenshot_btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.analyze_total_time_note {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: #8a7a60;
  line-height: 1.55;
  letter-spacing: 0.3px;
  min-height: 1.55em;
}

.analyze_total_time_note:empty {
  display: none;
}

.result_section {
  display: none;
  animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result_section.visible {
  display: block;
}

.panel {
  background: rgba(255, 240, 210, 0.05);
  border: 1px solid rgba(255, 220, 160, 0.12);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.panel .panel_title {
  font-size: 18px;
  color: #f0c27f;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.pillar {
  text-align: center;
  background: rgba(255, 235, 190, 0.05);
  border: 1px solid rgba(255, 215, 140, 0.1);
  border-radius: 12px;
  padding: 16px 8px;
  transition: transform 0.2s;
}

.pillar:hover {
  transform: translateY(-4px);
}

.pillar .pillar_label {
  font-size: 12px;
  color: #9a8868;
  margin-bottom: 10px;
}

.pillar .stem {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}

.pillar .branch {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 4px;
}

.pillar .nayin {
  font-size: 11px;
  color: #9a8868;
  margin-top: 8px;
}

.pillar .element_tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 6px;
}

.element_wood {
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.element_fire {
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}
.element_earth {
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.element_metal {
  color: #e2e8f0;
  border: 1px solid rgba(226, 232, 240, 0.3);
}
.element_water {
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.c_wood {
  color: #4ade80;
}
.c_fire {
  color: #f87171;
}
.c_earth {
  color: #fbbf24;
}
.c_metal {
  color: #e2e8f0;
}
.c_water {
  color: #60a5fa;
}

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

.info_item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 235, 190, 0.04);
  border-radius: 8px;
}

.info_item .label {
  font-size: 13px;
  color: #9a8868;
}

.info_item .value {
  font-size: 14px;
  font-weight: 600;
  color: #f0c27f;
}

.wuxing_bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.wuxing_bar_item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wuxing_bar_item .bar_label {
  width: 40px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

.wuxing_bar_item .bar_track {
  flex: 1;
  height: 24px;
  background: rgba(255, 235, 190, 0.06);
  border-radius: 12px;
  overflow: hidden;
}

.wuxing_bar_item .bar_fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 12px;
  font-weight: 600;
  min-width: 30px;
}

.bar_wood {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}
.bar_fire {
  background: linear-gradient(90deg, #ef4444, #f87171);
}
.bar_earth {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}
.bar_metal {
  background: linear-gradient(90deg, #94a3b8, #e2e8f0);
  color: #333;
}
.bar_water {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

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

.shishen_item {
  text-align: center;
  padding: 12px 6px;
  background: rgba(255, 235, 190, 0.05);
  border-radius: 10px;
}

.shishen_item .position_label {
  font-size: 11px;
  color: #9a8868;
  margin-bottom: 4px;
}

.shishen_item .shishen_name {
  font-size: 15px;
  font-weight: 600;
  color: #e8e0d0;
}

.dayun_list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.dayun_item {
  flex-shrink: 0;
  text-align: center;
  padding: 12px 10px;
  background: rgba(255, 235, 190, 0.05);
  border: 1px solid rgba(255, 215, 140, 0.1);
  border-radius: 10px;
  min-width: 62px;
}

.dayun_item .age_label {
  font-size: 11px;
  color: #9a8868;
  margin-bottom: 6px;
}

.dayun_item .dayun_gz {
  font-size: 16px;
  font-weight: 600;
}

.lunar_info {
  text-align: center;
  padding: 12px;
  margin-bottom: 20px;
  background: rgba(255, 235, 190, 0.04);
  border-radius: 10px;
  font-size: 14px;
  color: #c8b888;
  line-height: 1.8;
}

.lunar_info .highlight {
  color: #f0c27f;
  font-weight: 600;
}

.detail_grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.detail_item {
  padding: 10px 14px;
  background: rgba(255, 235, 190, 0.04);
  border-radius: 8px;
  font-size: 13px;
}

.detail_item .d_label {
  color: #9a8868;
  margin-bottom: 4px;
}

.detail_item .d_value {
  color: #e8e0d0;
  font-weight: 500;
}

.footer {
  text-align: center;
  padding: 30px 0;
  font-size: 12px;
  color: #6b5a3a;
}

.book_select_wrap {
  margin-top: 16px;
}

.book_select_label {
  font-size: 13px;
  color: #aaaacc;
  margin-bottom: 10px;
}

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

.book_toggle {
  flex: 1;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  background: rgba(255, 235, 190, 0.04);
  border: 1px solid rgba(255, 215, 140, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.book_toggle input[type="checkbox"] {
  display: none;
}

.book_toggle .book_name {
  font-size: 14px;
  font-weight: 600;
  color: #8888aa;
  transition: color 0.2s;
}

.book_toggle .book_desc {
  font-size: 11px;
  color: #555577;
  transition: color 0.2s;
}

.book_toggle.active {
  background: rgba(240, 194, 127, 0.12);
  border-color: rgba(240, 194, 127, 0.5);
}

.book_toggle.active .book_name {
  color: #f0c27f;
}

.book_toggle.active .book_desc {
  color: #aaaacc;
}

.book_toggle:hover {
  border-color: rgba(240, 194, 127, 0.3);
}

.pillar .hide_gan_row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pillar .hide_gan_tag {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.4;
  gap: 1px;
}

.pillar .hide_gan_tag .hg_gan {
  font-size: 13px;
  font-weight: 700;
}

.pillar .hide_gan_tag .hg_shen {
  font-size: 10px;
  color: #8888aa;
}

.pillar.pillar_month {
  border-color: rgba(240, 194, 127, 0.25);
  background: rgba(240, 194, 127, 0.04);
}

.pillar.pillar_month .hide_gan_row {
  border-top-color: rgba(240, 194, 127, 0.15);
}

.hide_gan_panel {
  margin-top: 20px;
}

.hide_gan_panel .panel_subtitle {
  font-size: 12px;
  color: #8888aa;
  margin-bottom: 14px;
  letter-spacing: 1px;
}

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

.hg_pillar_card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}

.hg_pillar_card.is_month {
  border-color: rgba(240, 194, 127, 0.3);
  background: rgba(240, 194, 127, 0.04);
}

.hg_pillar_card .hg_label {
  font-size: 11px;
  color: #8888aa;
  margin-bottom: 4px;
}

.hg_pillar_card.is_month .hg_label {
  color: #f0c27f;
}

.hg_pillar_card .hg_zhi {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.hg_pillar_card .hg_items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hg_pillar_card .hg_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.hg_pillar_card .hg_item .hg_item_gan {
  font-size: 14px;
  font-weight: 700;
}

.hg_pillar_card .hg_item .hg_item_shen {
  font-size: 11px;
  color: #aaaacc;
}

.hg_pillar_card .hg_item .hg_item_order {
  font-size: 10px;
  color: #666688;
}

@media (max-width: 600px) {
  .submit_compare_row {
    flex-direction: column;
    align-items: stretch;
  }

  .submit_compare_row .compare_switch_label {
    justify-content: center;
  }

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

  .pillars_grid {
    gap: 8px;
  }

  .pillar .stem,
  .pillar .branch {
    font-size: 24px;
  }

  .info_grid,
  .detail_grid,
  .hide_gan_grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ai_panel {
  background: rgba(255, 235, 180, 0.04);
  border: 1px solid rgba(240, 194, 127, 0.18);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.ai_panel .panel_title {
  font-size: 18px;
  color: #f0c27f;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai_loading {
  text-align: center;
  padding: 40px 0;
  color: #8888aa;
  font-size: 14px;
}

.ai_loading_visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.ai_loading_visual .spinner {
  margin: 0 auto;
}

.ai_fake_progress_wrap {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding: 0 8px;
}

.ai_fake_progress_row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: #9a8868;
}

.ai_fake_progress_percent {
  font-size: 15px;
  font-weight: 700;
  color: #f0c27f;
  letter-spacing: 0.5px;
  text-shadow: 0 0 12px rgba(240, 194, 127, 0.2);
}

.ai_fake_progress_track {
  height: 10px;
  border-radius: 999px;
  background: rgba(240, 194, 127, 0.1);
  border: 1px solid rgba(240, 194, 127, 0.18);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ai_fake_progress_fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #c49a4e 0%,
    #f0c27f 40%,
    #fc5c7d 100%
  );
  box-shadow: 0 0 12px rgba(240, 194, 127, 0.35);
  will-change: width;
}

.ai_fake_progress_note {
  margin-top: 10px;
  font-size: 11px;
  color: #5c4d6a;
  letter-spacing: 0.5px;
}

.ai_loading .loading_dots {
  display: inline-block;
  animation: dots 1.4s infinite;
}

@keyframes dots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%,
  100% {
    content: "...";
  }
}

.ai_loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(240, 194, 127, 0.2);
  border-top-color: #f0c27f;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.ai_overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

/* 用神（金黄·吉） */
.ai_overview_item {
  padding: 14px 16px;
  background: rgba(255, 235, 190, 0.05);
  border-radius: 10px;
  border-left: 3px solid rgba(240, 194, 127, 0.4);
}

.ai_overview_item.item_yongshen {
  background: rgba(251, 191, 36, 0.07);
  border-left-color: rgba(251, 191, 36, 0.6);
}

.ai_overview_item.item_yongshen .ov_value {
  color: #fbbf24;
}

/* 忌神（黑白灰·凶） */
.ai_overview_item.item_jishen {
  background: rgba(20, 20, 20, 0.45);
  border-left-color: rgba(160, 160, 160, 0.45);
}

.ai_overview_item.item_jishen .ov_value {
  color: #cccccc;
}

.ai_overview_item .ov_label {
  font-size: 12px;
  color: #9a8868;
  margin-bottom: 6px;
}

.ai_overview_item .ov_value {
  font-size: 15px;
  font-weight: 600;
  color: #e8e0d0;
}

.ai_tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.ai_tag {
  padding: 5px 14px;
  background: rgba(240, 194, 127, 0.1);
  border: 1px solid rgba(240, 194, 127, 0.25);
  border-radius: 20px;
  font-size: 13px;
  color: #f0c27f;
}

.ai_cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

/* 事业（翠绿·生机） */
.ai_card.card_career {
  background: rgba(21, 128, 61, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.ai_card.card_career .card_title {
  color: #4ade80;
}

/* 婚姻（中国红·喜） */
.ai_card.card_romance {
  background: rgba(153, 27, 27, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

.ai_card.card_romance .card_title {
  color: #f87171;
}

/* 财运（金黄·富贵） */
.ai_card.card_wealth {
  background: rgba(120, 53, 15, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.28);
}

.ai_card.card_wealth .card_title {
  color: #fbbf24;
}

/* 健康（青灰·平稳提醒） */
.ai_card.card_health {
  background: rgba(30, 41, 59, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.ai_card.card_health .card_title {
  color: #94a3b8;
}

.ai_card {
  padding: 16px;
  background: rgba(255, 235, 190, 0.04);
  border: 1px solid rgba(255, 215, 140, 0.1);
  border-radius: 12px;
}

.ai_card .card_title {
  font-size: 12px;
  color: #8888aa;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai_card .card_content {
  font-size: 14px;
  color: #d0c8b8;
  line-height: 1.7;
}

/* 幸运元素（金色·吉祥） */
.ai_lucky {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.ai_lucky_item {
  flex: 1;
  min-width: 120px;
  padding: 12px 16px;
  background: rgba(120, 53, 15, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  text-align: center;
}

.ai_lucky_item .lucky_label {
  font-size: 12px;
  color: #9a8050;
  margin-bottom: 8px;
}

.ai_lucky_item .lucky_value {
  font-size: 14px;
  color: #fbbf24;
  font-weight: 600;
}

/* 综合建议（翠绿·正向） */
.ai_advice {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.ai_advice li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(30, 80, 40, 0.12);
  border: 1px solid rgba(74, 180, 100, 0.18);
  border-radius: 8px;
  font-size: 14px;
  color: #d0c8b8;
  line-height: 1.6;
}

.ai_advice li::before {
  content: "◆";
  color: #4ade80;
  font-size: 10px;
  margin-top: 4px;
  flex-shrink: 0;
}

/* 古籍引用（书卷金） */
.ai_quote {
  padding: 16px 20px;
  background: rgba(120, 53, 15, 0.08);
  border-left: 3px solid rgba(251, 191, 36, 0.5);
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #c8b888;
  line-height: 1.8;
  font-style: italic;
}

.ai_source_badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 12px;
}

.ai_error {
  text-align: center;
  padding: 24px;
  color: #f87171;
  font-size: 14px;
}

.model_result_block {
  margin-bottom: 32px;
}

.model_result_block:last-child {
  margin-bottom: 0;
}

.model_label_badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #c8a8f0;
  background: rgba(200, 168, 240, 0.1);
  border: 1px solid rgba(200, 168, 240, 0.3);
  border-radius: 6px;
  padding: 4px 12px;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.model_label_badge::before {
  content: "◈";
  font-size: 10px;
}

.model_divider {
  border: none;
  border-top: 1px solid rgba(255, 215, 140, 0.1);
  margin: 28px 0;
}

.model_error_block {
  padding: 16px 20px;
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: 10px;
  color: #f87171;
  font-size: 13px;
  margin-bottom: 32px;
}

.model_error_block .model_label_badge {
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.25);
  margin-bottom: 8px;
}

.ai_verdict {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.ai_verdict_item {
  padding: 14px 12px;
  background: rgba(255, 235, 190, 0.05);
  border-radius: 10px;
  border-left: 3px solid rgba(240, 194, 127, 0.4);
}

.ai_verdict_item .ov_label {
  font-size: 11px;
  color: #9a8868;
  margin-bottom: 6px;
}

.ai_verdict_item .ov_value {
  font-size: 14px;
  font-weight: 600;
  color: #e8e0d0;
  line-height: 1.5;
}

/* 命局层次：上（大红喜气）/ 中（金黄平稳）/ 下（暗灰示警） */
.ai_verdict_item.highlight_tier {
  border-left-color: rgba(200, 168, 240, 0.6);
  background: rgba(200, 168, 240, 0.06);
}

.ai_verdict_item.highlight_tier .ov_value {
  color: #c8a8f0;
}

.ai_verdict_item.tier_shang {
  background: rgba(153, 27, 27, 0.1);
  border-left-color: rgba(220, 38, 38, 0.7);
}

.ai_verdict_item.tier_shang .ov_value {
  color: #f87171;
  text-shadow: 0 0 12px rgba(220, 38, 38, 0.4);
}

.ai_verdict_item.tier_zhong {
  background: rgba(120, 53, 15, 0.1);
  border-left-color: rgba(251, 191, 36, 0.6);
}

.ai_verdict_item.tier_zhong .ov_value {
  color: #fbbf24;
}

.ai_verdict_item.tier_xia {
  background: rgba(20, 20, 20, 0.5);
  border-left-color: rgba(180, 180, 180, 0.5);
}

.ai_verdict_item.tier_xia .ov_value {
  color: #cccccc;
}

.ai_yinzheng {
  padding: 14px 16px;
  background: rgba(96, 165, 250, 0.05);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 10px;
  margin-bottom: 20px;
}

.ai_yinzheng .yz_title {
  font-size: 12px;
  color: #60a5fa;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai_yinzheng .yz_content {
  font-size: 14px;
  color: #d0c8b8;
  line-height: 1.7;
}

.ai_zpzq_refined {
  padding: 14px 16px;
  background: rgba(251, 191, 36, 0.04);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 10px;
  margin-bottom: 20px;
}

.ai_zpzq_refined .zr_title {
  font-size: 12px;
  color: #fbbf24;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai_zpzq_refined .zr_grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.ai_zpzq_refined .zr_item {
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.ai_zpzq_refined .zr_item .zr_label {
  font-size: 10px;
  color: #8888aa;
  margin-bottom: 3px;
}

.ai_zpzq_refined .zr_item .zr_value {
  font-size: 13px;
  color: #e8e0d0;
  font-weight: 500;
}

.ai_zpzq_refined .zr_quote {
  padding: 10px 12px;
  background: rgba(251, 191, 36, 0.06);
  border-left: 2px solid rgba(251, 191, 36, 0.4);
  border-radius: 0 6px 6px 0;
  font-size: 12px;
  color: #aaaacc;
  line-height: 1.7;
  font-style: italic;
}

.ai_timing_grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.ai_timing_card {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid;
}

/* 近期机遇（中国红·喜事） */
.ai_timing_card.good {
  background: rgba(153, 27, 27, 0.08);
  border-color: rgba(220, 38, 38, 0.3);
}

/* 近期留意（黑白灰·示警） */
.ai_timing_card.caution {
  background: rgba(20, 20, 20, 0.5);
  border-color: rgba(160, 160, 160, 0.3);
}

.ai_timing_card .card_title {
  font-size: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai_timing_card.good .card_title {
  color: #f87171;
}
.ai_timing_card.caution .card_title {
  color: #cccccc;
}

.ai_timing_card .card_content {
  font-size: 14px;
  color: #d0c8b8;
  line-height: 1.7;
}

.ai_timing_card.caution .card_content {
  color: #c8c8c8;
}

.ai_romance_grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

/* 姻缘（中国红·喜事） */
.ai_romance_card {
  padding: 16px;
  background: rgba(153, 27, 27, 0.07);
  border: 1px solid rgba(220, 38, 38, 0.22);
  border-radius: 12px;
}

.ai_romance_card .card_title {
  font-size: 12px;
  color: #f87171;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai_romance_card .card_content {
  font-size: 14px;
  color: #d0c8b8;
  line-height: 1.7;
}

.ai_disclaimer {
  margin-top: 20px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  font-size: 11px;
  color: #555577;
  line-height: 1.7;
  text-align: center;
}

.ai_unlock_overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 8, 6, 0.82);
  backdrop-filter: blur(6px);
}

.ai_unlock_dialog {
  width: 100%;
  max-width: 360px;
  padding: 28px 24px;
  background: linear-gradient(
    165deg,
    rgba(30, 22, 14, 0.98),
    rgba(18, 12, 8, 0.99)
  );
  border: 1px solid rgba(240, 194, 127, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.ai_unlock_dialog .unlock_title {
  font-size: 16px;
  font-weight: 600;
  color: #f0c27f;
  margin-bottom: 10px;
  text-align: center;
}

.ai_unlock_dialog .unlock_hint {
  font-size: 12px;
  color: #9a8868;
  line-height: 1.6;
  margin-bottom: 16px;
  text-align: center;
}

.ai_unlock_dialog input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: rgba(255, 235, 190, 0.07);
  border: 1px solid rgba(255, 215, 140, 0.2);
  border-radius: 10px;
  color: #e8e0d0;
  font-size: 16px;
  letter-spacing: 2px;
  outline: none;
  box-sizing: border-box;
}

.ai_unlock_dialog input:focus {
  border-color: #f0c27f;
  box-shadow: 0 0 0 2px rgba(240, 194, 127, 0.15);
}

.ai_unlock_dialog .unlock_actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.ai_unlock_dialog .unlock_btn {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 1px;
}

.ai_unlock_dialog .unlock_btn_primary {
  color: #1a1208;
  background: linear-gradient(135deg, #f0c27f, #e8a860);
}

.ai_unlock_dialog .unlock_btn_secondary {
  color: #c8b898;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 215, 140, 0.15);
}

.ai_unlock_dialog .unlock_err {
  min-height: 20px;
  margin-top: 10px;
  font-size: 12px;
  color: #f87171;
  text-align: center;
}

@media (max-width: 600px) {
  .ai_overview,
  .ai_verdict,
  .ai_cards,
  .ai_zpzq_refined .zr_grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   登录状态栏 / 登录弹窗 / 历史记录弹窗 / Toast
   ═══════════════════════════════════════════════════════════════ */

/* ── 右上角登录栏 ──────────────────────────────────────────── */

.auth_bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 12px 0 0;
}

.auth_login_btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #f0c27f;
  background: rgba(240, 194, 127, 0.1);
  border: 1px solid rgba(240, 194, 127, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.auth_login_btn:hover {
  background: rgba(240, 194, 127, 0.18);
  border-color: rgba(240, 194, 127, 0.5);
}

.auth_user_info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth_user_id {
  font-size: 13px;
  color: #c8b888;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth_history_btn,
.auth_logout_btn {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  border: 1px solid;
}

.auth_history_btn {
  color: #f0c27f;
  background: rgba(240, 194, 127, 0.1);
  border-color: rgba(240, 194, 127, 0.3);
}

.auth_history_btn:hover {
  background: rgba(240, 194, 127, 0.18);
}

.auth_logout_btn {
  color: #8888aa;
  background: rgba(136, 136, 170, 0.08);
  border-color: rgba(136, 136, 170, 0.2);
}

.auth_logout_btn:hover {
  background: rgba(136, 136, 170, 0.15);
}

/* ── 登录弹窗 ──────────────────────────────────────────────── */

.auth_login_overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 8, 6, 0.82);
  backdrop-filter: blur(6px);
}

.auth_login_dialog {
  width: 100%;
  max-width: 380px;
  padding: 28px 24px;
  background: linear-gradient(165deg, rgba(30, 22, 14, 0.98), rgba(18, 12, 8, 0.99));
  border: 1px solid rgba(240, 194, 127, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.auth_login_dialog .login_title {
  font-size: 18px;
  font-weight: 600;
  color: #f0c27f;
  margin-bottom: 8px;
  text-align: center;
}

.auth_login_dialog .login_hint {
  font-size: 12px;
  color: #9a8868;
  line-height: 1.6;
  margin-bottom: 18px;
  text-align: center;
}

.auth_login_dialog input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: rgba(255, 235, 190, 0.07);
  border: 1px solid rgba(255, 215, 140, 0.2);
  border-radius: 10px;
  color: #e8e0d0;
  font-size: 15px;
  outline: none;
  box-sizing: border-box;
}

.auth_login_dialog input:focus {
  border-color: #f0c27f;
  box-shadow: 0 0 0 2px rgba(240, 194, 127, 0.15);
}

.auth_login_dialog .login_actions {
  display: flex;
  gap: 10px;
}

.auth_login_dialog .login_btn {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 1px;
}

.auth_login_dialog .login_btn_primary {
  color: #1a1208;
  background: linear-gradient(135deg, #f0c27f, #e8a860);
}

.auth_login_dialog .login_btn_primary:hover {
  filter: brightness(1.08);
}

.auth_login_dialog .login_btn_secondary {
  color: #c8b898;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 215, 140, 0.15);
}

.auth_login_dialog .login_btn_primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none;
}

.auth_login_dialog .login_toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
  font-size: 12px;
  color: #8888aa;
}

.auth_login_dialog .login_toggle_btn {
  background: none;
  border: none;
  color: #f0c27f;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.auth_login_dialog .login_toggle_btn:hover {
  color: #fbbf24;
}

.auth_login_dialog .login_err {
  min-height: 18px;
  margin-top: 10px;
  font-size: 12px;
  color: #f87171;
  text-align: center;
}

/* ── 历史记录弹窗 ──────────────────────────────────────────── */

.history_overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 8, 6, 0.82);
  backdrop-filter: blur(6px);
}

.history_dialog {
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, rgba(30, 22, 14, 0.98), rgba(18, 12, 8, 0.99));
  border: 1px solid rgba(240, 194, 127, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.history_header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(240, 194, 127, 0.15);
  flex-shrink: 0;
}

.history_title {
  font-size: 16px;
  font-weight: 600;
  color: #f0c27f;
}

.history_close_btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #8888aa;
  background: rgba(136, 136, 170, 0.08);
  border: 1px solid rgba(136, 136, 170, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.history_close_btn:hover {
  background: rgba(136, 136, 170, 0.2);
  color: #e8e0d0;
}

.history_list {
  overflow-y: auto;
  padding: 12px;
  flex: 1;
}

.history_loading,
.history_empty,
.history_error {
  text-align: center;
  padding: 30px 20px;
  font-size: 13px;
  color: #8888aa;
}

.history_error {
  color: #f87171;
}

.history_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: rgba(255, 235, 190, 0.04);
  border: 1px solid rgba(255, 215, 140, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.history_item:hover {
  background: rgba(240, 194, 127, 0.1);
  border-color: rgba(240, 194, 127, 0.35);
}

.history_item:last-child {
  margin-bottom: 0;
}

.history_item_main {
  flex: 1;
  min-width: 0;
}

.history_item_birth {
  font-size: 14px;
  font-weight: 500;
  color: #e8e0d0;
  margin-bottom: 4px;
}

.history_item_summary {
  font-size: 12px;
  color: #9a8868;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history_item_right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 12px;
}

.history_item_time {
  font-size: 11px;
  color: #666688;
  white-space: nowrap;
}

.history_delete_btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #8888aa;
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.15);
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.history_delete_btn:hover {
  background: rgba(248, 113, 113, 0.2);
  color: #f87171;
}

/* ── Toast 提示 ────────────────────────────────────────────── */

.bazi_toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  z-index: 11000;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.bazi_toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bazi_toast_success {
  color: #e8e0d0;
  background: rgba(30, 22, 14, 0.92);
  border: 1px solid rgba(74, 222, 128, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.bazi_toast_error {
  color: #f87171;
  background: rgba(30, 14, 14, 0.92);
  border: 1px solid rgba(248, 113, 113, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ── 移动端适配（补充） ────────────────────────────────────── */

@media (max-width: 600px) {
  .auth_bar {
    padding: 8px 0 0;
  }

  .auth_user_info {
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .history_dialog {
    max-height: 90vh;
  }

  .history_item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .history_item_right {
    flex-direction: row;
    align-items: center;
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
}