/* 必应每日壁纸 — 深色主题样式（零构建，随 public/ 直接部署） */

:root {
  --bg: #0b0f17;
  --bg-soft: #111827;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.1);
  --text: #e5e9f0;
  --text-dim: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(56, 189, 248, 0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(129, 140, 248, 0.12), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ---------- 头部 ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 18px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #818cf8);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.7);
}
.brand-text h1 { font-size: 1.35rem; letter-spacing: 0.02em; }
.brand-text p { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }

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

button, .ghost-btn, .primary-btn {
  font: inherit;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
button:not(:disabled):active { transform: scale(0.97); }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; color: var(--text);
  background: var(--card); border: 1px solid var(--card-border);
  backdrop-filter: blur(8px);
}
.ghost-btn:not(:disabled):hover { background: rgba(255, 255, 255, 0.12); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3); }

.primary-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; color: #04121d; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: none;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
}
.primary-btn:hover { box-shadow: 0 8px 26px rgba(14, 165, 233, 0.5); transform: translateY(-1px); }

.month-picker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text-dim);
}
.month-select {
  font: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 10px; padding: 8px 10px; outline: none;
  cursor: pointer;
  max-width: 60vw;
}
.month-select:focus { border-color: var(--accent); }
.month-select:hover { background: rgba(255, 255, 255, 0.1); }
.month-select option { background: var(--bg-soft); color: var(--text); }

/* ---------- 网格 ---------- */
.gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-border);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}
.card img {
  display: block; width: 100%;
  aspect-ratio: 16 / 9; object-fit: cover;
  background: var(--bg-soft);
}
.card figcaption { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; }
.card .card-title { font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .card-date { font-size: 0.75rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.card.skeleton { cursor: default; }
.card .thumb { width: 100%; aspect-ratio: 16 / 9; }
.line { display: block; height: 12px; border-radius: 6px; margin-top: 10px; width: 80%; background: rgba(255,255,255,.08); }
.line.short { width: 40%; margin-top: 6px; }
.shimmer {
  background-image: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.12) 37%, rgba(255,255,255,.05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.error-panel { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--text-dim); }
.error-panel strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 8px; }
.error-panel button { margin-top: 16px; }

/* ---------- 大图预览 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  background: rgba(4, 7, 12, 0.82);
  backdrop-filter: blur(14px);
}
.lightbox[hidden] { display: none; }
.lb-body {
  position: relative;
  display: flex; flex-direction: column;
  max-width: min(1100px, 94vw); max-height: 90vh;
  animation: lb-in 0.22s ease;
}
@keyframes lb-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.lb-body img {
  max-width: 100%; max-height: calc(90vh - 130px);
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg-soft);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transition: opacity 0.2s ease;
}
.lb-spinner { position: absolute; inset: 0; display: grid; place-items: center; }
.lb-spinner::after {
  content: ""; width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.lb-caption {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 14px; margin-top: 16px;
}
.lb-meta h2 { font-size: 1.08rem; margin-bottom: 4px; }
.lb-meta p { font-size: 0.82rem; color: var(--text-dim); max-width: 520px; }
.lb-date { font-variant-numeric: tabular-nums; }
.lb-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.res-select { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-dim); }
.res-select select {
  font: inherit; color: var(--text);
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 10px; padding: 8px 10px; outline: none;
}
.res-select select:focus { border-color: var(--accent); }

.lb-close, .lb-nav {
  position: fixed; z-index: 51;
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border: 1px solid var(--card-border); border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text); font-size: 1.5rem; line-height: 1;
}
.lb-close { top: 20px; right: 20px; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 1.9rem; padding-bottom: 4px; }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-close:hover, .lb-nav:hover { background: rgba(56, 189, 248, 0.25); }

/* ---------- 页脚 / 提示 ---------- */
.site-footer {
  max-width: 1200px; margin: 0 auto;
  padding: 10px 24px 36px;
  text-align: center; color: var(--text-dim); font-size: 0.78rem; line-height: 1.9;
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  z-index: 60; padding: 10px 20px; border-radius: 999px;
  background: rgba(220, 38, 38, 0.92); color: #fff;
  font-size: 0.88rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .site-header { flex-direction: column; align-items: flex-start; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding-inline: 14px; }
  .lb-nav { display: none; }
  .lb-caption { flex-direction: column; align-items: flex-start; }
}
