/* ============================================================
 * 中国法定节假日 Demo —— 样式
 * 卡片式布局 · 中国红金配色 · 响应式（手机/桌面）
 * ============================================================ */

:root {
  --red-600: #c8102e;
  --red-700: #a00d25;
  --gold: #f5c518;
  --ink: #1f2329;
  --muted: #6b7280;
  --bg: #f7f5f0;
  --card-border: #efe9df;
  --radius: 18px;
  --shadow: 0 10px 28px rgba(160, 30, 20, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1100px 420px at 50% -120px, rgba(200, 16, 46, 0.10), transparent 70%),
    var(--bg);
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden { display: none !important; }

/* ---------- 页头 ---------- */
.site-header {
  position: relative;
  overflow: hidden;
  padding: 46px 0 58px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #9c0f28 0%, #c8102e 48%, #e03444 100%);
}

.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.site-header::before { width: 260px; height: 260px; top: -110px; left: -70px; }
.site-header::after  { width: 200px; height: 200px; bottom: -90px; right: -40px; }

.site-header h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: 3px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.site-header .subtitle {
  margin: 10px 0 0;
  font-size: 15px;
  letter-spacing: 6px;
  opacity: 0.92;
}

/* ---------- 工具栏（年份切换 + 数据来源） ---------- */
.toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -30px;
}

.year-switch {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 26px rgba(160, 30, 20, 0.12);
}

.year-btn {
  padding: 9px 20px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #555;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
  font-family: inherit;
}

.year-btn:hover { color: var(--red-600); background: #fef2f3; }

.year-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--red-600), #e03444);
  box-shadow: 0 4px 14px rgba(200, 16, 46, 0.35);
}

.source-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--card-border);
  font-size: 13px;
  color: var(--muted);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; flex: none; }
.dot-api   { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18); }
.dot-local { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }

.retry-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px dashed #f0b429;
  background: #fffdf5;
  color: #b45309;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s;
}

.retry-btn:hover { background: #fff7e0; }

/* ---------- 提示条 ---------- */
.notice {
  margin: 18px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #ffd591;
  background: #fff7e6;
  color: #ad6800;
  font-size: 13px;
  line-height: 1.6;
}

/* ---------- 加载中 ---------- */
.loading {
  margin: 0;
  padding: 70px 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.loading::before {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  border: 3px solid #f3d9dc;
  border-top-color: var(--red-600);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 年度统计 ---------- */
.stats-bar {
  display: flex;
  gap: 14px;
  margin: 26px 0 8px;
}

.stat {
  flex: 1;
  padding: 16px 8px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 14px;
}

.stat b {
  display: block;
  font-size: 28px;
  color: var(--red-600);
  line-height: 1.1;
}

.stat span {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- 节假日卡片 ---------- */
.holiday-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.holiday-card {
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.holiday-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(160, 30, 20, 0.14);
}

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

.card-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  border-radius: 13px;
  background: linear-gradient(135deg, #fff1f2, #ffe4e6);
}

.card-name {
  flex: 1;
  margin: 0;
  font-size: 19px;
  letter-spacing: 1px;
}

.card-days {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--red-600), #e03444);
  box-shadow: 0 3px 10px rgba(200, 16, 46, 0.3);
}

.card-days b { font-size: 17px; margin-right: 1px; }

.card-range {
  margin: 15px 0 4px;
  font-size: 16.5px;
  font-weight: 700;
  color: #111;
}

.card-range-full {
  margin: 0 0 13px;
  font-size: 12.5px;
  color: var(--muted);
}

.card-makeup {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding-top: 13px;
  border-top: 1px dashed #eee8de;
}

.makeup-label {
  margin-right: 2px;
  font-size: 12.5px;
  color: var(--muted);
}

.chip {
  padding: 4px 11px;
  border-radius: 999px;
  background: #fef0f1;
  color: var(--red-700);
  font-size: 12.5px;
  font-weight: 600;
}

.chip-none {
  background: #f3f4f6;
  color: #9ca3af;
  font-weight: 400;
}

/* ---------- 全年调休上班日 ---------- */
.makeup-section { margin-top: 34px; }

.makeup-section h2 {
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: 1px;
}

.makeup-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.makeup-item {
  padding: 9px 15px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--card-border);
  font-size: 13.5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
}

.makeup-date { font-weight: 700; color: var(--red-700); }
.makeup-weekday { color: var(--muted); }
.makeup-name { margin-left: 7px; color: var(--muted); font-size: 12.5px; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 46px;
  padding: 26px 0 34px;
  border-top: 1px solid #e9e2d6;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.site-footer a { color: var(--red-600); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .site-header { padding: 34px 0 50px; }
  .site-header h1 { font-size: 25px; letter-spacing: 2px; }
  .site-header .subtitle { font-size: 13px; letter-spacing: 4px; }

  .toolbar { flex-direction: column; align-items: stretch; margin-top: -26px; }
  .year-switch { justify-content: center; }
  .year-btn { padding: 8px 16px; font-size: 14px; }
  .source-area { justify-content: center; }

  .holiday-grid { grid-template-columns: 1fr; }
  .stat b { font-size: 23px; }

  .container { padding: 0 14px; }
  .holiday-card { padding: 18px 16px; }
  .card-name { font-size: 17px; }
}
