/* ============================================
   Cookie 同意横幅 + 政策抽屉
   ============================================ */

/* ---- Cookie 横幅 ---- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  padding: 0 24px 24px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s linear 0.4s;
}

.cookie-banner.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s linear 0s;
}

.cookie-banner.is-hiding {
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  pointer-events: none;
}

.cookie-banner__inner {
  max-width: 960px;
  margin: 0 auto;
  background: #111;
  color: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}

.cookie-banner__text {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
}

.cookie-banner__icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.5);
}

.cookie-banner__link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: inherit;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
  transition: opacity 0.15s;
}

.cookie-banner__link:hover {
  opacity: 0.7;
}

.cookie-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-banner__btn {
  height: 36px;
  padding: 0 18px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: opacity 0.15s, background 0.15s;
}

.cookie-banner__btn--primary {
  background: #fff;
  color: #111;
}

.cookie-banner__btn--primary:hover {
  opacity: 0.88;
}

.cookie-banner__btn--secondary {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
}

.cookie-banner__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* ---- 政策抽屉 ---- */
.policy-drawer {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.4s;
}

.policy-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
  transition: visibility 0s linear 0s;
}

.policy-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.35s ease;
}

.policy-drawer.is-open .policy-drawer__overlay {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.policy-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
  will-change: transform;
}

.policy-drawer.is-open .policy-drawer__panel {
  transform: translateX(0);
}

.policy-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.policy-drawer__title {
  font-size: 16px;
  font-weight: 600;
  color: #111;
  letter-spacing: -0.01em;
}

.policy-drawer__close {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(0, 0, 0, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.policy-drawer__close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #111;
}

.policy-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 48px;
  overscroll-behavior: contain;
}

.policy-drawer__updated {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.35);
  margin: 0 0 28px;
}

.policy-drawer__body h3 {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  margin: 28px 0 10px;
  letter-spacing: -0.01em;
}

.policy-drawer__body h3:first-of-type {
  margin-top: 0;
}

.policy-drawer__body p {
  font-size: 13px;
  line-height: 1.75;
  color: rgba(0, 0, 0, 0.6);
  margin: 0 0 12px;
}

.policy-drawer__body a {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.policy-drawer__body a:hover {
  opacity: 0.6;
}

/* Cookie 类型卡片 */
.policy-cookie-type {
  background: #f8f8f8;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.policy-cookie-type__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.policy-cookie-type__name {
  font-size: 13px;
  font-weight: 600;
  color: #111;
}

.policy-cookie-type__badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.5);
}

.policy-cookie-type__badge--required {
  background: rgba(0, 0, 0, 0.08);
  color: rgba(0, 0, 0, 0.6);
}

.policy-cookie-type p {
  margin: 0;
}

/* ---- 响应式 ---- */
@media (max-width: 768px) {
  .cookie-banner {
    padding: 0 12px 16px;
  }

  .cookie-banner__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
  }

  .cookie-banner__actions {
    width: 100%;
  }

  .cookie-banner__btn {
    flex: 1;
    justify-content: center;
  }

  .policy-drawer__panel {
    width: 100%;
    top: auto;
    height: 90vh;
    height: 90dvh;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - 20px);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .policy-drawer.is-open .policy-drawer__panel {
    transform: translateY(0);
  }

  .policy-drawer__header {
    padding: 20px 20px 16px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
  }

  .policy-drawer__body {
    padding: 20px 20px 32px;
  }
}
