/* ===== 蜜雪冰城主题变量 ===== */
:root {
  --brand-red: #e31b23;
  --brand-red-dark: #c1141b;
  --brand-red-light: #f8d7d8;
  --cream: #fff8f0;
  --ink: #2a2a2a;
  --muted: #777;
  --white: #ffffff;
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius: 16px;
  --max-width: 1080px;
  --gap: 24px;
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
}

/* ===== 导航 ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--brand-red);
  font-weight: 700;
  font-size: 20px;
}

.brand__logo {
  height: 34px;
  width: auto;
  display: block;
}

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav__link {
  text-decoration: none;
  color: var(--ink);
  font-size: 15px;
  padding: 6px 12px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.nav__link:hover {
  background: var(--brand-red-light);
  color: var(--brand-red);
}

/* ===== Hero ===== */
.hero {
  background: var(--brand-red);
  line-height: 0;
}

.hero__poster {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  padding: 12px 26px;
  min-height: 48px;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn--light {
  margin-top: 24px;
  background: var(--white);
  color: var(--brand-red);
  box-shadow: var(--card-shadow);
}

.btn--light:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.btn--primary {
  background: var(--brand-red);
  color: var(--white);
  box-shadow: var(--card-shadow);
}

.btn--primary:hover {
  background: var(--brand-red-dark);
}

.btn--primary:disabled {
  background: #c9c9c9;
  cursor: not-allowed;
  box-shadow: none;
}

.btn--ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid #ddd;
}

.btn--ghost:hover {
  background: #f5f5f5;
  color: var(--ink);
}

/* ===== 区块通用 ===== */
.section {
  padding: 64px 0;
}

.section--alt {
  background: var(--white);
}

.section__title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  color: var(--brand-red);
  text-align: center;
}

.section__lead {
  text-align: center;
  color: var(--muted);
  margin-top: 8px;
  margin-bottom: 40px;
  font-size: 16px;
}

/* ===== 优惠卡片 ===== */
.promo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--gap);
}

.promo-card {
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.promo-card--red {
  background: var(--brand-red);
  color: var(--white);
}

.promo-card--red .promo-card__rule {
  color: rgba(255, 255, 255, 0.85);
}

.promo-card--light {
  background: var(--white);
  color: var(--ink);
  border: 1px solid #f0e2e2;
}

.promo-card__emoji {
  font-size: 40px;
}

.promo-card__title {
  font-size: 20px;
  font-weight: 800;
}

.promo-card__desc {
  font-size: 15px;
  opacity: 0.92;
}

.promo-card__rule {
  margin-top: auto;
  padding-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* ===== 产品卡片 ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap);
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid #f0e2e2;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-card__visual {
  height: 180px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7efe9;
}

.product-card__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-card__name {
  font-size: 18px;
  font-weight: 800;
}

.product-card__desc {
  font-size: 14px;
  color: var(--muted);
  flex: 1;
}

.product-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.product-card__price {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-red);
}

.product-card__tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  background: var(--brand-red);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ===== 位置面板 ===== */
.location-panel {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.location-panel__hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.location-status {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 15px;
  text-align: left;
}

.location-status--loading {
  background: #fff3d6;
  color: #8a6d1a;
}

.location-status--success {
  background: #e6f7ec;
  color: #1e7a3c;
}

.location-status--error {
  background: var(--brand-red-light);
  color: var(--brand-red-dark);
}

.location-result {
  margin-top: 18px;
  background: var(--white);
  border: 1px solid #f0e2e2;
  border-radius: var(--radius);
  padding: 8px 20px;
  text-align: left;
  box-shadow: var(--card-shadow);
}

.location-result__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #f4e6e6;
}

.location-result__item:last-child {
  border-bottom: none;
}

.location-result__item--wide {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.location-result dt {
  color: var(--muted);
  font-size: 14px;
}

.location-result dd {
  font-weight: 700;
  font-size: 16px;
  word-break: break-all;
}

/* ===== 领取优惠券 ===== */
.claim-panel {
  max-width: 460px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid #f0e2e2;
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--card-shadow);
  text-align: center;
}

.claim-panel__coupon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--brand-red);
  color: var(--white);
  padding: 10px 22px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.claim-panel__amount {
  font-size: 28px;
  font-weight: 800;
}

.claim-panel__desc {
  font-size: 14px;
  opacity: 0.9;
  border-left: 1px dashed rgba(255, 255, 255, 0.6);
  padding-left: 10px;
}

.claim-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.claim-form__label {
  font-size: 14px;
  color: var(--muted);
}

.claim-form__input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #e5d5d5;
  border-radius: 10px;
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s;
}

.claim-form__input:focus {
  outline: none;
  border-color: var(--brand-red);
}

.claim-form__input:disabled {
  background: #f4f4f4;
  color: #999;
}

.claim-form__btn {
  width: 100%;
  margin-top: 4px;
}

.claim-form__btn:disabled {
  background: #c9c9c9;
  cursor: not-allowed;
  box-shadow: none;
}

.claim-status {
  margin-top: 16px;
  font-size: 15px;
  min-height: 22px;
  text-align: center;
}

.claim-status--success {
  color: #1e7a3c;
  font-weight: 700;
}

.claim-status--error {
  color: var(--brand-red-dark);
}

/* ===== 生日礼 ===== */
.birthday-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--gap);
  max-width: 820px;
  margin: 0 auto;
}

.birthday-card {
  background: var(--white);
  border: 1px solid #f0e2e2;
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--card-shadow);
}

.birthday-card__title {
  font-size: 20px;
  font-weight: 800;
  color: var(--brand-red);
  margin-bottom: 18px;
  text-align: center;
}

.birthday-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.birthday-form__label {
  font-size: 14px;
  color: var(--muted);
}

.birthday-form__input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #e5d5d5;
  border-radius: 10px;
  font-size: 16px;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s;
}

.birthday-form__input:focus {
  outline: none;
  border-color: var(--brand-red);
}

.birthday-form__input:disabled {
  background: #f4f4f4;
  color: #999;
}

.birthday-form__btn {
  width: 100%;
  margin-top: 4px;
}

.birthday-form__btn:disabled {
  background: #c9c9c9;
  cursor: not-allowed;
  box-shadow: none;
}

.birthday-status {
  margin-top: 14px;
  font-size: 14px;
  min-height: 20px;
  text-align: center;
  line-height: 1.5;
}

.birthday-status--success {
  color: #1e7a3c;
  font-weight: 700;
}

.birthday-status--error {
  color: var(--brand-red-dark);
}

.birthday-note {
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* ===== 定位授权弹窗 ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
}

.modal--open {
  display: flex;
}

.modal__dialog {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 420px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal__icon {
  font-size: 48px;
}

.modal__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--brand-red);
  margin-top: 8px;
}

.modal__desc {
  margin-top: 12px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.7;
}

.modal__warn {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fff3d6;
  color: #8a6d1a;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.modal__actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal__actions .btn {
  width: 100%;
}

/* ===== 页脚 ===== */
.footer {
  background: var(--ink);
  color: #cfcfcf;
  padding: 40px 0;
}

.footer__inner {
  text-align: center;
}

.footer__slogan {
  font-size: 16px;
  color: var(--white);
  font-weight: 700;
}

.footer__contact {
  margin-top: 8px;
  font-size: 13px;
}

/* ===== 响应式 ===== */

/* 平板及以下 */
@media (max-width: 768px) {
  .section {
    padding: 48px 0;
  }

  .section__lead {
    margin-bottom: 28px;
  }

  /* 导航：品牌固定，链接横向滑动 */
  .navbar__inner {
    height: 56px;
    gap: 12px;
  }

  .brand {
    flex-shrink: 0;
  }

  .brand__logo {
    font-size: 24px;
  }

  .brand__name {
    font-size: 18px;
  }

  .nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox 隐藏滚动条 */
    padding-bottom: 2px;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav__link {
    flex-shrink: 0;
    font-size: 14px;
    padding: 8px 12px;
    white-space: nowrap;
  }

  .hero__inner {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .promo-grid,
  .product-grid {
    gap: 16px;
  }
}

/* 手机 */
@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .hero__inner {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .hero__visual {
    font-size: 64px;
    order: -1; /* 视觉移到文字上方，更像活动海报 */
  }

  .hero__cup {
    font-size: 48px;
  }

  .hero__desc {
    margin-left: auto;
    margin-right: auto;
    font-size: 15px;
  }

  .btn--light {
    margin-top: 20px;
  }

  /* 定位按钮占满一行，方便单手点击 */
  .location-panel .btn--primary {
    width: 100%;
  }

  /* 弹窗改为底部抽屉 */
  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal__dialog {
    max-width: none;
    border-radius: 20px 20px 0 0;
    padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
  }

  .modal__actions {
    flex-direction: row;
    gap: 12px;
  }

  .modal__actions .btn {
    flex: 1;
    padding: 14px 0;
  }
}
