/* ==========================================================================
   必应每日壁纸 · 样式表
   设计基调：浅色主题、大图主导、留白充足；Hero 使用深色蒙版保证文字对比度。
   响应式断点：1080px（桌面） / 820px（平板） / 560px（手机）
   ========================================================================== */

/* ---------------------------- 设计令牌 ---------------------------- */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --surface-3: #e4e9f0;
  --border: #e1e6ee;
  --border-strong: #cfd7e3;

  --text: #131720;
  --text-2: #566072;
  --text-3: #8b95a7;

  --accent: #1a73e8;
  --accent-hover: #1666cf;
  --accent-soft: #e8f1fe;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05), 0 1px 3px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 4px 14px rgba(17, 24, 39, 0.07), 0 2px 5px rgba(17, 24, 39, 0.04);
  --shadow-lg: 0 24px 48px rgba(13, 20, 33, 0.18);

  --container: 1320px;
  --header-h: 64px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------------------------- 基础重置 ---------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

/*
 * 关键：hidden 属性必须能真正隐藏元素。
 * 浏览器默认样式里 [hidden] 是 display:none，但它的优先级低于作者写的类选择器
 * （例如 .grid { display: grid }），会导致 element.hidden = true 失效——
 * 视图切换时两个容器会同时显示。这里统一兜底，避免同类问题反复出现。
 */
[hidden] {
  display: none !important;
}

button,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* 统一的键盘焦点样式：只在键盘操作时出现，不影响鼠标点击观感 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 10px 16px;
  background: var(--surface);
  border-radius: 0 0 var(--radius-sm) 0;
  box-shadow: var(--shadow-md);
}
.skip-link:focus {
  left: 0;
}

/* ---------------------------- 顶部导航 ---------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  color: #fff;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease),
    box-shadow 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}

/* 滚动离开 Hero 后切换为实心浅色导航 */
.site-header.is-solid {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  color: var(--text);
  box-shadow: 0 1px 0 var(--border), 0 6px 18px rgba(17, 24, 39, 0.05);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(6px);
  flex: none;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.site-header.is-solid .brand__mark {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}
.brand__text strong {
  font-size: 15.5px;
  font-weight: 650;
  white-space: nowrap;
}
.brand__text small {
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.site-header.is-solid .sync-badge {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--text-2);
}

.sync-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
  flex: none;
}
.sync-badge.is-busy .sync-badge__dot {
  background: #fbbf24;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.22);
  animation: pulse 1.2s ease-in-out infinite;
}
.sync-badge.is-error .sync-badge__dot {
  background: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.22);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background-color 0.3s var(--ease), transform 0.3s var(--ease),
    border-color 0.3s var(--ease);
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}
.icon-btn:active {
  transform: scale(0.94);
}
.site-header.is-solid .icon-btn {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--text-2);
}
.site-header.is-solid .icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}
.icon-btn.is-busy svg {
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------- Hero 主视觉 ---------------------------- */
.hero {
  position: relative;
  /* 移动端用 dvh 避免浏览器工具栏导致的高度跳动 */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #0b1220;
  isolation: isolate;
}

/* 模糊底层：用缩略图做模糊放大的底色，大图未到时也有画面，避免白屏 */
.hero__bg {
  position: absolute;
  inset: -40px;
  background-color: #0b1220;
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.25);
  transform: scale(1.06);
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.hero__bg.is-ready {
  opacity: 0.75;
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 1s var(--ease), transform 6s var(--ease);
  /* 兜底：万一脚本异常没能加上 .is-ready，4.5 秒后也强制显示，
     避免主视觉一直停在透明状态（动画优先级高于类声明，不会冲突） */
  animation: heroRevealFallback 0s linear 4.5s forwards;
}
.hero__img.is-ready {
  opacity: 1;
  transform: scale(1);
}

@keyframes heroRevealFallback {
  to {
    opacity: 1;
  }
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 12, 22, 0.62) 0%, rgba(6, 12, 22, 0.08) 34%,
      rgba(6, 12, 22, 0.46) 66%, rgba(6, 12, 22, 0.88) 100%),
    linear-gradient(90deg, rgba(6, 12, 22, 0.45) 0%, rgba(6, 12, 22, 0) 62%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: clamp(72px, 12vh, 132px);
  padding-top: calc(var(--header-h) + 40px);
  color: #fff;
  max-width: var(--container);
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.chip--ghost {
  background: rgba(255, 255, 255, 0.07);
  font-weight: 450;
  color: rgba(255, 255, 255, 0.86);
}

.hero__title {
  font-size: clamp(28px, 5.2vw, 60px);
  font-weight: 700;
  letter-spacing: -0.025em;
  max-width: 20ch;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.36);
  margin-bottom: 12px;
}

.hero__place {
  font-size: clamp(14px, 1.5vw, 17.5px);
  color: rgba(255, 255, 255, 0.88);
  max-width: 62ch;
  margin: 0 0 28px;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.34);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-bottom: 22px;
}

.hero__copyright {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.62);
  margin: 0;
  max-width: 70ch;
}

/* 底部滚动提示 */
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: 22px;
  height: 34px;
  border: 1.6px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  z-index: 2;
  display: grid;
  justify-items: center;
  padding-top: 6px;
}
.hero__scroll span {
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.8);
  animation: scrollDot 1.9s var(--ease) infinite;
}
@keyframes scrollDot {
  0% { transform: translateY(0); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}

/* ---------------------------- 按钮 ---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.22s var(--ease), background-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease), border-color 0.22s var(--ease), opacity 0.22s var(--ease);
}
.btn:active {
  transform: scale(0.975);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 22px rgba(26, 115, 232, 0.28);
}
.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 10px 26px rgba(26, 115, 232, 0.34);
}

.btn--glass {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn--glass:hover {
  background: rgba(255, 255, 255, 0.26);
}

.btn--outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--outline:hover {
  background: var(--surface-2);
}

/* ---------------------------- 历史区 ---------------------------- */
.history {
  padding: clamp(44px, 7vw, 82px) 0 clamp(60px, 9vw, 110px);
  scroll-margin-top: var(--header-h);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.toolbar__intro h2 {
  font-size: clamp(22px, 3vw, 31px);
  font-weight: 680;
  letter-spacing: -0.022em;
}
.toolbar__sub {
  margin: 7px 0 0;
  color: var(--text-2);
  font-size: 14px;
}

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

.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 3px;
  background: var(--surface-2);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.segmented__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 520;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}
.segmented__btn:hover {
  color: var(--text);
}
.segmented__btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.range-picker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 6px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-2);
}
.range-picker select {
  border: none;
  background: var(--surface-2);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13.5px;
  cursor: pointer;
  outline: none;
}

/* ---------------------------- 网格视图 ---------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  padding: 0;
  text-align: left;
  transition: transform 0.34s var(--ease), box-shadow 0.34s var(--ease),
    border-color 0.34s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  overflow: hidden;
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s var(--ease), transform 0.7s var(--ease);
}
.card__img.is-loaded {
  opacity: 1;
}
.card:hover .card__img {
  transform: scale(1.055);
}

.card__badge {
  position: absolute;
  top: 11px;
  left: 11px;
  padding: 4.5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(9, 14, 24, 0.62);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.card__badge--today {
  background: var(--accent);
}

.card__zoom {
  position: absolute;
  right: 11px;
  bottom: 11px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(9, 14, 24, 0.55);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.card:hover .card__zoom,
.card:focus-visible .card__zoom {
  opacity: 1;
  transform: translateY(0);
}

.card__body {
  padding: 15px 16px 17px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card__title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.008em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__place {
  font-size: 12.8px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  line-height: 1.3;
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
}

.card__date {
  font-size: 12.3px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------- 日历视图 ---------------------------- */
.calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(292px, 1fr));
  gap: clamp(16px, 2vw, 24px);
}

.month {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.month__title {
  font-size: 15.5px;
  font-weight: 650;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.month__title small {
  font-weight: 450;
  color: var(--text-3);
  font-size: 12.5px;
}

.month__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.month__weekday {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  padding-bottom: 7px;
  font-weight: 550;
}

.day {
  position: relative;
  aspect-ratio: 1;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--surface-2);
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  cursor: default;
  padding: 0;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.day--empty {
  background: transparent;
}

.day--has {
  cursor: pointer;
  color: #fff;
  border-color: rgba(9, 14, 24, 0.14);
  box-shadow: var(--shadow-sm);
}
.day--has:hover {
  transform: scale(1.07);
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.day__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.day__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 12, 22, 0.5) 0%, rgba(6, 12, 22, 0) 45%,
    rgba(6, 12, 22, 0.62) 100%);
}

.day__num {
  position: relative;
  z-index: 1;
  align-self: start;
  justify-self: start;
  padding: 3px 0 0 5px;
  font-weight: 600;
  font-size: 11.5px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.day--today {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.day__hint {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  font-size: 8.5px;
  text-align: center;
  padding-bottom: 2px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
}

/* ---------------------------- 空状态 ---------------------------- */
.empty {
  text-align: center;
  padding: 74px 24px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.empty__icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-3);
}
.empty h3 {
  font-size: 18.5px;
  margin-bottom: 8px;
}
.empty p {
  color: var(--text-2);
  margin: 0 0 22px;
  font-size: 14.5px;
}

/* 加载骨架 */
.skeleton-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.skeleton-card__media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skeleton-card__line {
  height: 12px;
  margin: 15px 16px;
  border-radius: 6px;
  background: var(--surface-2);
}
.skeleton-card__line--short {
  width: 45%;
  margin-top: -4px;
}
@keyframes shimmer {
  0% { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}

/* ---------------------------- 页脚 ---------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 30px 0;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-footer p {
  margin: 0;
  font-size: 12.8px;
  color: var(--text-3);
  max-width: 78ch;
}
.site-footer__meta {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------------------------- 灯箱 ---------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 40px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.28s var(--ease);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox__panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(300px, 0.85fr);
  width: min(1440px, 100%);
  max-height: min(90dvh, 900px);
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: panelIn 0.34s var(--ease);
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lightbox__figure {
  position: relative;
  margin: 0;
  background: #0b1220;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  overflow: hidden;
}
.lightbox__figure img {
  width: 100%;
  height: 100%;
  max-height: min(90dvh, 900px);
  object-fit: contain;
}

.lightbox__caption {
  position: absolute;
  left: 16px;
  bottom: 14px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
  max-width: 70%;
}

.lightbox__info {
  padding: clamp(22px, 2.6vw, 34px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--surface);
}

.lightbox__head h3 {
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 670;
  letter-spacing: -0.018em;
}
.lightbox__date {
  margin: 7px 0 0;
  font-size: 13.5px;
  color: var(--accent);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
}

.lightbox__desc {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.72;
}

.meta-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-top: 17px;
  border-top: 1px solid var(--border);
}
.meta-list > div {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: start;
}
.meta-list dt {
  font-size: 12.5px;
  color: var(--text-3);
  padding-top: 1px;
}
.meta-list dd {
  margin: 0;
  font-size: 13.2px;
  color: var(--text);
  word-break: break-word;
}

.lightbox__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

.lightbox__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(9, 14, 24, 0.5);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.lightbox__close:hover {
  background: rgba(9, 14, 24, 0.74);
  transform: rotate(90deg);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(9, 14, 24, 0.44);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.25s var(--ease), opacity 0.25s var(--ease);
}
.lightbox__nav:hover {
  background: rgba(9, 14, 24, 0.7);
}
.lightbox__nav[disabled] {
  opacity: 0.28;
  cursor: not-allowed;
}
/* 按钮位于 .lightbox__figure 内部，因此左右定位即贴合图片边缘 */
.lightbox__nav--prev {
  left: 14px;
}
.lightbox__nav--next {
  right: 14px;
}

/* ---------------------------- 轻提示 ---------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(14px);
  z-index: 200;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(19, 23, 32, 0.94);
  color: #fff;
  font-size: 13.8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
  max-width: min(90vw, 460px);
  text-align: center;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast[hidden] {
  display: none;
}

/* ==========================================================================
   响应式
   ========================================================================== */

/* 平板：灯箱改为上下布局 */
@media (max-width: 1080px) {
  .lightbox__panel {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.25fr) minmax(0, auto);
    max-height: 92dvh;
  }
  .lightbox__figure img {
    max-height: 46dvh;
    object-fit: contain;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  }
}

/* 手机 */
@media (max-width: 820px) {
  :root {
    --header-h: 58px;
  }

  .brand__text small {
    display: none;
  }

  .hero {
    align-items: flex-end;
  }
  .hero__content {
    padding-bottom: clamp(56px, 10vh, 84px);
  }
  .hero__title {
    max-width: 16ch;
  }
  .hero__place {
    margin-bottom: 22px;
  }
  .hero__actions .btn {
    flex: 1 1 auto;
    min-width: 132px;
  }
  .hero__scroll {
    display: none;
  }

  .toolbar {
    align-items: stretch;
    gap: 16px;
  }
  .toolbar__controls {
    width: 100%;
    justify-content: space-between;
  }
  .segmented {
    flex: 1 1 auto;
    justify-content: space-between;
  }
  .segmented__btn {
    flex: 1;
    justify-content: center;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 13px;
  }
  .card__body {
    padding: 12px 13px 14px;
  }
  .card__title {
    font-size: 13.8px;
  }
  .card__place {
    font-size: 12px;
    min-height: 2.5em;
  }

  .calendar {
    grid-template-columns: 1fr;
  }

  .lightbox {
    padding: 0;
    align-items: stretch;
  }
  .lightbox__panel {
    border-radius: 0;
    max-height: 100dvh;
    height: 100dvh;
    grid-template-rows: minmax(0, 1fr) auto;
  }
  .lightbox__figure img {
    max-height: 100%;
  }
  .lightbox__info {
    max-height: 56dvh;
    border-top: 1px solid var(--border);
  }
  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 小屏微调 */
@media (max-width: 560px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }
  .card__zoom {
    display: none;
  }
  .card__place {
    display: none;
  }
  .card__body {
    gap: 4px;
  }
  .sync-badge {
    padding: 6px 10px;
    font-size: 11.5px;
  }
  .month {
    padding: 14px;
  }
  .month__grid {
    gap: 4px;
  }
  .range-picker {
    padding-left: 12px;
  }
}

/* 尊重「减少动态效果」的系统偏好 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 打印：只保留网格内容 */
@media print {
  .site-header,
  .hero__actions,
  .toolbar__controls,
  .lightbox,
  .toast {
    display: none !important;
  }
  .hero {
    min-height: 320px;
  }
  .card {
    break-inside: avoid;
  }
}
