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

:root {
  --bg: #11151c;
  --bg-glow: #243044;
  --card: #1a212b;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #ff5d4e;
  --accent-deep: #e64538;
  --text: #f4f1ec;
  --muted: #8d96a3;
}

html,
body {
  min-height: 100%;
  background:
    radial-gradient(ellipse at top, var(--bg-glow) 0%, var(--bg) 46%, #0c0f14 100%);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.locked {
  overflow: hidden;
}

.page.home {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.hero {
  display: block;
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #0b0e13;
}

.hero[hidden] {
  display: none;
}

.hero-viewport {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1024 / 576;
  touch-action: manipulation;
  background: #0b0e13;
}

.hero-track {
  display: flex;
  width: 100%;
  height: 100%;
  will-change: transform;
}

.hero-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

.hero-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  user-select: none;
  pointer-events: none;
}

.hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.hero-dots button {
  pointer-events: auto;
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
}

.hero-dots button.active {
  width: 16px;
  background: #fff;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  margin: 0;
  padding: 0 12px 0 10px;
  background: linear-gradient(90deg, #321910, #1b1512 42%, #151316);
  border-top: 1px solid rgba(255, 180, 90, 0.18);
}

.notice[hidden] {
  display: none;
}

.notice-tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ff8a6b, var(--accent-deep));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.notice-marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 18px), transparent);
}

.notice-inner {
  display: flex;
  width: max-content;
  color: #ffe08a;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  animation: notice-scroll 16s linear infinite;
}

.notice-inner span {
  padding-right: 72px;
  white-space: nowrap;
}

.notice-inner.is-static {
  animation: none;
  width: 100%;
  justify-content: center;
}

.notice-inner.is-static span {
  padding-right: 0;
}

@keyframes notice-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.home-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 18px auto 0;
  padding: 0 0 12px;
}

.hongdan-link {
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffe08a;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-shadow: 0 0 18px rgba(255, 224, 138, 0.28);
  cursor: pointer;
  font-family: inherit;
}

.hongdan-link::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.hongdan-link.is-open::after {
  transform: translateY(2px) rotate(225deg);
}

.hongdan-panel {
  width: min(1100px, calc(100% - 20px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hongdan-panel[hidden] {
  display: none;
}

.hongdan-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.home-day-title {
  appearance: none;
  width: 100%;
  margin: 0;
  border: 0;
  padding: 12px 8px;
  background: transparent;
  color: #ffe08a;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 224, 138, 0.28);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.home-day-title.is-open {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--bg);
  box-shadow: 0 10px 16px rgba(12, 15, 20, 0.88);
}

.home-day-title::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.home-day-title.is-open::after {
  transform: translateY(2px) rotate(225deg);
}

.home-day-title,
.history-toggle,
.history-mini,
.action-btn,
.hongdan-link,
.back {
  touch-action: manipulation;
}

.home-day-body {
  width: 100%;
}

.home-day-body[hidden] {
  display: none;
}

.history-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #ffe08a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 8px 4px 4px;
}

.history-mini:hover {
  color: #fff;
}

.hongdan-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 2px 4px 8px;
}

.hongdan-thumbs button {
  appearance: none;
  flex: 0 1 148px;
  width: 148px;
  height: 196px;
  border: 0;
  padding: 0;
  border-radius: 22px;
  overflow: hidden;
  background: #1a212b;
  cursor: zoom-in;
  touch-action: manipulation;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hongdan-thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.hongdan-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(12, 15, 20, 0), rgba(12, 15, 20, 0.92) 28%, #0c0f14);
}

.actions .action-btn {
  width: min(360px, 100%);
}

.action-btn {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #ff7464, var(--accent) 48%, var(--accent-deep));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(230, 69, 56, 0.28);
}

.action-btn:hover {
  transform: translateY(-1px);
}

.action-btn:active {
  transform: translateY(1px) scale(0.992);
}

.page.hongdan {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px 0 calc(16px + env(safe-area-inset-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: min(1100px, calc(100% - 24px));
  margin: 0 auto 12px;
}

.topbar p {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

.topbar span,
.history-link {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.history-link {
  color: #ffe08a;
  text-decoration: none;
}

.history-link:hover {
  color: #fff;
}

.back {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.empty {
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
}

.stage {
  position: relative;
  width: min(1100px, 100%);
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.carousel {
  position: relative;
  flex: 1;
  min-height: 0;
}

.carousel-viewport {
  overflow: hidden;
  width: 100%;
  touch-action: manipulation;
  cursor: zoom-in;
}

.carousel-track {
  display: flex;
  width: 100%;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: zoom-in;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.slide img {
  width: auto;
  max-width: min(420px, 100%);
  height: auto;
  max-height: min(78vh, 860px);
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
  background: #10141b;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(12, 16, 22, 0.55);
  color: #fff;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.carousel-arrow svg {
  width: 16px;
  height: 16px;
}

.carousel-arrow.prev {
  left: 8px;
}

.carousel-arrow.next {
  right: 8px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 0 4px;
}

.dot {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
}

.dot.active {
  width: 18px;
  border-radius: 999px;
  background: var(--accent);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(8, 10, 14, 0.96);
  touch-action: none;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  z-index: 45;
  border: 0;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

.lightbox-close {
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.lightbox-nav {
  top: 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  font-size: 28px;
  transform: translateY(-50%);
}

.lightbox-nav.prev {
  left: 8px;
}

.lightbox-nav.next {
  right: 8px;
}

.lightbox-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 52px 56px 24px;
  touch-action: none;
}

.lightbox-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  touch-action: none;
  cursor: zoom-in;
  will-change: transform;
}

.lightbox-stage img.is-zoomed {
  cursor: grab;
}

.page.history {
  min-height: 100dvh;
  padding: 12px 0 calc(32px + env(safe-area-inset-bottom));
}

.history-list {
  width: min(720px, calc(100% - 24px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.history-toggle {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  color: #ffe08a;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 8px;
  text-shadow: 0 0 18px rgba(255, 224, 138, 0.28);
}

.history-toggle.is-open {
  position: sticky;
  top: 0;
  z-index: 8;
  background: var(--bg);
  box-shadow: 0 10px 16px rgba(12, 15, 20, 0.88);
}

.history-toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s ease;
}

.history-toggle.is-open::after {
  transform: translateY(2px) rotate(225deg);
}

.history-day-body {
  width: 100%;
  padding-bottom: 10px;
}

.history-day-body[hidden] {
  display: none;
}

@media (min-width: 768px) {
  .hero-block {
    width: min(1120px, calc(100% - 48px));
    margin: 28px auto 0;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
  }

  .hero {
    width: 100%;
    margin: 0;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .notice {
    height: 46px;
  }

  .notice-inner {
    font-size: 15px;
  }

  .home-bar {
    margin-top: 22px;
  }

  .hongdan-thumbs {
    gap: 18px;
  }

  .hongdan-thumbs button {
    flex: 0 1 196px;
    width: 196px;
    height: 262px;
    border-radius: 26px;
  }

  .hongdan-thumbs button:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
  }

  .hongdan-link {
    font-size: 20px;
  }

  .home-day-title {
    font-size: 20px;
  }

  .action-btn {
    min-height: 54px;
    font-size: 17px;
  }

  .actions .action-btn {
    width: min(400px, calc(100% - 16px));
  }

  .slide img {
    max-width: min(480px, 100%);
    max-height: min(82vh, 920px);
  }

  .carousel-arrow.prev {
    left: 20px;
  }

  .carousel-arrow.next {
    right: 20px;
  }
}

@media (max-width: 767px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  .topbar p {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .history-link {
    max-width: 5.8em;
    white-space: normal;
    line-height: 1.25;
    font-size: 11px;
  }

  .lightbox-stage {
    padding: 48px 8px 16px;
  }

  .carousel-arrow.prev {
    left: 4px;
  }

  .carousel-arrow.next {
    right: 4px;
  }
}
