/* ============================================================
   必应壁纸 · Bing 风格主题
   亮色默认 + 暗色切换（data-theme="dark"）
   ============================================================ */

:root {
  --accent: #00809d;
  --accent-strong: #00607a;
  --bg: #ffffff;
  --bg-soft: #f4f6f8;
  --card: #ffffff;
  --text: #1b1f23;
  --muted: #6b7280;
  --border: #e4e7eb;
  --shadow: 0 6px 24px rgba(16, 24, 40, .10);
  --radius: 12px;
  --nav-h: 58px;
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  --veil: linear-gradient(180deg, rgba(8,16,28,.42) 0%, rgba(8,16,28,.08) 34%, rgba(8,16,28,.72) 100%);
}

html[data-theme="dark"] {
  --bg: #0e151d;
  --bg-soft: #121a24;
  --card: #182230;
  --text: #eef2f6;
  --muted: #93a1b1;
  --border: #273647;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: "Cascadia Code", Consolas, monospace; font-size: .86em; background: var(--bg-soft); padding: .1em .35em; border-radius: 6px; }
pre { padding: 12px 14px; overflow-x: auto; }
.api-cmd { white-space: pre-wrap; word-break: break-all; margin-top: 8px; }
button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

#app { min-height: 100%; }

/* ============ 顶部导航 ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  color: #fff;
  background: linear-gradient(180deg, rgba(6,12,22,.55), rgba(6,12,22,0));
  transition: background .25s;
}
.topbar.solid {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 0 var(--border);
}
.topbar.solid .logo-text, .topbar.solid .main-nav a { color: var(--text); }

.logo { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.logo:hover { text-decoration: none; opacity: .92; }
.logo-mark { color: #fff; }
.topbar.solid .logo-mark { color: var(--accent); }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  color: rgba(255,255,255,.92); font-size: 14px; font-weight: 500;
  padding: 6px 13px; border-radius: 20px; transition: background .2s, color .2s;
}
.main-nav a:hover { background: rgba(255,255,255,.16); text-decoration: none; }
.main-nav a.active { background: rgba(255,255,255,.22); color: #fff; }
.topbar.solid .main-nav a:hover { background: var(--bg-soft); }
.topbar.solid .main-nav a.active { background: var(--accent); color: #fff; }

.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.16); color: #fff; font-size: 16px;
  display: grid; place-items: center; transition: background .2s;
}
.theme-toggle:hover { background: rgba(255,255,255,.28); }
.topbar.solid .theme-toggle { background: var(--bg-soft); color: var(--text); }
.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun { display: inline; }
html[data-theme="dark"] .icon-moon { display: none; }

/* ============ 视图通用 ============ */
.view { min-height: 100vh; padding-top: var(--nav-h); }
.page-head { padding: 40px 20px 4px; max-width: 1280px; margin: 0 auto; }
.page-head h2 { font-size: 26px; font-weight: 700; }
.page-sub { color: var(--muted); margin-top: 4px; font-size: 14px; }

/* ============ 今日视图（全屏 Bing 风） ============ */
.today-view { position: relative; padding-top: 0; min-height: 100vh; color: #fff; }
.today-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center center;
  background-color: #0b1420;
  transition: opacity .45s ease, background-image 0s .45s;
  z-index: 0;
}
.today-bg.fade-in { animation: bgfade .6s ease; }
@keyframes bgfade { from { opacity: .35; } to { opacity: 1; } }
.today-veil { position: absolute; inset: 0; background: var(--veil); z-index: 1; }

.today-info { position: absolute; left: 0; right: 0; bottom: 9%; padding: 0 26px; z-index: 2; animation: rise .6s ease both; }
@keyframes rise { from { transform: translateY(22px); opacity: 0; } to { transform: none; opacity: 1; } }

.today-date {
  display: inline-block; font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  padding: 4px 12px; border-radius: 20px; backdrop-filter: blur(6px);
  margin-bottom: 12px;
}
.today-title { font-size: clamp(26px, 5vw, 46px); font-weight: 700; line-height: 1.15; text-shadow: 0 2px 14px rgba(0,0,0,.4); }
.today-copy { margin-top: 10px; max-width: 620px; font-size: 14px; color: rgba(255,255,255,.9); text-shadow: 0 1px 8px rgba(0,0,0,.45); }

.today-actions { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  padding: 9px 16px; border: 1px solid rgba(255,255,255,.4);
  color: #fff; background: rgba(20,26,36,.18); backdrop-filter: blur(8px);
  transition: background .2s, transform .1s;
}
.btn:hover { background: rgba(255,255,255,.22); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-strong); }
.dl-group { display: flex; gap: 8px; flex-wrap: wrap; }
.dl-group .btn { padding: 9px 12px; font-size: 13px; }

.today-meta { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35);
  background: rgba(20,26,36,.18); color: #fff; font-size: 18px; line-height: 1;
  transition: background .2s;
}
.icon-btn:hover { background: rgba(255,255,255,.25); }
.today-count { font-size: 13px; color: rgba(255,255,255,.85); }

.scroll-hint {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 2; color: rgba(255,255,255,.9); font-size: 13px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  opacity: .9; transition: opacity .2s;
}
.scroll-hint:hover { opacity: 1; text-decoration: none; }
.scroll-hint .chev { font-size: 18px; }

/* ============ 工具栏（搜索/日期） ============ */
.toolbar {
  max-width: 1280px; margin: 22px auto 0; padding: 0 20px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.search-box {
  position: relative; flex: 1; min-width: 240px; max-width: 420px;
  display: flex; align-items: center;
}
.search-ico {
  position: absolute; left: 13px; width: 15px; height: 15px;
  border: 2px solid var(--muted); border-radius: 50%;
}
.search-ico::after {
  content: ""; position: absolute; right: -5px; bottom: -4px;
  width: 7px; height: 2px; background: var(--muted); transform: rotate(45deg);
}
.search-box input {
  width: 100%; padding: 11px 38px 11px 38px; border-radius: 24px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  font-size: 14px; outline: none; transition: border .2s, box-shadow .2s;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,128,157,.14); }
.search-clear {
  position: absolute; right: 10px; border: none; background: none;
  color: var(--muted); font-size: 17px; line-height: 1; padding: 4px;
}
.date-box input {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text); font-size: 14px; outline: none;
}
.date-box input:focus { border-color: var(--accent); }

/* ============ 历史画廊（响应式网格） ============ */
.gallery {
  max-width: 1280px; margin: 22px auto 60px; padding: 0 20px;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--card); box-shadow: var(--shadow); cursor: pointer;
  aspect-ratio: 16 / 10; transition: transform .22s, box-shadow .22s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(16,24,40,.18); }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .card-veil {
  position: absolute; inset: 0; opacity: 0; transition: opacity .22s;
  background: linear-gradient(180deg, rgba(6,12,22,0) 30%, rgba(6,12,22,.82) 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 12px;
}
.card:hover .card-veil, .card:focus-within .card-veil { opacity: 1; }
.card .card-title { color: #fff; font-size: 14px; font-weight: 600; }
.card .card-date { color: rgba(255,255,255,.8); font-size: 12px; margin-top: 2px; }
.card .card-dl {
  position: absolute; top: 10px; right: 10px; z-index: 2; opacity: 0;
  display: flex; gap: 6px; transition: opacity .22s;
}
.card:hover .card-dl { opacity: 1; }
.card .card-dl a {
  background: rgba(10,18,30,.55); color: #fff; border-radius: 7px;
  font-size: 11px; padding: 5px 8px; backdrop-filter: blur(4px);
}
.card .card-dl a:hover { background: var(--accent); text-decoration: none; }

/* 卡片增强：日期角标 + 4K 标签 + 图片放大微动效 */
.card .card-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: rgba(10,18,30,.55); color: #fff; border-radius: 6px;
  font-size: 11px; padding: 4px 8px; backdrop-filter: blur(4px);
  letter-spacing: .3px;
}
.card .card-tag {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  background: var(--accent); color: #fff; border-radius: 5px;
  font-size: 10px; font-weight: 700; padding: 3px 7px; letter-spacing: .5px;
}
.card img { transition: transform .4s ease; }
.card:hover img { transform: scale(1.05); }

/* 加载更多按钮 */
.load-more-wrap { text-align: center; margin: -28px 0 56px; }
.load-more-btn {
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 11px 28px; font-size: 14px; transition: all .2s;
}
.load-more-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.load-more-btn:disabled { opacity: .6; cursor: default; }
.load-more-tip { color: var(--muted); font-size: 12px; margin-top: 8px; }

.state-tip { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 14px; }

/* ============ 灯箱 ============ */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(5,10,18,.94);
  display: flex; align-items: center; justify-content: center;
  animation: lbIn .22s ease;
}
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lb-stage { max-width: 92vw; max-height: 86vh; text-align: center; }
.lb-stage img {
  max-width: 92vw; max-height: 74vh; border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5); object-fit: contain;
}
.lb-cap { color: #fff; margin-top: 14px; }
.lb-title { font-size: 17px; font-weight: 600; }
.lb-copy { color: rgba(255,255,255,.78); font-size: 13px; margin-top: 4px; }
.lb-actions { margin-top: 12px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.lb-actions a.btn { background: rgba(255,255,255,.12); }
.lb-actions a.btn-primary { background: var(--accent); }
.lb-close, .lb-nav {
  position: fixed; border: 1px solid rgba(255,255,255,.3); background: rgba(10,18,30,.5);
  color: #fff; font-size: 20px; border-radius: 50%; width: 42px; height: 42px;
  display: grid; place-items: center; transition: background .2s; z-index: 101;
}
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }

/* ============ API / 关于 ============ */
.api-cards, .about-card {
  max-width: 1280px; margin: 22px auto 0; padding: 0 20px;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.api-card, .about-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.api-card h3 { font-size: 15px; margin-bottom: 10px; }
.api-card code { display: block; margin: 6px 0; word-break: break-all; }
.muted { color: var(--muted); font-size: 13px; margin-top: 8px; }
.api-note { max-width: 1280px; margin: 18px auto 60px; padding: 0 20px; color: var(--muted); font-size: 13px; }
.about-card { display: block; max-width: 900px; margin-bottom: 60px; }
.about-card h3 { margin: 18px 0 8px; font-size: 15px; }
.about-card ul { padding-left: 20px; }
.about-card li { margin: 4px 0; font-size: 14px; }
.about-card hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* ============ 页脚 ============ */
.site-footer {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 26px 20px 34px;
}

/* ============ 响应式 ============ */
@media (max-width: 720px) {
  .topbar { padding: 0 12px; }
  .main-nav a { padding: 5px 9px; font-size: 13px; }
  .today-info { bottom: 7%; padding: 0 16px; }
  .gallery { gap: 10px; grid-template-columns: repeat(2, 1fr); }
  .dl-group .btn { font-size: 12px; padding: 8px 10px; }
  .lb-nav { display: none; }
}
