/* ============================================================
   style.css —— 响应式布局
   手机: 单列，照片在上、倒计时在下
   桌面: 左照片 右倒计时（宽屏时）
   ============================================================ */

:root {
  --bg: #141420;
  --bg-soft: #1c1c2c;
  --ink: #f2ecf4;
  --ink-dim: rgba(242, 236, 244, 0.62);
  --accent: #fd637d;          /* 原版粉 */
  --accent-2: #9d7bff;
  --card: rgba(255, 255, 255, 0.055);
  --card-line: rgba(255, 255, 255, 0.12);
  --radius: 18px;
  /* 安全区：刘海/手势条 */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(157, 123, 255, 0.16), transparent 60%),
    radial-gradient(1000px 600px at -10% 110%, rgba(253, 99, 125, 0.14), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.8;
}

.layout {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: calc(20px + var(--safe-top)) 18px calc(16px + var(--safe-bottom));
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ---------------- 照片轮播 ---------------- */

.slideshow {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-soft);
  border: 1px solid var(--card-line);
  /* 移动端约 4:3，桌面 16:9 */
  aspect-ratio: 4 / 3;
  max-height: 72vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 900ms ease;
  will-change: opacity;
}
.slide.is-active { opacity: 1; }

.slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;     /* 裁切填满，各屏比例都不变形 */
  display: block;
}

.slide__blur {
  filter: blur(22px) saturate(1.1);
  transform: scale(1.15);   /* 遮住模糊边缘 */
  opacity: 1;
}

.slide__main {
  transition: opacity 700ms ease 120ms;
}

.slideshow--empty { cursor: default; }
.empty-hint {
  position: absolute; inset: 0;
  display: grid; place-content: center;
  text-align: center;
  color: var(--ink-dim);
  font-size: clamp(15px, 2.6vw, 19px);
  line-height: 1.9;
  margin: 0;
  padding: 20px;
}
.empty-hint code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: rgba(255,255,255,0.08);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.86em;
}
.empty-sub { font-size: 0.82em; opacity: 0.75; }

/* 指示点 */
.dots {
  position: absolute;
  left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  gap: 7px;
  z-index: 2;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  transition: all 300ms ease;
}
.dot.is-active {
  width: 20px;
  border-radius: 5px;
  background: var(--accent);
}

/* ---------------- 倒计时 ---------------- */

.timers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-content: start;
}

.timer {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 18px 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.timer__title {
  margin: 0 0 4px;
  font-size: clamp(19px, 3.4vw, 24px);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.timer__prefix {
  color: var(--ink-dim);
  font-weight: 400;
  font-size: 0.8em;
  margin-right: 4px;
}
.timer__name { color: var(--ink); }

.timer__sub {
  margin: 0 0 10px;
  color: var(--ink-dim);
  font-size: 13px;
}

.timer__row {
  display: flex;
  gap: clamp(10px, 3vw, 26px);
  margin-top: 6px;
}

.cell { display: flex; flex-direction: column; align-items: center; min-width: 44px; }
.cell__n {
  font-size: clamp(34px, 8vw, 52px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--accent);
  font-variant-numeric: tabular-nums;   /* 等宽数字，跳秒不抖 */
  font-feature-settings: "tnum";
}
.cell:first-child .cell__n { color: var(--ink); }
.cell__u {
  font-style: normal;
  font-size: 12px;
  color: var(--ink-dim);
  margin-top: 3px;
  letter-spacing: 0.12em;
}

/* ---------------- 页脚 ---------------- */

.foot {
  text-align: center;
  color: var(--ink-dim);
  font-size: 12px;
  padding: 10px 0 calc(14px + var(--safe-bottom));
  letter-spacing: 0.2em;
  z-index: 1;
}

/* ============================================================
   断点
   ============================================================ */

/* ≥640px: 轮播更接近 16:9 */
@media (min-width: 640px) {
  .slideshow { aspect-ratio: 16 / 10; }
}

/* ≥980px: 双栏 —— 左照片 右计时 */
@media (min-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 7fr) minmax(300px, 4fr);
    align-items: start;
    gap: 26px;
    padding-top: calc(48px + var(--safe-top));
  }
  .slideshow {
    aspect-ratio: auto;
    height: min(78vh, 860px);
    position: sticky;
    top: calc(32px + var(--safe-top));
  }
  .timers { grid-template-columns: 1fr; gap: 16px; }
  .timer { padding: 22px 26px; }
}

/* 横屏矮屏（手机横放）: 压缩纵向 */
@media (max-height: 520px) and (orientation: landscape) {
  .slideshow { aspect-ratio: 16 / 9; max-height: 46vh; }
  .layout { padding-top: 12px; gap: 12px; }
  .timers { grid-template-columns: repeat(3, 1fr); }
  .cell__n { font-size: 30px; }
  .timer { padding: 12px 14px; }
}

/* 尊重系统"减少动态效果" */
@media (prefers-reduced-motion: reduce) {
  .slide, .slide__main, .dot { transition: none !important; }
}
