:root {
  --bg: #faf6f1;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-border: rgba(255, 255, 255, 0.85);
  --stroke: rgba(34, 28, 24, 0.08);
  --text: #1f1b18;
  --text-muted: #6f655d;
  --text-subtle: #9a8f86;

  --accent: #e86a43;
  --accent-2: #f4a261;
  --accent-soft: rgba(232, 106, 67, 0.12);
  --weekend: #e76f51;
  --weekend-soft: rgba(231, 111, 81, 0.14);
  --success: #2a9d8f;

  --orb-1: rgba(255, 179, 138, 0.55);
  --orb-2: rgba(255, 214, 153, 0.55);
  --orb-3: rgba(244, 162, 184, 0.42);

  --shadow-card:
    0 24px 60px -20px rgba(84, 48, 25, 0.12),
    0 4px 16px -4px rgba(84, 48, 25, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --shadow-tile:
    0 10px 28px -12px rgba(84, 48, 25, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
  --bg: #111116;
  --surface: rgba(26, 26, 34, 0.72);
  --surface-strong: rgba(34, 34, 46, 0.88);
  --surface-border: rgba(255, 255, 255, 0.1);
  --stroke: rgba(255, 255, 255, 0.08);
  --text: #f6f3ee;
  --text-muted: #a6a0ab;
  --text-subtle: #736d7a;

  --accent: #ff825c;
  --accent-2: #f7b267;
  --accent-soft: rgba(255, 130, 92, 0.16);
  --weekend: #ff9270;
  --weekend-soft: rgba(255, 146, 112, 0.16);
  --success: #4fd1c5;

  --orb-1: rgba(232, 106, 67, 0.28);
  --orb-2: rgba(139, 92, 246, 0.24);
  --orb-3: rgba(245, 158, 11, 0.18);

  --shadow-card:
    0 30px 80px -20px rgba(0, 0, 0, 0.55),
    0 4px 20px -4px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-tile:
    0 12px 30px -12px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

.mono-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* 柔和流光背景 */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(88px);
  opacity: 0.9;
  will-change: transform;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 520px;
  height: 520px;
  top: -140px;
  left: -100px;
  background: var(--orb-1);
}

.orb-2 {
  width: 480px;
  height: 480px;
  bottom: -140px;
  right: -80px;
  background: var(--orb-2);
  animation-duration: 22s;
  animation-delay: -5s;
}

.orb-3 {
  width: 360px;
  height: 360px;
  top: 42%;
  left: 52%;
  background: var(--orb-3);
  animation-duration: 25s;
  animation-delay: -10s;
}

.noise-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: radial-gradient(currentColor 0.6px, transparent 0.6px);
  background-size: 16px 16px;
}

@keyframes floatOrb {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(30px, -24px, 0) scale(1.06);
  }
  100% {
    transform: translate3d(-24px, 28px, 0) scale(0.96);
  }
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* 页面容器 */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 20px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

/* 顶部栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.today-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.12);
  font-size: 14px;
  color: var(--text-muted);
}

.today-pill strong {
  color: var(--text);
  font-weight: 650;
}

.pill-divider {
  opacity: 0.35;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(232, 106, 67, 0.55);
  animation: pulseDot 2.2s ease-out infinite;
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(232, 106, 67, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(232, 106, 67, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(232, 106, 67, 0);
  }
}

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

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.2s ease, background-color 0.25s ease;
}

.icon-btn:hover {
  transform: translateY(-1px) scale(1.03);
  background: var(--surface-strong);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* 主卡片 */
.hero-card {
  position: relative;
  border-radius: 32px;
  padding: 44px 40px 32px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  box-shadow: var(--shadow-card);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.hero-header {
  text-align: center;
  margin-bottom: 34px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-soft);
  margin-bottom: 14px;
}

body.is-weekend .status-badge {
  color: var(--success);
  background: rgba(42, 157, 143, 0.14);
}

body.is-weekend .pulse-dot {
  background: var(--success);
}

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 760;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.hero-subtitle {
  margin: 0;
  font-size: 15.5px;
  color: var(--text-muted);
}

/* 倒计时四宫格 */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 34px;
}

.time-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 26px 14px 22px;
  border-radius: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow-tile);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.28s ease;
  overflow: hidden;
}

.time-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 48%);
  pointer-events: none;
}

[data-theme="dark"] .time-card::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 48%);
}

.time-card:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 106, 67, 0.28);
}

.time-card-accent {
  border-color: rgba(232, 106, 67, 0.26);
  background: linear-gradient(
    160deg,
    var(--surface-strong) 0%,
    rgba(232, 106, 67, 0.08) 100%
  );
}

.time-value-wrap {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.time-value {
  font-size: clamp(44px, 6.2vw, 66px);
  font-weight: 780;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  display: inline-block;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.time-card-accent .time-value {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.time-value.tick {
  animation: tickPop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes tickPop {
  0% {
    transform: translateY(5px) scale(0.95);
    opacity: 0.65;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.time-label {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
}

.time-sub {
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-subtle);
}

/* 进度条与周历 */
.progress-section {
  padding: 20px 22px;
  border-radius: 22px;
  background: rgba(128, 128, 128, 0.05);
  border: 1px solid var(--stroke);
  margin-bottom: 24px;
}

.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-percent {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

body.is-weekend .progress-percent {
  color: var(--success);
}

.progress-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(128, 128, 128, 0.14);
  overflow: hidden;
  margin-bottom: 18px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

body.is-weekend .progress-fill {
  background: linear-gradient(90deg, #52b788, var(--success));
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.42),
    transparent
  );
  animation: shimmer 2.6s linear infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.25s ease;
}

.day-node .day-short {
  font-size: 13px;
  font-weight: 600;
}

.day-node .day-tag {
  font-size: 11px;
  color: var(--text-subtle);
}

.day-node.is-past {
  opacity: 0.62;
}

.day-node.is-weekend-day {
  background: var(--weekend-soft);
  color: var(--weekend);
}

.day-node.is-weekend-day .day-tag {
  color: var(--weekend);
  opacity: 0.85;
}

.day-node.is-today {
  background: var(--surface-strong);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 6px 16px -8px rgba(232, 106, 67, 0.45);
}

.day-node.is-today .day-tag {
  color: var(--accent);
  font-weight: 650;
}

/* 卡片底部 */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.quote-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--surface-strong);
  color: var(--text-muted);
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.quote-chip:hover {
  color: var(--text);
  border-color: rgba(232, 106, 67, 0.3);
  transform: translateY(-1px);
}

.quote-spark {
  color: var(--accent);
  font-size: 14px;
}

.celebrate-btn {
  border: none;
  padding: 11px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 650;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 22px -10px rgba(232, 106, 67, 0.7);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.celebrate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -10px rgba(232, 106, 67, 0.85);
  filter: brightness(1.03);
}

.celebrate-btn:active {
  transform: translateY(0) scale(0.98);
}

.footnote {
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-subtle);
}

/* 响应式 */
@media (max-width: 720px) {
  .page {
    padding: 18px 14px 28px;
  }

  .hero-card {
    padding: 30px 18px 22px;
    border-radius: 26px;
  }

  .countdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
  }

  .time-card {
    padding: 20px 10px 18px;
    border-radius: 20px;
  }

  .time-value-wrap {
    min-height: 58px;
  }

  .week-strip {
    gap: 5px;
  }

  .day-node {
    padding: 8px 2px;
  }

  .day-node .day-tag {
    font-size: 10px;
  }

  .card-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .celebrate-btn {
    width: 100%;
  }
}
