/*!
 * safari-guide.css — iOS Facebook 内置浏览器「去 Safari 打开」引导浮层
 * v1 / 2026-10-24
 * 仅由 #safariGuide 使用；不影响站点其他样式。
 */

.safari-guide[hidden] { display: none !important; }

.safari-guide {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  background: rgba(8, 9, 12, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.safari-guide__panel {
  width: 100%;
  max-width: 420px;
  text-align: center;
  color: #e8eaed;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  padding: 26px 22px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.safari-guide__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #fff;
  background: linear-gradient(160deg, #2f8bff, #0a63d6);
  box-shadow: 0 8px 22px rgba(10, 99, 214, 0.45);
}

.safari-guide__title {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 800;
}

.safari-guide__desc {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.65;
  color: #9aa0a6;
}

.safari-guide__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.safari-guide__btn {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 46px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e8eaed;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.safari-guide__btn:active { transform: scale(0.985); opacity: 0.9; }

.safari-guide__btn--primary {
  background: linear-gradient(160deg, #2f8bff, #0a63d6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px rgba(10, 99, 214, 0.35);
}

/* gate 模式：没有「继续留在这里」这条出路 */
.safari-guide[data-safari-mode="gate"] .safari-guide__btn--ghost { display: none !important; }
/* embedded / ios-once 模式保留该按钮 */
.safari-guide[data-safari-mode="embedded"] .safari-guide__btn--ghost,
.safari-guide[data-safari-mode="ios-once"] .safari-guide__btn--ghost { display: block; }

.safari-guide__status {
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #7ee0a1;
}

.safari-guide__status[data-tone="error"] { color: #ff8f8f; }

.safari-guide__fallback { margin-top: 12px; text-align: left; }

.safari-guide__fallback-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: #9aa0a6;
}

.safari-guide__fallback-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.35);
  color: #e8eaed;
  font-size: 12.5px;
  -webkit-user-select: text;
  user-select: text;
}

.safari-guide__hint {
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: #6b7280;
}

/* 诊断面板：仅 ?safari-debug=1 时由 JS 取消 hidden */
.safari-diagnostics {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483001;
  max-height: 42vh;
  overflow: auto;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #c9d1d9;
  font-size: 11.5px;
  line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.safari-diagnostics[hidden] { display: none !important; }
.safari-diagnostics summary { cursor: pointer; color: #e8eaed; font-weight: 700; }
.safari-diagnostics pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-user-select: text;
  user-select: text;
}

/* 浮层打开时锁住底层滚动（JS 同时设置 overflow，双保险） */
html.safari-guide-locked,
body.safari-guide-locked {
  overflow: hidden !important;
  touch-action: none;
}
