/**
 * huangli.html 页面专用样式
 * 基于 common.css 公共样式体系
 * 使用 #mainContent id 选择器覆盖 style.css 的 .main-content 冲突
 */

/* ===== 布局覆盖（覆盖 style.css 的 .main-content 冲突）===== */
#mainContent {
  margin-left: 0 !important;
  padding: 20px 24px 60px !important;
  max-width: 700px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  min-height: 100vh;
}

/* 桌面端：侧边栏可见时，内容区右移 */
@media (min-width: 901px) {
  #mainContent {
    margin-left: var(--sidebar-width) !important;
    padding: 20px 32px 60px !important;
  }
}

/* 手机端 */
@media (max-width: 640px) {
  #mainContent {
    padding: 12px 12px 72px !important;
  }
}

/* 页头 */
#mainContent .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

#mainContent .page-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 700;
  color: #3A2A1A;
  display: flex;
  align-items: center;
  gap: 8px;
}

#mainContent .btn-ghost {
  font-size: 12px;
  color: var(--primary-purple);
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--primary-purple-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

#mainContent .btn-ghost:hover {
  background: var(--primary-purple-light);
  color: #fff;
}

/* 卡片样式覆盖 — 去 border 和 fadeInUp 动画（与 demo 保持一致） */
#mainContent .card {
  background: var(--bg-card);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
  border: none;
  animation: none;
}

#mainContent .card-title {
  font-size: 16px;
  font-weight: 700;
  color: #3A2A1A;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#mainContent .card-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: linear-gradient(to bottom, #8B6FD4, #B07A48);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ===== 月历 ===== */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-month-title {
  font-size: 18px;
  font-weight: 700;
  color: #3A2A1A;
}

.cal-nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--primary-purple-bg);
  border-radius: 8px;
  color: var(--primary-purple);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.cal-nav-btn:hover {
  background: var(--primary-purple-light);
  color: #fff;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}

.cal-wd {
  text-align: center;
  font-size: 11px;
  color: #B0A090;
  font-weight: 600;
  padding: 4px 0;
}

.cal-wd:first-child,
.cal-wd:last-child {
  color: #F48FB1;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #3A2A1A;
  transition: background 0.2s;
  padding: 2px;
  position: relative;
}

.cal-day:hover {
  background: var(--primary-purple-bg);
}

.cal-day.today {
  background: var(--primary-purple);
  color: #fff;
}

.cal-day.today:hover {
  background: var(--primary-purple);
}

.cal-day.selected {
  background: var(--primary-brown);
  color: #fff;
}

.cal-day.other-month {
  color: #D0C0B0;
}

.cal-day.weekend {
  color: #E91E63;
}

.cal-day.today.weekend {
  color: #fff;
}

.cal-lunar {
  font-size: 9px;
  margin-top: 1px;
  opacity: 0.7;
}

.cal-day.today .cal-lunar {
  opacity: 0.9;
}

.day-dot {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.day-dot.festival {
  background: #E91E63;
}

.day-dot.term {
  background: #4CAF50;
}

/* ===== 今日详情（与 demo 一致的渐变卡片）===== */
.today-detail-card {
  background: linear-gradient(135deg, #7A4B22, #B07A48);
  border-radius: var(--card-radius);
  padding: 18px 20px;
  color: #fff;
  margin-bottom: 16px;
}

.tdc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tdc-label {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 4px;
}

.tdc-date {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 2px;
}

.tdc-gz {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  opacity: 0.95;
}

.tdc-info {
  font-size: 12px;
  opacity: 0.85;
  line-height: 1.8;
  text-align: right;
}

.tdc-yiji-label {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 6px;
}

.auspicious-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.aus-tag {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
}

.aus-tag.bad {
  background: rgba(0, 0, 0, 0.15);
}

/* ===== 黄历详情 ===== */
.huangli-detail {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hl-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #F5EFEB;
}

.hl-row:last-child {
  border-bottom: none;
}

.hl-label {
  font-size: 12px;
  font-weight: 600;
  color: #8C7060;
  white-space: nowrap;
  min-width: 72px;
}

.hl-value {
  font-size: 12px;
  color: #3A2A1A;
  line-height: 1.7;
  flex: 1;
}

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

.hl-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.hl-tag.good {
  background: #E8F5E9;
  color: #2E7D32;
}

.hl-tag.bad {
  background: #FFF3F3;
  color: #C62828;
}

/* ===== 预警条 ===== */
.alert-strip {
  background: #FFF3E0;
  border: 1.5px solid #FFB74D;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.alert-strip.safe {
  background: #E8F5E9;
  border-color: #A5D6A7;
}

.alert-strip.warn {
  background: #FFF3E0;
  border-color: #FFB74D;
}

.alert-strip.danger {
  background: #FFEBEE;
  border-color: #EF9A9A;
}

.alert-title {
  font-size: 13px;
  font-weight: 700;
  color: #E65100;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.alert-strip.safe .alert-title {
  color: #2E7D32;
}

.alert-strip.danger .alert-title {
  color: #C62828;
}

.alert-content {
  font-size: 12px;
  color: #BF360C;
  line-height: 1.7;
}

.alert-strip.safe .alert-content {
  color: #388E3C;
}

.alert-strip.danger .alert-content {
  color: #B71C1C;
}

/* ===== 时辰卡片 ===== */
.shichen-wrap {
  position: relative;
}

.shichen-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #D4C4B0 transparent;
}

.shichen-scroll::-webkit-scrollbar {
  height: 4px;
}

.shichen-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.shichen-scroll::-webkit-scrollbar-thumb {
  background: #D4C4B0;
  border-radius: 4px;
}

/* 右侧渐隐提示 */
.shichen-fade {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 6px;
  width: 40px;
  background: linear-gradient(to right, transparent, rgba(253,251,249,0.95));
  pointer-events: none;
  transition: opacity 0.3s;
}

.sc-card {
  flex-shrink: 0;
  width: 96px;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  border: 1.5px solid #F0E8DE;
  background: #FDFBF9;
  transition: border-color 0.2s, background 0.2s;
  scroll-snap-align: start;
}

.sc-card.tianyi {
  border-color: #4CAF50;
  background: #E8F5E9;
}

.sc-card.dae {
  border-color: #F44336;
  background: #FFF3F3;
}

.sc-card.current {
  border-color: var(--primary-purple);
  background: var(--primary-purple-bg);
}

.sc-name {
  font-size: 14px;
  font-weight: 700;
  color: #3A2A1A;
  margin-bottom: 2px;
}

.sc-time {
  font-size: 10px;
  color: #8C7060;
  margin-bottom: 5px;
}

.sc-type {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

.sc-type-normal {
  background: #F5F5F5;
  color: #757575;
}

.sc-type-tianyi {
  background: #C8E6C9;
  color: #1B5E20;
}

.sc-type-dae {
  background: #FFCDD2;
  color: #880E4F;
}

.sc-type-current {
  background: var(--primary-purple-bg);
  color: var(--primary-purple);
}

.sc-type-career {
  background: #FFF8E1;
  color: #E65100;
}

.sc-type-sleep {
  background: #E8EAF6;
  color: #283593;
}

.sc-tip {
  font-size: 10px;
  color: #8C7060;
  margin-top: 5px;
  line-height: 1.4;
}

.sc-tianshen {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  margin-top: 3px;
  display: inline-block;
}

.sc-ts-huangdao {
  background: #FFF8E1;
  color: #E65100;
}

.sc-ts-heidao {
  background: #ECEFF1;
  color: #455A64;
}

.sc-yi {
  font-size: 9px;
  color: #2E7D32;
  margin-top: 2px;
}

.sc-ji {
  font-size: 9px;
  color: #C62828;
  margin-top: 1px;
}

.sc-subtitle {
  font-size: 12px;
  color: #8C7060;
  margin-bottom: 10px;
}

/* ===== 维度得分 ===== */
.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.score-item {
  background: #FDFBF9;
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  border: 1.5px solid #F0E8DE;
}

.score-emoji {
  font-size: 22px;
  margin-bottom: 4px;
}

.score-num {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 2px;
}

.score-name {
  font-size: 11px;
  color: #8C7060;
}

.score-color-love { color: #E91E63; }
.score-color-wealth { color: #E8A427; }
.score-color-career { color: #1565C0; }
.score-color-health { color: #4CAF50; }
.score-color-social { color: #9C6B30; }
.score-color-spirit { color: #8B6FD4; }

/* ===== 养生建议 ===== */
.yangsheng-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ys-card {
  border-radius: 12px;
  padding: 12px;
}

.ys-card-food {
  background: #E8F5E9;
}

.ys-card-sport {
  background: #E3F2FD;
}

.ys-card-health {
  background: #FFF8E1;
}

.ys-card-mind {
  background: #F3E5F5;
}

.ys-card-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.ys-card-food .ys-card-title { color: #2E7D32; }
.ys-card-sport .ys-card-title { color: #1565C0; }
.ys-card-health .ys-card-title { color: #E65100; }
.ys-card-mind .ys-card-title { color: #6A1B9A; }

.ys-card-content {
  font-size: 12px;
  line-height: 1.7;
}

.ys-card-food .ys-card-content { color: #388E3C; }
.ys-card-sport .ys-card-content { color: #1976D2; }
.ys-card-health .ys-card-content { color: #BF360C; }
.ys-card-mind .ys-card-content { color: #7B1FA2; }

/* ===== 五运六气 ===== */
.wuyun-timeline {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-radius: 12px;
  overflow: hidden;
}

.wy-seg {
  flex: 1;
  min-width: 60px;
  padding: 10px 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.wy-seg.active {
  box-shadow: inset 0 -3px 0 #FFD54F;
}

.wuyun-desc {
  margin-top: 12px;
  font-size: 12px;
  color: #8C7060;
  line-height: 1.8;
}

/* ===== 月吉日 ===== */
.jiri-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.jiri-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
}

.jiri-item-great {
  background: #E8F5E9;
}

.jiri-item-good {
  background: #E3F2FD;
}

.jiri-item-ok {
  background: #FFF8E1;
}

.jiri-day {
  font-size: 20px;
  font-weight: 900;
  width: 32px;
  text-align: center;
}

.jiri-item-great .jiri-day { color: #2E7D32; }
.jiri-item-good .jiri-day { color: #1565C0; }
.jiri-item-ok .jiri-day { color: #E65100; }

.jiri-info-title {
  font-size: 13px;
  font-weight: 600;
}

.jiri-item-great .jiri-info-title { color: #1B5E20; }
.jiri-item-good .jiri-info-title { color: #0D47A1; }
.jiri-item-ok .jiri-info-title { color: #BF360C; }

.jiri-info-desc {
  font-size: 12px;
}

.jiri-item-great .jiri-info-desc { color: #388E3C; }
.jiri-item-good .jiri-info-desc { color: #1976D2; }
.jiri-item-ok .jiri-info-desc { color: #E65100; }

/* ===== 星宿/值星/黄道 信息行 ===== */
.info-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
  margin: 2px;
}

.info-chip-jx {
  background: #FFF8E1;
  color: #F57F17;
}

.info-chip-xi {
  background: #E8F5E9;
  color: #2E7D32;
}

.info-chip-xiong {
  background: #FFEBEE;
  color: #C62828;
}

.info-chip-neutral {
  background: #F5F5F5;
  color: #616161;
}

.info-chip-huangdao {
  background: linear-gradient(135deg, #FFF8E1, #FFE082);
  color: #E65100;
  font-weight: 600;
}

.info-chip-heidao {
  background: linear-gradient(135deg, #ECEFF1, #B0BEC5);
  color: #37474F;
}

/* ===== 月相指示 ===== */
.moon-phase {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.moon-phase-icon {
  font-size: 24px;
}

.moon-phase-text {
  font-size: 12px;
  color: #8C7060;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .score-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .cal-day {
    font-size: 12px;
  }

  .cal-lunar {
    font-size: 8px;
  }

  .tdc-date {
    font-size: 28px;
  }

  .sc-card {
    width: 88px;
    padding: 8px 6px;
  }

  .jiri-item {
    padding: 8px 12px;
  }
}

/* 平板端 */
@media (min-width: 641px) and (max-width: 900px) {
  #mainContent {
    padding: 16px 20px 60px !important;
  }
}
