:root {
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-solid: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --brand: #111111;
  --brand-soft: #f3f4f6;
  --gold: #c99328;
  --good: #0f9d58;
  --good-bg: rgba(15, 157, 88, 0.1);
  --bad: #d93025;
  --bad-bg: rgba(217, 48, 37, 0.1);
  --warn: #b76a10;
  --warn-bg: rgba(245, 158, 11, 0.12);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 24px;
  --radius-sm: 18px;
  --max: 1240px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: Inter, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top left, #ffffff 0%, #f9fafc 34%, #f2f5fb 100%);
}
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.page {
  width: min(calc(100% - 28px), var(--max));
  margin: 18px auto 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #111827, #374151);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-link,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: 0.18s ease;
}

.nav-link:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.nav-link.active,
.btn.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.hero {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-card,
.side-card,
.card {
  padding: 22px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero-title {
  margin: 0 0 8px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
}

.subtext {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.grid,
.cards {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

.card h2,
.card h3,
.panel h2,
.panel h3 {
  margin: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
}

.big-number {
  font-size: clamp(52px, 8vw, 88px);
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.flex {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  font-size: 13px;
}

.tag.block {
  border-radius: 16px;
  min-height: 42px;
}

.tag.good {
  color: var(--good);
  background: var(--good-bg);
  border-color: transparent;
}

.tag.bad {
  color: var(--bad);
  background: var(--bad-bg);
  border-color: transparent;
}

.tag.warn {
  color: var(--warn);
  background: var(--warn-bg);
  border-color: transparent;
}

.stat-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat,
.info-box,
.result-item,
.time-card,
.list-box {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-solid);
  padding: 16px;
}

.stat .label,
.info-box .label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.stat .value,
.info-box .value {
  font-size: 18px;
  line-height: 1.6;
  font-weight: 700;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-grid,
.week-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.weekday {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 0;
}

.day-btn {
  min-height: 76px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: #fff;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.day-btn.muted {
  background: rgba(248, 250, 252, 0.85);
  color: #94a3b8;
}

.day-btn.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 14px 26px rgba(17, 17, 17, 0.22);
}

.day-btn.today {
  border-color: rgba(201, 147, 40, 0.35);
}

.day-solar {
  font-size: 17px;
  font-weight: 700;
}

.day-lunar {
  font-size: 11px;
  opacity: 0.86;
}

.toolbar,
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
  flex: 1 1 180px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.input,
.select {
  width: 100%;
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 12px 14px;
  color: var(--text);
}

.section-note,
.footer-note,
.helper-text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.result-list,
.time-grid {
  display: grid;
  gap: 12px;
}

.result-item {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 180px;
  gap: 14px;
  align-items: start;
}

.result-score {
  display: grid;
  gap: 8px;
}

.score-number {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.result-actions {
  display: grid;
  gap: 8px;
}

.time-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.time-card.good-slot {
  border-color: rgba(15, 157, 88, 0.22);
}

.time-card.bad-slot {
  border-color: rgba(217, 48, 37, 0.22);
}

.code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 18px;
  padding: 14px 16px;
  overflow: auto;
}

ul.clean {
  margin: 0;
  padding-left: 18px;
  line-height: 1.9;
  color: var(--text);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
  border-radius: 999px;
  padding: 12px 16px;
  opacity: 0;
  transition: 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1080px) {
  .hero, .result-item { grid-template-columns: 1fr; }
  .col-8, .col-7, .col-6, .col-5, .col-4, .col-3 { grid-column: span 12; }
}

@media (max-width: 720px) {
  .page { width: min(calc(100% - 18px), var(--max)); margin-top: 10px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav { width: 100%; }
  .nav-link, .btn { flex: 1 1 calc(50% - 10px); }
  .time-grid, .stat-grid, .info-grid { grid-template-columns: 1fr; }
  .day-btn { min-height: 66px; }
}

/* ===== 站点页脚 ===== */
.site-footer {
  margin-top: 28px;
  padding: 26px 22px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff;
}
.footer-brand strong { font-size: 16px; }
.footer-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links a {
  color: var(--muted);
  font-size: 14px;
}
.footer-links a:hover { color: var(--text); }
.footer-copy {
  width: 100%;
  margin: 6px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
