/* =====================================================================
   almanac.css —— 首页今日条 + 万年历月历
   颜色全部走 tokens.css 的变量；深色模式在本文件末尾统一覆写，
   不写进 dark.css —— 这块是新组件，改动集中在一处更好维护。
   ===================================================================== */

/* ---------------- 今日条 ---------------- */
.al-host { margin-bottom: 12px; }

.al-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-lg);
  background: var(--glass-float);
  -webkit-backdrop-filter: var(--blur-surface);
  backdrop-filter: var(--blur-surface);
  box-shadow: var(--sh-1), var(--rim);
  font-family: var(--font-ui);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s var(--spring);
}
.al-bar:active { transform: scale(.985); }

/* 左边大号日期：一眼看清「今天几号」 */
.al-d {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  padding-right: 11px;
  border-right: 1px solid var(--glass-line-soft);
}
.al-d b {
  font-family: var(--font-num);
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.al-d i {
  margin-top: 3px;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--ink-3);
}

.al-m {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.al-l1 {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
}
.al-l1 em {
  flex: none;
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1px;
  padding: 1.5px 5px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.al-l1 em.fest { background: rgba(255, 59, 48, .11); color: #E23A31; }
.al-l1 em.hol.off { background: rgba(255, 59, 48, .13); color: #E23A31; }
.al-l1 em.hol.work { background: rgba(120, 130, 160, .14); color: var(--ink-3); }

.al-l2 {
  font-size: 10.5px;
  line-height: 1.2;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.al-yj {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 1px;
  font-size: 10.5px;
  line-height: 1.2;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
}
.al-yj i {
  flex: none;
  font-style: normal;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  padding: 1px 3.5px;
  border-radius: 4px;
}
.al-yj i.y { background: linear-gradient(150deg, #5ACFA4, #1E9B76); }
.al-yj i.j { background: linear-gradient(150deg, #FF8E97, #DE5769); margin-left: 2px; }
.al-yj u {
  text-decoration: none;
  color: var(--ink-2);
}

.al-go {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--ink-3);
}
.al-go b {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: var(--brand-shadow);
}
.al-go b svg { width: 15px; height: 15px; }
.al-go i {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .2px;
}

/* ---------------- 月历 ---------------- */
.al-sheet .sheet-body { padding: 0 12px 6px; }

.al-sh-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 8px;
}
.al-nav {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: rgba(120, 130, 160, .11);
  color: var(--ink-2);
  cursor: pointer;
  transition: transform .14s var(--spring);
}
.al-nav:active { transform: scale(.9); }
.al-nav svg { width: 15px; height: 15px; }

.al-sh-tt { flex: 1 1 auto; text-align: center; min-width: 0; }
.al-sh-tt b {
  display: block;
  font-size: 15.5px;
  font-weight: 750;
  letter-spacing: -.2px;
  color: var(--ink);
}
.al-sh-tt span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.al-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 0 0 4px;
}
.al-week span {
  text-align: center;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--ink-3);
}
.al-week span:first-child,
.al-week span:last-child { color: var(--ink-4); }

.al-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  transition: transform .2s var(--ease);
  will-change: transform;
  touch-action: pan-y;
}

.al-c {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .16s var(--ease);
}
.al-c:active { background: rgba(120, 130, 160, .13); }
.al-c b {
  font-family: var(--font-num);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.al-c em {
  margin-top: 2.5px;
  font-style: normal;
  font-size: 8.5px;
  line-height: 1;
  color: var(--ink-3);
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}
.al-c em.fest { color: #E23A31; font-weight: 650; }
.al-c em.term { color: #1E9B76; font-weight: 650; }

.al-c s {
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  padding: 1px 2px;
  border-radius: 3px;
}
.al-c s.off { color: #E23A31; background: rgba(255, 59, 48, .12); }
.al-c s.work { color: var(--ink-3); background: rgba(120, 130, 160, .16); }

.al-c.out { opacity: .34; }

/* 今天：描边 + 品牌色数字，和「选中」区分开 ——
   选中是实心块，今天是空心环，两者可以同时出现（回到今天时就是叠加态） */
.al-c.today b { color: var(--brand); font-weight: 800; }
.al-c.today::after {
  content: '';
  position: absolute;
  inset: 1px;
  border: 1.4px solid var(--brand);
  border-radius: 12px;
  opacity: .5;
  pointer-events: none;
}
.al-c.sel { background: var(--brand-grad); box-shadow: var(--brand-shadow); }
.al-c.sel b,
.al-c.sel em,
.al-c.sel s { color: #fff; }
.al-c.sel em { opacity: .82; }
.al-c.sel.today::after { display: none; }

/* ---------------- 详情 ---------------- */
.al-det {
  margin-top: 10px;
  padding: 12px 13px 11px;
  border-radius: var(--r-md);
  background: rgba(120, 130, 160, .07);
}

.al-det-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.al-det-d { display: flex; align-items: baseline; gap: 6px; }
.al-det-d b { font-size: 16px; font-weight: 750; letter-spacing: -.2px; color: var(--ink); }
.al-det-d span { font-size: 11px; color: var(--ink-3); }
.al-det-rel {
  flex: none;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--brand);
  padding: 2px 7px;
  border-radius: 7px;
  background: var(--brand-soft);
}

.al-det-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.al-det-tags:empty { display: none; }
.al-det-tags .tg {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}
.al-det-tags .tg.off { color: #E23A31; background: rgba(255, 59, 48, .12); }
.al-det-tags .tg.work { color: var(--ink-3); background: rgba(120, 130, 160, .16); }
.al-det-tags .tg.fest { color: #E23A31; background: rgba(255, 59, 48, .1); }
.al-det-tags .tg.term { color: #1E9B76; background: rgba(30, 155, 118, .12); }

.al-det-ln1 {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.al-det-ln1 b { font-size: 13px; font-weight: 700; color: var(--ink); }
.al-det-ln1 span { font-size: 10.5px; color: var(--ink-3); }

.al-det-ln2 {
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-3);
}
.al-det-ln2 em {
  font-style: normal;
  font-weight: 700;
  margin-right: 2px;
}
.al-det-ln2 em.good { color: #1E9B76; }
.al-det-ln2 em.bad { color: #E2703A; }

.al-det-yj { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.al-det-yj .rv { display: flex; gap: 7px; align-items: flex-start; }
.al-det-yj .rv i {
  flex: none;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
}
.al-det-yj .rv.yi i { background: linear-gradient(150deg, #5ACFA4, #1E9B76); }
.al-det-yj .rv.ji i { background: linear-gradient(150deg, #FF8E97, #DE5769); }
.al-det-yj .rv span {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.al-det-tip {
  margin-top: 9px;
  font-size: 9.5px;
  color: var(--ink-4);
  letter-spacing: .1px;
}
.al-det-empty { padding: 14px 0; text-align: center; font-size: 12px; color: var(--ink-3); }

/* ---------------- 深色 ---------------- */
html[data-theme="dark"] .al-bar {
  background: linear-gradient(140deg, rgba(52, 60, 92, .52), rgba(24, 28, 44, .68));
  border-color: rgba(255, 255, 255, .09);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}
html[data-theme="dark"] .al-d { border-right-color: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .al-l1 em { background: rgba(110, 155, 255, .16); color: #9EB8FF; }
html[data-theme="dark"] .al-l1 em.fest,
html[data-theme="dark"] .al-l1 em.hol.off { background: rgba(255, 96, 86, .18); color: #FF9A92; }
html[data-theme="dark"] .al-l1 em.hol.work { background: rgba(255, 255, 255, .09); color: var(--ink-3); }
html[data-theme="dark"] .al-c:active { background: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .al-nav { background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .al-det { background: rgba(255, 255, 255, .05); }
html[data-theme="dark"] .al-c s.off { background: rgba(255, 96, 86, .2); color: #FF9A92; }
html[data-theme="dark"] .al-c s.work { background: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .al-det-tags .tg.off,
html[data-theme="dark"] .al-det-tags .tg.fest { background: rgba(255, 96, 86, .18); color: #FF9A92; }
html[data-theme="dark"] .al-det-tags .tg.term { background: rgba(30, 200, 150, .16); color: #58D6AE; }
html[data-theme="dark"] .al-det-tags .tg.work { background: rgba(255, 255, 255, .1); }
html[data-theme="dark"] .al-c em.fest { color: #FF9A92; }
html[data-theme="dark"] .al-c em.term { color: #58D6AE; }
html[data-theme="dark"] .al-c.today b { color: #9EB8FF; }
html[data-theme="dark"] .al-c.today::after { border-color: #9EB8FF; }
html[data-theme="dark"] .al-det-rel { background: rgba(110, 155, 255, .16); color: #9EB8FF; }

/* 小屏（≤ 700px 高）：月历优先保证「网格 + 详情」同屏可见，
   格子压到 38px、详情收紧一点，仍保留 44px 的点击热区之外的视觉留白。 */
.al-sheet { max-height: 94vh; }
@media (max-height: 700px) {
  .al-c { height: 38px; }
  .al-c b { font-size: 13.5px; }
  .al-c em { font-size: 8px; margin-top: 2px; }
  .al-det { margin-top: 8px; padding: 10px 12px 9px; }
  .al-det-ln1 { margin-top: 7px; }
  .al-det-yj { margin-top: 6px; gap: 4px; }
  .al-det-yj .rv span { font-size: 11px; line-height: 1.5; }
  .al-det-tip { margin-top: 7px; }
  .al-sh-hd { padding-bottom: 6px; }
  .al-grid { gap: 0; }
  .al-week { padding-bottom: 2px; }
}
