/* ============================================
   光遇 · 每日蜡烛位置 — 主题样式
   主题：云野晨光 · 浅色模式
   ============================================ */

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* 光遇主题色（蓝） */
  --sky-dark: #e9eefa;
  --sky-mid: #dfe6f5;
  --sky-light: #eef3fb;
  --candle-glow: #0080F8;
  --candle-warm: #0066CC;
  --candle-soft: #99CCFF;
  --cloud-white: #ffffff;

  --text-primary: #1b2540;
  --text-secondary: #5a6480;
  --text-muted: #93a0bd;

  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(27, 50, 90, 0.12);
  --card-hover: rgba(0, 128, 248, 0.06);

  --error-red: #e03131;
  --error-bg: rgba(224, 49, 49, 0.1);
  --success-green: #2f9e44;
  --shadow-color: rgba(20, 50, 100, 0.12);

  --radius: 16px;
  --radius-sm: 10px;
  --nav-height: 60px;

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--sky-dark);
}

/* ---------- 浅色背景 ---------- */
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 15% 18%, rgba(0, 128, 248, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 12%, rgba(120, 160, 255, 0.08) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 95%, rgba(0, 128, 248, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, #f6f9ff 0%, #eef3fb 50%, #e8eef9 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 淡蓝点缀（云野晨光） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(0, 128, 248, 0.22) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 45%, rgba(120, 160, 255, 0.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 40% 10%, rgba(0, 128, 248, 0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 70%, rgba(120, 160, 255, 0.2) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 70% 30%, rgba(0, 128, 248, 0.22) 0%, transparent 100%),
    radial-gradient(1px 1px at 85% 60%, rgba(120, 160, 255, 0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 80%, rgba(0, 128, 248, 0.18) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 15%, rgba(120, 160, 255, 0.22) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 90%, rgba(0, 128, 248, 0.18) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 55%, rgba(120, 160, 255, 0.16) 0%, transparent 100%);
  z-index: 0;
}

/* ---------- 顶部品牌栏 ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  z-index: 100;
}

.nav-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--candle-glow);
  text-decoration: none;
  letter-spacing: 0.5px;
}

/* ---------- 悬浮导航按钮 ---------- */
.fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--candle-glow);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 128, 248, 0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 128, 248, 0.5);
}

.fab:active {
  transform: scale(0.94);
}

.fab-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fab-bars span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
}

/* ---------- 快捷导航弹窗 ---------- */
.nav-pop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.nav-pop.open {
  visibility: visible;
  opacity: 1;
}

.nav-pop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 30, 60, 0.45);
}

.nav-pop-panel {
  position: relative;
  width: min(420px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(20, 50, 100, 0.25);
  padding: 20px;
  transform: scale(0.92);
  transition: transform 0.25s ease;
}

.nav-pop.open .nav-pop-panel {
  transform: scale(1);
}

.nav-pop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-pop-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f2f5fb;
  border-radius: 50%;
  font-size: 1.3rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
}

.nav-pop-close:hover {
  background: #e8edf6;
  color: var(--text-primary);
}

.nav-pop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.nav-pop-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 10px;
  background: #f7f9fd;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-pop-item:hover {
  background: rgba(0, 128, 248, 0.07);
  border-color: rgba(0, 128, 248, 0.3);
  color: var(--candle-glow);
}

.nav-pop-item.active {
  background: rgba(0, 128, 248, 0.12);
  border-color: var(--candle-glow);
  color: var(--candle-glow);
  font-weight: 700;
}

@media (max-width: 480px) {
  .nav-pop-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 进入网站欢迎弹窗 ---------- */
.welcome-pop {
  position: fixed;
  inset: 0;
  z-index: 400; /* 高于快捷导航弹窗(300) */
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.welcome-pop.open {
  visibility: visible;
  opacity: 1;
}
.welcome-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 30, 60, 0.5);
}
.welcome-panel {
  position: relative;
  width: min(440px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(15, 30, 60, 0.3);
  padding: 32px 28px 26px;
  text-align: center;
  transform: scale(0.92);
  transition: transform 0.25s ease;
}
.welcome-pop.open .welcome-panel {
  transform: scale(1);
}
.welcome-icon {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 8px;
}
.welcome-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}
.welcome-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 18px;
}
.welcome-text strong {
  color: var(--candle-glow);
  font-weight: 600;
}
.welcome-promo {
  background: linear-gradient(135deg, rgba(0, 128, 248, 0.08), rgba(0, 128, 248, 0.03));
  border: 1px solid rgba(0, 128, 248, 0.18);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  margin-bottom: 18px;
}
.welcome-promo-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--candle-glow);
  margin-bottom: 6px;
}
.welcome-promo-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.welcome-promo-btn {
  display: inline-block;
  background: var(--candle-glow);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  padding: 9px 22px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.welcome-promo-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 128, 248, 0.4);
}
.welcome-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  cursor: pointer;
  user-select: none;
}
.welcome-check input {
  accent-color: var(--candle-glow);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.welcome-close {
  width: 100%;
  background: #f2f5fa;
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 11px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.welcome-close:hover {
  background: #e8edf6;
}

/* ---------- 主内容 ---------- */
.main {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 32px) 20px 60px;
}

.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.update-time {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 400;
}

/* ---------- 区块 ---------- */
.section {
  margin-bottom: 40px;
  scroll-margin-top: 70px; /* 锚点滚动时为导航栏留出空间 */
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 0 4px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
  padding-left: 14px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 1.1em;
  background: var(--candle-glow);
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(0, 128, 248, 0.3);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(20, 50, 100, 0.06);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(0, 128, 248, 0.3);
  box-shadow: 0 8px 32px rgba(20, 50, 100, 0.12);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 0;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 10px;
  border-radius: 14px;
  background: rgba(0, 128, 248, 0.15);
  color: var(--candle-glow);
  font-size: 0.8rem;
  font-weight: 600;
}

.card-body {
  padding: 16px 24px 24px;
}

/* ---------- 图片画廊 ---------- */
.gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.gallery-img {
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(20, 50, 100, 0.1);
  background: #f5f7fb;
}

/* ---------- 任务列表 ---------- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: #f7f9fd;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.task-item:hover {
  background: rgba(0, 128, 248, 0.05);
  border-color: rgba(0, 128, 248, 0.3);
}

.task-index {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 128, 248, 0.15);
  color: var(--candle-glow);
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 1px;
}

.task-text {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- 倒计时 ---------- */
.djs-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 8px 0;
}

.djs-main {
  text-align: center;
}

.djs-season {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--candle-glow);
  margin-bottom: 12px;
}

.djs-countdown {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.djs-detail {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.djs-time {
  text-align: center;
  padding: 10px 0;
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
}

.djs-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.djs-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.djs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f7f9fd;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.djs-row span:first-child {
  color: var(--text-secondary);
}

.djs-row span:last-child {
  color: var(--text-primary);
  font-weight: 600;
}

/* ---------- 加载状态 ---------- */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 16px;
}

.loading-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0, 128, 248, 0.18);
  border-top-color: var(--candle-glow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ---------- 错误状态 ---------- */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  gap: 12px;
}

.error-text {
  color: var(--error-red);
  font-size: 0.9rem;
  text-align: center;
}

.retry-btn {
  margin-top: 4px;
  padding: 10px 28px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.retry-btn:hover {
  background: rgba(0, 128, 248, 0.07);
  border-color: rgba(0, 128, 248, 0.3);
}

.retry-btn:active {
  transform: scale(0.97);
}

/* ---------- 空状态 ---------- */
.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- 底部 ---------- */
.footer {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 0px 20px 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.8;
}

.footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--candle-glow);
}

/* ---------- 响应式设计 ---------- */

/* 平板 & 桌面 */
@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }

  .page-title {
    font-size: 2rem;
  }
}

/* 移动端 */
@media (max-width: 767px) {
  .card-header {
    padding: 16px 18px 0;
  }

  .card-body {
    padding: 14px 18px 20px;
  }
}

/* ---------- 动画 ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-img {
  animation: fadeInUp 0.3s ease both;
}

.gallery-img:nth-child(1) { animation-delay: 0.02s; }
.gallery-img:nth-child(2) { animation-delay: 0.10s; }
