/* =====================================================================
   GeekHuang Lab — 极客黄历
   用站点变量（--bg、--surface、--line、--text、--cyan、--ok、--down）。
   样式都收在 .al-page / .al-* 里。
   ===================================================================== */

.al-page {
  min-width: 0;
  padding-block: clamp(28px, 5vw, 64px) clamp(64px, 8vw, 120px);
}

.al-page [hidden] { display: none !important; }

.al-back { display: inline-flex; gap: 8px; color: var(--text-3); margin-bottom: 28px; }
.al-back:hover { color: var(--text); }

/* ---------- 页头 ---------- */
.al-eyebrow { display: flex; align-items: center; gap: 12px; color: var(--text-3); }
.al-eyebrow__rule { flex: 0 1 64px; height: 1px; background: var(--line-2); }
.al-title {
  margin-top: 14px;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.al-intro { margin-top: 14px; max-width: 62ch; color: var(--text-2); }
.al-pill {
  margin-top: 14px;
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

/* ---------- 布局 ---------- */
.al-layout {
  margin-top: clamp(24px, 4vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}
@media (min-width: 960px) {
  .al-layout { grid-template-columns: minmax(300px, 0.92fr) minmax(0, 1.15fr); align-items: start; }
}

.al-card, .al-cal {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(16px, 2.4vw, 24px);
}
#today-card.is-today { border-color: color-mix(in srgb, var(--cyan) 55%, var(--line)); }

.al-page .corner {
  position: absolute; width: 14px; height: 14px; pointer-events: none;
  border: 0 solid var(--line-3);
}
.al-page .corner--tl { top: 8px; left: 8px; border-top-width: 1px; border-left-width: 1px; }
.al-page .corner--br { bottom: 8px; right: 8px; border-bottom-width: 1px; border-right-width: 1px; }

.al-kicker { color: var(--text-3); }
.al-solar {
  margin-top: 8px;
  max-width: 100%;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.al-line { margin-top: 4px; color: var(--text-2); }
.al-line--strong { color: var(--text); font-weight: 600; }
.al-line--cyan { color: var(--cyan); }

/* ---------- 宜 / 忌 ---------- */
.al-cols {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 16px;
  min-width: 0;
}
.al-h {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.al-h--good { color: var(--ok); }
.al-h--bad { color: var(--down); }
.al-list { min-width: 0; }
.al-item {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.al-item strong { font-weight: 600; font-size: 14px; }
.al-item span {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

/* ---------- 幸运色 / 数字 / 方位 ---------- */
.al-meta {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.al-meta div {
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.al-meta dt { color: var(--text-3); font-size: 12px; font-weight: 500; }
.al-meta dd {
  margin: 4px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 16px;
  min-width: 0;
}
.al-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--line-3);
  flex: 0 0 auto;
}
.al-hex {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.al-quote {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border-left: 3px solid var(--cyan);
  color: var(--text);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.al-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.al-actions .btn { flex: 1 1 100%; min-width: 0; }
@media (min-width: 480px) {
  .al-actions .btn { flex: 1 1 calc(50% - 8px); }
}
.al-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.al-actions .btn:disabled:hover {
  transform: none;
  background: transparent;
  box-shadow: none;
}
.al-status { margin-top: 8px; color: var(--down); font-size: 13px; }
.al-status:empty { display: none; }

/* ---------- 月历 ---------- */
.al-cal__title { color: var(--text-2); }
.al-monthbar {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.al-step {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  line-height: 1;
}
.al-step:hover { border-color: var(--line-3); }
.al-step:disabled { opacity: 0.35; cursor: not-allowed; }

.al-select {
  min-width: 0;
  max-width: 100%;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
#year-select { flex: 1.25 1 0; }
#month-select { flex: 0.85 1 0; }

.al-activity {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text-3);
  font-size: 13px;
}
.al-activity .al-select { width: 100%; }

.al-week, .al-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
}
.al-week {
  margin-top: 14px;
  margin-bottom: 4px;
  color: var(--text-3);
  font-size: 12px;
  text-align: center;
}
.al-week span:nth-child(6) { color: var(--warn); }
.al-week span:nth-child(7) { color: var(--down); }

.al-pad { min-width: 0; }

.al-day {
  min-width: 0;
  min-height: 58px;
  padding: 4px 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.al-day:hover { background: var(--surface-2); }
.al-day__n {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.al-day__lunar {
  max-width: 100%;
  font-size: 10px;
  line-height: 1.15;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.al-day__lunar.is-month { color: var(--cyan); font-weight: 600; }
.al-day__mark { font-size: 10px; line-height: 1; font-weight: 700; }
.al-day__mark--good { color: var(--ok); }
.al-day__mark--bad { color: var(--down); }
.al-day__mark--mid { color: var(--text-3); }

.al-day.is-selected { box-shadow: inset 0 0 0 1px var(--line-3); background: var(--surface-2); }
.al-day.is-today,
.al-day.is-today:hover {
  background: var(--cyan-soft);
  box-shadow: inset 0 0 0 1.5px var(--cyan);
}
.al-day.is-today.is-selected { box-shadow: inset 0 0 0 2px var(--cyan); }

.al-hint {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.6;
}

.al-disclaimer {
  margin-top: 28px;
  color: var(--text-3);
  font-size: 12px;
}

/* ---------- 分享预览 ---------- */
.al-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 16px;
  min-width: 0;
}
.al-modal[hidden] { display: none !important; }
.al-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 11, 20, 0.72);
}
[data-theme="light"] .al-modal__backdrop { background: rgba(11, 16, 32, 0.42); }
.al-modal__panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.al-modal__panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
}
#share-preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.al-modal__actions {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding-top: 12px;
  background: var(--surface);
}
.al-file {
  margin-bottom: 8px;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.al-modal__row { display: flex; flex-wrap: wrap; gap: 8px; }
.al-modal__row .btn { flex: 1 1 120px; min-width: 0; }

/* 窄屏再收一档，避免 390 宽出现横向滚动 */
@media (max-width: 480px) {
  .al-card, .al-cal { padding: 14px; }
  .al-grid, .al-week { gap: 2px; }
  .al-day { min-height: 50px; padding: 3px 0; }
  .al-day__n { font-size: 14px; }
  .al-cols { gap: 8px 10px; }
  .al-meta { gap: 6px; }
  .al-meta div { padding: 8px 6px; }
  .al-meta dd { font-size: 15px; }
}
