:root {
  color-scheme: light;
  --page-background: #f5f5f5;
  --bar-gap: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: auto;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--page-background);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* 为手机底部悬浮栏及 iPhone 安全区域预留空间。 */
  padding-bottom: calc(110px + var(--safe-bottom));
}

/* 顶部悬浮标题：毛玻璃质感，不占用图片流的空间。 */
.floating-title {
  position: fixed;
  z-index: 1100;
  top: calc(10px + var(--safe-top));
  left: 50%;
  width: min(calc(100% - 24px), 720px);
  padding: 11px 18px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 10px 30px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  backdrop-filter: blur(16px) saturate(145%);
}

.floating-title h1 {
  overflow: hidden;
  margin: 0;
  color: #172033;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-list {
  width: 100%;
  margin: 0 auto;
  padding: 8px 0;
  perspective: 1200px;
}

/* 图片外层使用亮边、投影和轻微悬浮效果，形成克制的立体感。 */
.promo-card {
  position: relative;
  width: min(90%, 820px);
  margin: 0 auto 10px;
  overflow: hidden;
  transform: translateZ(0);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.16),
    0 3px 7px rgba(15, 23, 42, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.promo-card::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.22) 0%,
    transparent 22%,
    transparent 78%,
    rgba(15, 23, 42, 0.08) 100%
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  content: "";
  pointer-events: none;
}

.promo-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  object-fit: contain;
}

.download-bar {
  position: fixed;
  z-index: 1000;
  right: auto;
  bottom: calc(10px + var(--safe-bottom));
  left: 50%;
  width: min(calc(100% - 32px), 360px);
  padding: 6px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow:
    0 16px 38px rgba(15, 23, 42, 0.17),
    0 0 18px rgba(255, 255, 255, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.download-bar[hidden] {
  display: none;
}

.download-button {
  position: relative;
  display: block;
  width: 100%;
  min-height: 56px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  background: linear-gradient(180deg, #ff665d 0%, #ff3b30 48%, #dc2018 100%);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(115, 12, 7, 0.3);
  box-shadow:
    0 9px 18px rgba(220, 32, 24, 0.32),
    0 3px 0 #a91812,
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 5px rgba(132, 14, 8, 0.22);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.download-button::after {
  position: absolute;
  top: 0;
  right: 12%;
  left: 12%;
  height: 42%;
  border-radius: 0 0 50% 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.28), transparent);
  content: "";
  pointer-events: none;
}

.download-button:active {
  transform: translateY(3px);
  filter: brightness(0.94);
  box-shadow:
    0 5px 12px rgba(220, 32, 24, 0.26),
    0 1px 0 #a91812,
    inset 0 2px 5px rgba(132, 14, 8, 0.2);
}

.download-button:focus-visible {
  outline: 3px solid rgba(0, 84, 255, 0.45);
  outline-offset: 3px;
}

.noscript-message {
  margin: 24px;
  text-align: center;
  color: #555;
}

/* 电脑端限制图片宽度，下载按钮仍保持底部居中。 */
@media (min-width: 768px) {
  body {
    padding-bottom: 120px;
  }

  .image-list {
    max-width: 960px;
    padding-top: 12px;
  }

  .promo-card {
    margin-bottom: 14px;
    border-radius: 18px;
    box-shadow:
      0 18px 36px rgba(15, 23, 42, 0.17),
      0 4px 10px rgba(15, 23, 42, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }

  .download-bar {
    right: auto;
    bottom: 24px;
    left: 50%;
    width: min(calc(100% - 48px), 360px);
    padding: 6px;
  }

  .download-button {
    width: 100%;
    min-width: 220px;
    padding: 0 28px;
  }
}
