/* ==========================================================================
   components-overlays.css — 浮层组件（免责声明门禁 / 分享菜单）
   适用范围：三页共用门禁面板、卡片头部分享菜单
   加载顺序：components-feedback.css 之后
   依赖：base.css 的设计令牌；所有关键属性均带 var() 回退值
   ========================================================================== */

/* --------------------------------------------------------------------------
   免责声明门禁
   -------------------------------------------------------------------------- */
.gate {
  max-width: 720px;
  margin: 0 auto;
}
.gate__panel {
  padding: 20px;
  border: 1px solid #e2e6eb;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm);
}
.gate__title {
  margin: 0 0 6px;
}
.gate__meta {
  margin: 0 0 16px;
  color: #5b6675;
  color: var(--color-muted);
  font-size: 0.875rem;
  font-size: var(--text-sm);
}

/* 可滚动声明正文：固定高度 + 独立滚动；键盘可聚焦滚动 */
.gate__scroll {
  max-height: 52vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px;
  border: 1px solid #e2e6eb;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  background: var(--color-surface-2);
}
/* 解锁时边框与光晕强调（颜色变化不动画 → 任何档位都可用） */
.gate--unlocked .gate__scroll {
  border-color: #1d4ed8;
  border-color: var(--color-primary);
}
.gate__doc h2 {
  margin: 18px 0 8px;
  font-size: 1rem;
}
.gate__doc h2:first-child {
  margin-top: 0;
}
.gate__doc p {
  margin: 0 0 10px;
}
.gate__doc p:last-child {
  margin-bottom: 0;
}

/* 滚动进度条：fill 使用 transform: scaleX 更新，避免触发布局重排 */
.gate__progress {
  height: 6px;
  margin: 14px 0 16px;
  border-radius: 999px;
  background: #e2e6eb;
  background: var(--color-border);
  overflow: hidden;
}
.gate__progress-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: #1d4ed8;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 120ms linear;
}
.gate__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  gap: var(--space-3);
}

/* 拒绝提示：只显示一句提示，不提供任何其他入口 */
.refusal {
  max-width: 560px;
  margin: 48px auto;
  padding: 40px 24px;
  border: 1px solid #e2e6eb;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  background: var(--color-surface);
  text-align: center;
}
.refusal__message {
  margin: 0;
  font-size: 1.125rem;
  font-size: var(--text-lg);
}

/* --------------------------------------------------------------------------
   分享菜单：点击分享按钮后浮出（淡入缩放由动画层负责）
   -------------------------------------------------------------------------- */
.menu-wrap {
  position: relative;
  display: inline-block;
}
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 264px;
  max-width: calc(100vw - 24px);
  display: none;
  padding: 6px;
  border: 1px solid #e2e6eb;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  border-radius: var(--radius-md);
  background: #ffffff;
  background: var(--color-surface);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-md);
}
.menu.is-open {
  display: block;
}
.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #1f2937;
  color: var(--color-text);
  font-family: inherit;
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
}
.menu__item:hover {
  background: #f8fafc;
  background: var(--color-surface-2);
}
.menu__note {
  margin-top: 4px;
  padding: 8px 12px 10px;
  border-top: 1px solid #e2e6eb;
  border-top: 1px solid var(--color-border);
  color: #5b6675;
  color: var(--color-muted);
  font-size: 0.8125rem;
  font-size: var(--text-xs);
}

/* --------------------------------------------------------------------------
   非主站域名提示（页头常驻警告 + 进入前弹窗，每个标签会话一次）
   警示配色沿用站点 warning 令牌（浅/深色均可读）；弹窗主按钮「前往主站点」
   -------------------------------------------------------------------------- */
/* 页头常驻警告：始终独占一行（挂载时为页头加 --warn 允许换行，避免挤压导航） */
.host-warning {
  display: inline-flex;
  flex-basis: 100%;        /* 独占一行 */
  align-items: center;
  justify-content: center; /* 默认居中（手机） */
  order: 1;                /* 手机：位于工具行之后、导航之前 */
  gap: 6px;
  margin-top: 4px;
  padding: 4px 10px;
  border: 1px solid #f0b429;
  border: 1px solid var(--color-warning-border);
  border-radius: 6px;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  background: var(--color-warning-bg);
  color: #8a4b04;
  color: var(--color-warning-text);
  font-size: 0.8125rem;
  font-size: var(--text-xs);
  line-height: 1.4;
}
.site-header__inner--warn {
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.host-warning__link {
  color: #8a4b04;
  color: var(--color-warning-text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.host-warning__link:hover {
  color: #8a4b04;
  color: var(--color-warning-text);
  text-decoration-thickness: 2px;
}
/* 桌面：警告排在最后一行并右对齐（标题栏右侧） */
@media (min-width: 641px) {
  .host-warning {
    order: 9;
    justify-content: flex-end;
    margin-top: 0;
  }
}

.host-notice-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 23, 42, 0.5);
}
.host-notice {
  width: 100%;
  max-width: 480px;
  padding: 20px;
  border: 1px solid #f0b429;
  border: 1px solid var(--color-warning-border);
  border-left-width: 6px;
  border-radius: 14px;
  border-radius: var(--radius-lg);
  background: #fffbeb;
  background: var(--color-warning-bg);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.06);
  box-shadow: var(--shadow-md);
}
.host-notice__title {
  margin: 0 0 8px;
  color: #8a4b04;
  color: var(--color-warning-text);
  font-size: 1.125rem;
  font-size: var(--text-lg);
}
.host-notice__text {
  margin: 0 0 16px;
}
.host-notice__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  gap: var(--space-3);
}
/* 警示面板上的次要按钮：琥珀描边，避免白底突兀 */
.host-notice .btn--ghost {
  border-color: #f0b429;
  border-color: var(--color-warning-border);
  color: #8a4b04;
  color: var(--color-warning-text);
}

