*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
}

img {
  -webkit-user-drag: none;
  user-drag: none;
  display: block;
}

:root {
  --radius-sm: 10px;
  --radius: 18px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #fff;
  background: #000;
}

/* ---- loading ---- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s var(--ease-out);
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-text {
  font-size: 18px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 1px;
}

/* ---- wrapper ---- */
.js-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 28px 0;
}

/* ---- background ---- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.bg-layer::before {
  content: "";
  position: absolute;
  inset: -60px;
  background-image: inherit;
  background-position: inherit;
  background-size: inherit;
  background-repeat: inherit;
  filter: blur(10px) brightness(0.65);
}

.bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
}

/* ---- container ---- */
.container {
  width: min(1100px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeUp 0.7s var(--ease-out) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- hero ---- */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 68vh;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
  box-shadow: 0 2px 40px rgba(0, 0, 0, 0.45);
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out);
}

.hero img.transitioning {
  opacity: 0;
  transform: scale(1.03);
}

/* ---- hero overlay ---- */
.hero-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 60px 36px 28px;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
  pointer-events: none;
}

.hero-overlay .title {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.3px;
  line-height: 1.15;
  margin-bottom: 6px;
}

.hero-overlay .price {
  font-size: 26px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.hero-overlay .desc-wrap {
  position: relative;
  max-width: 480px;
}

.hero-overlay .desc {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.65);
  max-height: 72px;
  overflow-y: auto;
  pointer-events: auto;
  scrollbar-width: none;
}

.hero-overlay .desc::-webkit-scrollbar {
  display: none;
}

/* ---- scroll dots ---- */
.scroll-dots {
  position: absolute;
  right: -16px;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: auto;
}

.scroll-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.25s var(--ease-out);
  cursor: pointer;
}

.scroll-dot.active {
  background: rgba(255, 255, 255, 0.8);
}

/* ---- bottom bar ---- */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---- thumbnails ---- */
.thumb-strip {
  display: flex;
  gap: 10px;
}

.thumb {
  width: 88px;
  height: 58px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  opacity: 0.5;
  transition: opacity 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out),
              transform 0.3s var(--ease-out);
  flex-shrink: 0;
}

.thumb:hover {
  opacity: 0.8;
}

.thumb.active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.7);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- actions ---- */
.actions {
  display: flex;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 34px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.2px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: background 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.btn-feedback {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.btn-feedback:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-primary {
  background: #f5c518;
  color: #1a1a1a;
  border-color: transparent;
}

.btn-primary:hover {
  background: #e6b800;
}

/* ---- modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: #2c2c2e;
  border-radius: 20px;
  padding: 28px 28px 22px;
  width: min(360px, 86vw);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  transform: scale(0.96);
  opacity: 0;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transition: transform 0.35s var(--ease-out),
              opacity 0.35s var(--ease-out);
}

.modal-overlay.active .modal-dialog {
  transform: scale(1);
  opacity: 1;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  margin-bottom: 10px;
}

.modal-body {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 12px;
  border: none;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s ease;
}

.modal-btn:active {
  opacity: 0.7;
}

.modal-btn-cancel {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
}

.modal-btn-confirm {
  background: #f5c518;
  color: #1a1a1a;
}

/* ---- responsive ---- */
@media (max-width: 900px) {
  .hero {
    aspect-ratio: 4 / 3;
    max-height: 55vh;
    border-radius: var(--radius-sm);
  }

  .hero-overlay {
    padding: 44px 24px 20px;
  }

  .hero-overlay .title {
    font-size: 26px;
  }

  .hero-overlay .price {
    font-size: 20px;
  }

  .hero-overlay .desc {
    font-size: 14px;
    max-height: 66px;
  }

  .scroll-dots {
    right: -10px;
  }

  .thumb {
    width: 72px;
    height: 48px;
  }

  .bar {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .container {
    gap: 14px;
    padding: 0 6px;
  }
}

/* ---- image error placeholder ---- */
.hero-img-error {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #2c2c2e;
  color: #636366;
  font-size: 15px;
  font-weight: 400;
  font-family: inherit;
  line-height: 1.6;
  text-align: center;
  gap: 2px;
}

.thumb-img-error {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #2c2c2e;
  color: #636366;
  font-size: 10px;
  font-weight: 400;
  font-family: inherit;
  line-height: 1.4;
  text-align: center;
  gap: 1px;
}

@media (max-width: 480px) {
  .hero-overlay .title {
    font-size: 22px;
  }

  .hero-overlay .price {
    font-size: 18px;
  }

  .thumb {
    width: 60px;
    height: 40px;
    border-radius: 8px;
  }

  .thumb-img-error {
    font-size: 9px;
  }
}
