/* 老式撕历——纸、装订、页眉、大数字、宜忌。
   细目/时辰/印章/纸叠在 calendar-detail.css。 */

:root {
  --paper: #f6efdf;
  --red: #c0201c;
  --red-deep: #8e1210;
  --ink: #221d18;
  --ink-soft: #5b5145;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
}

.stage {
  min-height: 100vh;
  padding: calc(14px + env(safe-area-inset-top)) 12px calc(158px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  background:
    radial-gradient(120% 80% at 50% 0%, #b51d1a 0%, #8c1310 45%, #5e0c0b 100%),
    #5e0c0b;
}

.calendar {
  position: relative;
  width: min(432px, 94vw);
}

/* 顶部红色装订带 + 两枚铜钉 */
.binding {
  position: relative;
  height: 30px;
  border-radius: 9px 9px 2px 2px;
  background-image: linear-gradient(
      180deg,
      rgba(212, 40, 31, 0.78) 0%,
      rgba(187, 26, 22, 0.82) 55%,
      rgba(143, 16, 14, 0.88) 100%
    ),
    url("/binding.jpg");
  background-size: 100% 100%, cover;
  background-position: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.rivet {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  margin-top: -6.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff3c9 0%, #e3c078 34%, #a97f2f 72%, #6f4d16 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.rivet:first-child {
  left: 21%;
}

.rivet:last-child {
  right: 21%;
}

/* 纸 */
.sheet {
  position: relative;
  margin-top: -2px;
  padding: 16px 16px 12px;
  border-radius: 2px 2px 5px 5px;
  color: var(--ink);
  font-family: var(--serif);
  background-color: var(--paper);
  background-image:
    linear-gradient(170deg, rgba(253, 248, 236, 0.72) 0%, rgba(244, 234, 214, 0.66) 58%, rgba(235, 223, 198, 0.72) 100%),
    url("/paper.jpg"),
    radial-gradient(circle at 18% 26%, rgba(150, 124, 82, 0.07) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 62%, rgba(150, 124, 82, 0.06) 0 1.5px, transparent 2.5px),
    repeating-linear-gradient(114deg, rgba(170, 148, 106, 0.055) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(16deg, rgba(170, 148, 106, 0.045) 0 1px, transparent 1px 4px);
  background-size: 100% 100%, cover, auto, auto, auto, auto;
  box-shadow:
    0 1px 0 #e6dbc1,
    0 2px 0 #ded2b5,
    0 3px 0 #d6c9aa,
    0 4px 0 #cec0a0,
    0 8px 18px rgba(0, 0, 0, 0.34);
}

.sheet::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1.4px solid rgba(192, 32, 28, 0.6);
  border-radius: 2px;
  pointer-events: none;
}

/* 页眉红条 */
.sheet-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 10px 6px;
  margin: 4px 2px 0;
  border-radius: 4px;
  color: #fff;
  background-image: linear-gradient(180deg, rgba(207, 38, 32, 0.86), rgba(164, 22, 19, 0.9)),
    url("/binding.jpg");
  background-size: 100% 100%, cover;
  background-position: center;
  background-blend-mode: multiply;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.sheet-head .hy {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #ffe6ad;
}

.sheet-head .hm {
  margin-left: auto;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sheet-head .hs {
  font-size: 11.5px;
  color: #ffe6ad;
}

.sheet-top {
  display: flex;
  justify-content: space-between;
  margin: 10px 4px 0;
  padding-bottom: 6px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--red);
  border-bottom: 1px dashed rgba(150, 120, 70, 0.55);
}

/* 中央：左右对联 + 大数字 */
.main {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 4px;
  padding: 10px 0 4px;
}

.couplet {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 12.5px;
  letter-spacing: 0.18em;
  color: var(--red-deep);
  opacity: 0.92;
  padding-top: 4px;
}

.couplet.right {
  align-self: flex-end;
}

.bigday {
  position: relative;
  flex: 1;
  text-align: center;
}

.bigday .seal {
  position: absolute;
  right: -2px;
  bottom: 18px;
}

.bigday::before {
  content: attr(data-animal);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(96px, 30vw, 150px);
  color: rgba(192, 32, 28, 0.11);
  z-index: 0;
  pointer-events: none;
}

.num {
  position: relative;
  z-index: 1;
  font-size: clamp(92px, 27vw, 148px);
  line-height: 0.94;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -0.02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75), 0 0 1px rgba(120, 10, 8, 0.5);
}

.lunar {
  position: relative;
  z-index: 1;
  margin-top: 2px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--red-deep);
}

.term {
  position: relative;
  z-index: 1;
  margin-top: 3px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* 吉凶 / 水位 */
.verdict {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 2px 0;
  padding: 6px 8px;
  border-radius: 3px;
  background: rgba(192, 32, 28, 0.07);
  font-size: 12px;
  color: var(--red-deep);
}

.verdict .stars {
  letter-spacing: 0.1em;
}

.verdict .grade {
  padding: 1px 8px;
  border-radius: 2px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.verdict .water {
  margin-left: auto;
  color: var(--ink-soft);
}

/* 宜忌 */
.yiji {
  margin: 9px 2px 0;
  padding: 7px 0 6px;
  border-top: 1px solid rgba(192, 32, 28, 0.35);
  border-bottom: 1px solid rgba(192, 32, 28, 0.35);
}

.yiji .line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 3px 0;
  font-size: 13px;
  line-height: 1.7;
}

.yiji b {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.yiji b.yi {
  background: var(--red);
}

.yiji b.ji {
  background: #4b4038;
}
