@charset "UTF-8";

/* 授权组件保持白底，文字使用固定深色 token，避免深色页面将文字变成白色。 */
.hebang-cookie-card,
.hebang-cookie-dialog,
.hebang-cookie-status {
  color: var(--hebang-color-primary-ink);
  background: var(--hebang-color-white);
  font-family: var(--hebang-font-sans);
  font-size: var(--hebang-fs-14);
  line-height: 1.55;
}

.hebang-cookie-card {
  position: fixed;
  left: var(--hebang-space-6);
  bottom: calc(var(--hebang-space-6) + env(safe-area-inset-bottom));
  z-index: var(--hebang-z-floating);
  width: min(440px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 22px;
  border-top: 4px solid var(--hebang-color-primary);
  border-radius: var(--hebang-radius-md);
  box-shadow: var(--hebang-shadow-md);
}

.hebang-cookie-card[hidden],
[data-hebang-cookie-settings][hidden],
.hebang-cookie-map-placeholder[hidden] {
  display: none;
}

.hebang-cookie-card-heading {
  display: flex;
  align-items: flex-start;
  gap: var(--hebang-space-4);
}

.hebang-cookie-shield {
  flex: 0 0 30px;
  width: 30px;
  height: 34px;
  color: var(--hebang-color-primary-dark);
}

.hebang-cookie-card h2,
.hebang-cookie-dialog h2,
.hebang-cookie-dialog h3 {
  margin: 0;
  color: inherit;
  font-family: var(--hebang-font-sans);
  font-weight: var(--hebang-weight-bold);
  line-height: 1.3;
}

.hebang-cookie-card h2 { font-size: var(--hebang-fs-18); }
.hebang-cookie-dialog h2 { font-size: var(--hebang-fs-24); }
.hebang-cookie-dialog h3 { font-size: var(--hebang-fs-16); }
.hebang-cookie-card p,
.hebang-cookie-dialog p { margin: 7px 0 0; font-size: inherit; line-height: inherit; }

.hebang-cookie-policy-link {
  display: inline-block;
  margin-block: 10px 12px;
  color: var(--hebang-color-primary-dark);
  font-size: var(--hebang-fs-13);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hebang-cookie-card > .hebang-cookie-policy-link { margin-left: 42px; }
.hebang-cookie-dialog > .hebang-cookie-policy-link { margin-bottom: 0; }

.hebang-cookie-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--hebang-space-2);
}

.hebang-cookie-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: var(--hebang-hit-min);
  padding: 10px 14px;
  border: 1px solid var(--hebang-color-primary-dark);
  border-radius: var(--hebang-radius);
  color: var(--hebang-color-primary-ink);
  font: inherit;
  font-size: var(--hebang-fs-14);
  font-weight: var(--hebang-weight-semibold);
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--hebang-dur-fast) var(--hebang-ease);
}

.hebang-cookie-button--accept {
  border-color: transparent;
  background: var(--hebang-color-primary);
}
.hebang-cookie-button--accept:hover { background: var(--hebang-color-primary-soft); }
.hebang-cookie-button--outline { background: var(--hebang-color-white); }
.hebang-cookie-button--outline:hover { background: var(--hebang-color-primary); }
.hebang-cookie-button--wide { grid-column: 1 / -1; }

.hebang-cookie-button:focus-visible,
.hebang-cookie-close:focus-visible,
.hebang-cookie-policy-link:focus-visible {
  outline: 2px solid var(--hebang-color-primary-dark);
  outline-offset: 3px;
}

.hebang-cookie-dialog {
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: var(--hebang-space-8);
  overflow-y: auto;
  border: 0;
  border-radius: var(--hebang-radius-md);
  box-shadow: var(--hebang-shadow-lg);
}
.hebang-cookie-dialog::backdrop { background: var(--hebang-color-overlay); }
.hebang-cookie-dialog:not([open]) { display: none; }

.hebang-cookie-dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.hebang-cookie-close {
  display: grid;
  place-items: center;
  flex: 0 0 var(--hebang-hit-min);
  width: var(--hebang-hit-min);
  height: var(--hebang-hit-min);
  margin: -8px -8px -8px 0;
  padding: 10px;
  border: 0;
  border-radius: var(--hebang-radius);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.hebang-cookie-close svg { width: 24px; height: 24px; }
.hebang-cookie-close:hover { background: var(--hebang-color-primary); }

.hebang-cookie-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hebang-space-6);
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--hebang-color-border-input);
}
.hebang-cookie-category > div { min-width: 0; }
.hebang-cookie-category p { font-size: var(--hebang-fs-13); }
.hebang-cookie-always { flex-shrink: 0; font-size: var(--hebang-fs-12); }

/* 原生 checkbox 承载可访问状态；视觉开关由 checked 和 focus-visible 同步。 */
.hebang-cookie-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 52px;
  width: 52px;
  min-height: var(--hebang-hit-min);
  cursor: pointer;
}
.hebang-cookie-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.hebang-cookie-switch span {
  width: 52px;
  height: 28px;
  border: 1px solid var(--hebang-color-primary-dark);
  border-radius: var(--hebang-radius-pill);
  background: var(--hebang-color-border-input);
  pointer-events: none;
}
.hebang-cookie-switch span::after {
  display: block;
  width: 20px;
  height: 20px;
  margin: 3px;
  border-radius: 50%;
  background: var(--hebang-color-white);
  content: '';
  transition: transform var(--hebang-dur-fast) var(--hebang-ease);
}
.hebang-cookie-switch input:checked + span { background: var(--hebang-color-primary-dark); }
.hebang-cookie-switch input:checked + span::after { transform: translateX(24px); }
.hebang-cookie-switch input:focus-visible + span { outline: 2px solid var(--hebang-color-primary-dark); outline-offset: 3px; }
.hebang-cookie-dialog .hebang-cookie-duration { margin: 24px 0 20px; font-size: var(--hebang-fs-13); }

.hebang-cookie-status {
  position: fixed;
  left: var(--hebang-space-6);
  bottom: calc(var(--hebang-space-6) + env(safe-area-inset-bottom));
  z-index: var(--hebang-z-floating);
  max-width: min(440px, calc(100vw - 40px));
  margin: 0;
  padding: 12px 18px;
  border-left: 3px solid var(--hebang-color-primary);
  border-radius: var(--hebang-radius);
  box-shadow: var(--hebang-shadow-md);
}
.hebang-cookie-status:empty { display: none; }

.hebang-cookie-map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 180px 24px 30px;
  background: var(--hebang-color-surface-alt);
  text-align: center;
}
.hebang-cookie-map-placeholder strong { color: var(--hebang-color-primary-heading); font-size: var(--hebang-fs-24); }
.hebang-cookie-map-placeholder p { max-width: 600px; margin: 0; font-size: var(--hebang-fs-15); }

/* 授权卡片保留页头入口，超高内容在卡片内滚动，外围浮钮由外壳避让。 */
@media (width < 768px) {
  .hebang-cookie-card {
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    max-height: calc(100dvh - var(--hebang-header-height, 72px) - 24px - env(safe-area-inset-bottom));
    padding: 18px;
  }
  .hebang-cookie-dialog { padding: 22px; }
  .hebang-cookie-category { gap: 12px; }
  .hebang-cookie-status { left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: calc(100vw - 84px); }
  /* 地址卡在窄屏已移到地图下方，占位内容不再为它预留上方空间。 */
  .hebang-contactmap-embed:has(.hebang-cookie-map-placeholder:not([hidden])) { min-height: 360px; }
  .hebang-cookie-map-placeholder { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .hebang-cookie-button,
  .hebang-cookie-switch span::after { transition: none; }
}
