/* ===========================================================================
   应时 · 集市详情页精修样式
   风物主卡 + 农历三旬 10 列对齐日历 + 高留白随身扫码卡
   =========================================================================== */

body.market-page main {
  max-width: 1020px;
  padding: 20px 24px 56px;
}

body.market-page .dt-detail {
  padding: 0;
}

body.market-page .dt-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  gap: 28px;
  align-items: start;
}

body.market-page .dt-main {
  min-width: 0;
}

/* ── 集市风物主卡（融合名称、地区、状态、核心集期与操作） ── */
body.market-page .dt-hero-card {
  position: relative;
  padding: 24px 26px 22px;
  margin-bottom: 22px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(208, 192, 166, 0.65);
  background: linear-gradient(165deg, #FFFFFF 0%, #FFFDF8 62%, #FAF3E8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 8px 28px rgba(68, 48, 26, 0.065);
  overflow: hidden;
}

body.market-page .dt-hero-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, #D97A54 55%, var(--gold-border) 100%);
}

body.market-page .dt-hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/market-welcome.jpg") right center / cover no-repeat;
  opacity: 0.075;
  mask-image: linear-gradient(90deg, transparent 28%, #000 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 28%, #000 100%);
  pointer-events: none;
}

body.market-page .dt-hero-card > * {
  position: relative;
  z-index: 1;
}

body.market-page .dt-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

body.market-page .dt-region {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--accent-deep);
  font-weight: 600;
}

body.market-page .dt-region .gj-ico {
  width: 15px;
  height: 15px;
  color: var(--accent-gold);
}

body.market-page .dt-hero-card h1 {
  font-size: clamp(1.75rem, 1.35rem + 1.4vw, 2.25rem);
  line-height: 1.3;
  letter-spacing: 0.02em;
  margin: 0 0 14px;
}

body.market-page .dt-hero-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: rgba(251, 242, 227, 0.72);
  border: 1px solid rgba(226, 204, 167, 0.75);
}

body.market-page .dt-rule-seal {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--brand);
  color: var(--text-on-brand);
  font-family: var(--font-serif);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
}

body.market-page .dt-rule-text {
  color: var(--text-strong);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

body.market-page .dt-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

body.market-page .dt-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid rgba(208, 192, 166, 0.7);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-body);
  font-size: 0.9rem;
  font-weight: 600;
}

body.market-page .dt-action:hover {
  color: var(--brand);
  border-color: var(--brand-border);
  background: var(--brand-surface);
}

body.market-page .dt-action.is-primary {
  background: linear-gradient(155deg, #C43B35 0%, #A42521 100%);
  border-color: var(--brand);
  color: var(--text-on-brand);
  box-shadow: var(--shadow-brand);
}

body.market-page .dt-action.is-primary:hover {
  background: linear-gradient(155deg, #B52F2B 0%, #8E1F1C 100%);
  color: var(--text-on-brand);
  transform: translateY(-1px);
}

/* ── 详情区块头 ── */
body.market-page .dt-section {
  margin: 0 0 22px;
}

body.market-page .dt-section-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

body.market-page .dt-section-heading::before {
  content: "";
  width: 3px;
  height: 17px;
  border-radius: 2px;
  background: var(--brand);
}

body.market-page .dt-section-heading h2 {
  font-size: 1.28rem;
  margin: 0;
}

body.market-page .dt-section-heading span {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* ── 卡片基元 ── */
body.market-page .dt-calendar-card,
body.market-page .dt-info-card {
  background: var(--surface-raised);
  border: 1px solid rgba(208, 192, 166, 0.58);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 4px 18px rgba(68, 48, 26, 0.05);
  overflow: hidden;
}

/* ── 集期日历卡：传统三旬 10 列对齐，尾数规律纵向成带 ── */
body.market-page .dt-calendar-card {
  padding: 18px 20px;
}

body.market-page .dt-calendar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

body.market-page .dt-calendar-top h3 {
  font-size: 1.05rem;
  margin: 0;
}

body.market-page .dt-legend {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-faint);
}

body.market-page .dt-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #FAE7DF;
  border: 1px solid #E5B8A8;
  margin-right: 6px;
}

/* ── Compass 同款本月集日日历（复刻 pages/calendar/calendar.wxss） ── */
body.market-page .dt-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

body.market-page .dt-cal__month {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 0.03em;
}

body.market-page .dt-cal__legend {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--text-faint);
}

body.market-page .dt-cal__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

body.market-page .dt-cal__legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #FAE7DF;
  border: 1px solid #E5B8A8;
}

body.market-page .dt-cal__legend-ring {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--brand);
}

body.market-page .dt-cal__weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  background: var(--bg-paper-warm);
  border-radius: 10px;
  padding: 7px 0;
  margin-bottom: 8px;
}

body.market-page .dt-cal__weekday {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-faint);
}

body.market-page .dt-cal__weekday--weekend {
  color: var(--accent-gold);
}

body.market-page .dt-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  row-gap: 6px;
  column-gap: 4px;
}

body.market-page .dt-cell {
  position: relative;
  min-width: 0;
  min-height: 54px;
  padding: 5px 2px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: transparent;
}

body.market-page .dt-cell--empty {
  pointer-events: none;
}

body.market-page .dt-cell__day {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

body.market-page .dt-cell__sub {
  margin-top: 2px;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--text-faint);
  white-space: nowrap;
}

body.market-page .dt-cell__fair-dot {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--brand);
}

body.market-page .dt-cell--fair {
  background: #FCF0EB;
}

body.market-page .dt-cell--fair .dt-cell__day {
  color: var(--brand);
  font-weight: 700;
}

body.market-page .dt-cell--fair .dt-cell__sub {
  color: #964B45;
  font-weight: 500;
}

body.market-page .dt-cell--today {
  background: var(--brand);
  box-shadow: 0 3px 8px rgba(181, 47, 43, 0.24);
}

body.market-page .dt-cell--today .dt-cell__day {
  color: #FFFFFF;
  font-weight: 700;
}

body.market-page .dt-cell--today .dt-cell__sub {
  color: rgba(255, 255, 255, 0.9);
}

body.market-page .dt-cell--today .dt-cell__fair-dot {
  background: #FDE5B8;
}

body.market-page .dt-dekad-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.market-page .dt-cal-timeline {
  padding: 2px 4px 16px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--border-subtle);
}

body.market-page .dt-cal-timeline__label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-faint);
  font-size: 0.78rem;
}

body.market-page .dt-cal-timeline .m-card__timeline {
  margin-top: 0;
}

body.market-page .dt-dekad-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

body.market-page .dt-dekad-label {
  color: var(--text-faint);
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  padding: 4px 0;
  border-radius: 6px;
  background: var(--bg-paper-warm);
}

body.market-page .dt-rule-grid {
  display: grid;
  gap: 6px;
}

body.market-page .dt-rule-grid.dekad {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

body.market-page .dt-rule-grid.weekdays {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

body.market-page .dt-rule-grid.branches {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

body.market-page .dt-rule-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 4px 2px 7px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-muted);
  background: var(--bg-paper-warm);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

body.market-page .dt-rule-cell b {
  font-weight: 500;
  line-height: 1.2;
}

body.market-page .dt-rule-cell small {
  font-size: 0.72rem;
  color: var(--text-faint);
  line-height: 1.3;
}

body.market-page .dt-rule-cell.is-fair {
  background: linear-gradient(180deg, #FDF0EA 0%, #F9E3DA 100%);
  border-color: #E2B3A6;
  color: var(--brand);
  box-shadow: 0 2px 6px rgba(181, 47, 43, 0.08);
}

body.market-page .dt-rule-cell.is-fair b {
  font-weight: 700;
}

body.market-page .dt-rule-cell.is-fair small {
  color: #964B45;
}

body.market-page .dt-rule-cell.is-fair i {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--brand);
}

body.market-page .dt-calendar-note {
  margin-top: 14px;
  color: var(--text-faint);
  font-size: 0.82rem;
  line-height: 1.6;
}

body.market-page .dt-anchor {
  padding: 6px 2px;
}

body.market-page .dt-anchor small {
  color: var(--text-faint);
  font-size: 0.8rem;
}

body.market-page .dt-anchor strong {
  display: block;
  color: var(--accent-deep);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: 4px 0 8px;
}

body.market-page .dt-anchor p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

body.market-page .dt-annual-row {
  display: flex;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.92rem;
}

body.market-page .dt-annual-row:last-child {
  border-bottom: 0;
}

body.market-page .dt-annual-row b {
  width: 48px;
  color: var(--accent-deep);
}

body.market-page .dt-annual-row span {
  color: var(--text-body);
}

/* ── 集市信息档案卡（去废话，行行皆干货） ── */
body.market-page .dt-info-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

body.market-page .dt-info-row:last-child {
  border-bottom: 0;
}

body.market-page .dt-info-row__icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  margin-top: 1px;
}

body.market-page .dt-info-row__body {
  flex: 1;
  min-width: 0;
}

body.market-page .dt-info-row__value {
  display: block;
  color: var(--text-body);
  font-size: 0.96rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

body.market-page .dt-info-row__desc {
  color: var(--text-body);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ── 高留白极简右侧随身卡 ── */
body.market-page .dt-sidebar {
  position: sticky;
  top: 84px;
}

body.market-page .dt-mini-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 22px 20px;
  background: linear-gradient(170deg, #FFFFFF 0%, #FDF6EA 68%, #FAEDE7 100%);
  border: 1px solid rgba(226, 204, 167, 0.85);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 8px 26px rgba(68, 48, 26, 0.065);
  overflow: hidden;
}

body.market-page .dt-mini-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, #D97A54 55%, var(--gold-border) 100%);
}

body.market-page .dt-mini-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

body.market-page .dt-mini-brand img {
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}

body.market-page .dt-mini-brand span {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
}

body.market-page .dt-mini-qr {
  width: 168px;
  height: 168px;
  border: 8px solid var(--bg-surface);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(68, 48, 26, 0.08);
  display: block;
}

body.market-page .dt-mini-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-strong);
  margin: 16px 0 10px;
}

body.market-page .dt-mini-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(226, 204, 167, 0.7);
  color: var(--accent-deep);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

body.market-page .dt-mini-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--text-faint);
  font-size: 0.82rem;
}

body.market-page .dt-mini-link:hover {
  color: var(--brand);
}

@media (max-width: 820px) {
  body.market-page main {
    padding: 16px 16px 40px;
  }
  body.market-page .dt-page-grid {
    display: block;
  }
  body.market-page .dt-sidebar {
    position: static;
    margin-top: 22px;
  }
}

@media (max-width: 640px) {
  body.market-page .dt-hero-card {
    padding: 18px 16px;
  }
  body.market-page .dt-mini-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    grid-template-rows: auto auto auto;
    align-items: center;
    text-align: left;
    gap: 4px 16px;
    padding: 18px 16px;
  }
  body.market-page .dt-mini-brand {
    grid-column: 1;
    margin-bottom: 4px;
  }
  body.market-page .dt-mini-qr {
    grid-column: 2;
    grid-row: 1 / 4;
    width: 112px;
    height: 112px;
    border-width: 5px;
  }
  body.market-page .dt-mini-title {
    grid-column: 1;
    margin: 2px 0 6px;
    font-size: 0.98rem;
  }
  body.market-page .dt-mini-stat {
    grid-column: 1;
    justify-self: start;
    white-space: normal;
  }
  body.market-page .dt-mini-link {
    display: none;
  }
  body.market-page .dt-calendar-card {
    padding: 14px 12px;
  }
  body.market-page .dt-dekad-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  body.market-page .dt-dekad-label {
    text-align: left;
    background: transparent;
    padding: 2px 2px 0;
  }
  body.market-page .dt-rule-grid.dekad {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  body.market-page .dt-rule-cell {
    min-height: 40px;
    font-size: 0.84rem;
  }
  body.market-page .dt-rule-grid.branches {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body.market-page .dt-info-row {
    padding: 13px 14px;
    gap: 10px;
  }
}
