.almanac-page {
  padding-bottom: 40px;
  font-family: "MicrosoftYaHei", "Microsoft YaHei", sans-serif;
}

/* 仅标题、副标题及固定标签使用子集宋体 */
.almanac-page-title,
.almanac-section-title,
.almanac-yiji-heading,
.almanac-pengzu-label,
.almanac-ganzhi-label,
.almanac-badge-label,
.almanac-position-table thead th,
.almanac-position-table tbody th,
.almanac-jieqi-label,
.almanac-jieqi-key,
.almanac-info-label {
  font-family: "SiYuanSongTi", serif;
}

/* 动态渲染内容显式使用微软雅黑，避免子集宋体缺字混排 */
.almanac-solar,
.almanac-lunar,
.almanac-pengzu,
.almanac-badge strong,
.almanac-ganzhi-value,
.almanac-time-chip,
.almanac-time-chip-gz,
.almanac-time-chip-range,
.almanac-time-meta,
.almanac-time-meta span,
.almanac-position-table td,
.almanac-tag,
.almanac-tag-empty,
.almanac-jieqi-today strong,
.almanac-jieqi-val,
.almanac-info-value,
.almanac-text,
.almanac-text span,
.almanac-section-desc,
#almanac-date-input {
  font-family: "MicrosoftYaHei", "Microsoft YaHei", sans-serif;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.almanac-hero {
  background: linear-gradient(180deg, #fffdf8 0%, #fff 42%, #faf6ef 100%);
  border: 1px solid rgba(121, 85, 72, 0.18);
  border-radius: 8px;
  overflow: hidden;
}

.almanac-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(121, 85, 72, 0.12);
  background: linear-gradient(90deg, rgba(121, 85, 72, 0.08) 0%, rgba(121, 85, 72, 0.02) 100%);
}

.almanac-page-title {
  margin: 0;
  font-size: 22px;
  color: #5d4037;
  font-weight: bold;
  letter-spacing: 2px;
}

.almanac-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#almanac-date-input {
  width: 148px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(121, 85, 72, 0.35);
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#almanac-date-input:hover,
#almanac-date-input:focus {
  border-color: #795548;
  box-shadow: 0 0 0 2px rgba(121, 85, 72, 0.12);
  outline: none;
}

.almanac-today-btn {
  min-height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: 6px;
  background: #795548;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.almanac-today-btn:hover {
  background: #5d4037;
}

.almanac-body {
  padding: 28px 24px 24px;
}

.almanac-date-panel {
  text-align: center;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px dashed rgba(121, 85, 72, 0.2);
}

.almanac-solar {
  margin: 0 0 10px;
  font-size: 28px;
  color: #3e2723;
  line-height: 1.4;
  letter-spacing: 1px;
}

.almanac-lunar {
  margin: 0 0 10px;
  font-size: 20px;
  color: #795548;
  line-height: 1.5;
}

.almanac-pengzu {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: #8d6e63;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.almanac-pengzu-label {
  margin-right: 6px;
  color: #795548;
}

.almanac-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.almanac-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  color: #6b5b4f;
  background: rgba(121, 85, 72, 0.08);
  border: 1px solid rgba(121, 85, 72, 0.15);
  border-radius: 20px;
  line-height: 1.4;
}

.almanac-badge strong {
  color: #5d4037;
  font-weight: 600;
}

.almanac-ganzhi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.almanac-ganzhi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 88px;
  padding: 16px 8px;
  background: #fff;
  border: 1px solid rgba(121, 85, 72, 0.16);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(121, 85, 72, 0.06);
}

.almanac-ganzhi-label {
  font-size: 12px;
  color: #999;
  letter-spacing: 1px;
}

.almanac-ganzhi-value {
  font-size: 22px;
  color: #5d4037;
  font-weight: bold;
  letter-spacing: 2px;
}

.almanac-section {
  margin-bottom: 24px;
}

.almanac-section:last-child {
  margin-bottom: 0;
}

.almanac-section-title {
  margin: 0 0 16px;
  padding-left: 12px;
  font-size: 16px;
  color: #5d4037;
  font-weight: bold;
  line-height: 1.4;
  border-left: 4px solid #795548;
}

.almanac-section-desc {
  margin: -8px 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #888;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.almanac-time-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.almanac-time-chip {
  flex: 0 0 auto;
  min-width: 88px;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid rgba(121, 85, 72, 0.2);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.almanac-time-chip:hover {
  border-color: #795548;
}

.almanac-time-chip.active {
  border-color: #795548;
  background: rgba(121, 85, 72, 0.1);
  box-shadow: 0 0 0 2px rgba(121, 85, 72, 0.12);
}

.almanac-time-chip-gz {
  display: block;
  font-size: 16px;
  color: #5d4037;
  font-weight: bold;
  line-height: 1.4;
}

.almanac-time-chip-range {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #999;
  line-height: 1.3;
  white-space: nowrap;
}

.almanac-time-meta {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(121, 85, 72, 0.05);
  border-radius: 6px;
}

.almanac-position-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(121, 85, 72, 0.14);
  border-radius: 8px;
  background: #fff;
}

.almanac-position-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.almanac-position-table th,
.almanac-position-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(121, 85, 72, 0.08);
  text-align: center;
  word-break: break-word;
}

.almanac-position-table thead th {
  background: rgba(121, 85, 72, 0.08);
  color: #5d4037;
  font-weight: bold;
}

.almanac-position-table tbody th {
  color: #999;
  font-weight: normal;
  text-align: left;
  white-space: nowrap;
}

.almanac-position-table tbody tr:last-child th,
.almanac-position-table tbody tr:last-child td {
  border-bottom: none;
}

.almanac-position-table td {
  color: #333;
}

.almanac-yiji-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.almanac-yiji-box {
  padding: 18px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.almanac-yiji-yi {
  background: linear-gradient(135deg, #f1f8f1 0%, #fff 100%);
  border-color: rgba(46, 125, 50, 0.2);
}

.almanac-yiji-ji {
  background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
  border-color: rgba(198, 40, 40, 0.15);
}

.almanac-yiji-heading {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
}

.almanac-yiji-yi .almanac-yiji-heading {
  color: #2e7d32;
}

.almanac-yiji-ji .almanac-yiji-heading {
  color: #c62828;
}

.almanac-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.almanac-tag {
  display: inline-block;
  padding: 5px 12px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 4px;
  word-break: break-word;
}

.almanac-tag-yi {
  color: #2e7d32;
  background: rgba(46, 125, 50, 0.1);
  border: 1px solid rgba(46, 125, 50, 0.2);
}

.almanac-tag-ji {
  color: #c62828;
  background: rgba(198, 40, 40, 0.08);
  border: 1px solid rgba(198, 40, 40, 0.18);
}

.almanac-jishen-box {
  background: linear-gradient(135deg, #fff8e8 0%, #fff 100%);
  border-color: rgba(184, 134, 11, 0.25);
}

.almanac-jishen-box .almanac-yiji-heading {
  color: #b8860b;
}

.almanac-xiongsha-box {
  background: linear-gradient(135deg, #f3eef8 0%, #fff 100%);
  border-color: rgba(94, 53, 177, 0.18);
}

.almanac-xiongsha-box .almanac-yiji-heading {
  color: #5e35b1;
}

.almanac-tag-jishen {
  color: #b8860b;
  background: rgba(184, 134, 11, 0.1);
  border: 1px solid rgba(184, 134, 11, 0.22);
}

.almanac-tag-xiongsha {
  color: #5e35b1;
  background: rgba(94, 53, 177, 0.08);
  border: 1px solid rgba(94, 53, 177, 0.18);
}

.almanac-tag-empty {
  font-size: 13px;
  color: #999;
  line-height: 1.6;
}

.almanac-details {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
}

.almanac-jieqi-card {
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(121, 85, 72, 0.14);
  border-radius: 8px;
}

.almanac-jieqi-today {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: rgba(121, 85, 72, 0.08);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
  color: #5d4037;
}

.almanac-jieqi-today.hidden {
  display: none;
}

.almanac-jieqi-label {
  margin-right: 8px;
  color: #795548;
}

.almanac-jieqi-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(121, 85, 72, 0.08);
  font-size: 14px;
  line-height: 1.6;
}

.almanac-jieqi-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.almanac-jieqi-key {
  flex-shrink: 0;
  width: 64px;
  color: #999;
}

.almanac-jieqi-val {
  flex: 1;
  min-width: 0;
  color: #333;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.almanac-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.almanac-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid rgba(121, 85, 72, 0.12);
  border-radius: 6px;
  min-height: 64px;
}

.almanac-info-label {
  font-size: 12px;
  color: #999;
  line-height: 1.4;
}

.almanac-info-value {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 800px) {
  .almanac-hero-head {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .almanac-page-title {
    font-size: 20px;
    text-align: center;
  }

  .almanac-controls {
    justify-content: stretch;
  }

  #almanac-date-input {
    flex: 1;
    width: auto;
    min-height: 40px;
  }

  .almanac-today-btn {
    flex-shrink: 0;
    min-height: 40px;
  }

  .almanac-body {
    padding: 20px 16px 16px;
  }

  .almanac-solar {
    font-size: 22px;
  }

  .almanac-lunar {
    font-size: 17px;
  }

  .almanac-badges {
    gap: 8px;
  }

  .almanac-badge {
    font-size: 12px;
    padding: 5px 10px;
  }

  .almanac-ganzhi-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .almanac-ganzhi-item {
    min-height: 76px;
    padding: 12px 6px;
  }

  .almanac-ganzhi-value {
    font-size: 20px;
  }

  .almanac-yiji-grid {
    grid-template-columns: 1fr;
  }

  .almanac-details {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .almanac-info-grid {
    grid-template-columns: 1fr;
  }

  .almanac-jieqi-row {
    flex-direction: column;
    gap: 4px;
    padding: 8px 0;
  }

  .almanac-jieqi-key {
    width: auto;
  }

  .almanac-time-chip {
    min-height: 48px;
  }

  .almanac-position-table th,
  .almanac-position-table td {
    padding: 10px 8px;
    font-size: 13px;
  }
}
