/*
 * 收藏引导弹窗（#seo-bookmark-popup，BookmarkPopup.astro + bookmark-popup.js）。
 * 基础样式在此；移动端底部 sheet 规则在 mobile-experience.css（断点 767 对齐）。
 * 颜色只消费站点变量（--brand/--text/--muted/--line/--panel-bg），theme=AUTO 即跟随 theme-dark/theme-light。
 */

#seo-bookmark-popup {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#seo-bookmark-popup[hidden] {
  display: none;
}

body.bp-open {
  overflow: hidden;
}

/* theme=LIGHT/DARK 时脚本加类，强制弹层局部配色 */
#seo-bookmark-popup.bp-light {
  color-scheme: light;
  --text: #172033;
  --muted: #667085;
  --line: #e5e7eb;
  --panel-bg: #ffffff;
}

#seo-bookmark-popup.bp-dark {
  color-scheme: dark;
  --text: #f3f4f6;
  --muted: #9aa3b2;
  --line: #2a2f3a;
  --panel-bg: #171b22;
}

.bp-mask {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 55%);
}

.bp-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(80vh, 640px);
  overflow-y: auto;
  padding: 22px 20px 18px;
  color: var(--text);
  background: var(--panel-bg, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgb(0 0 0 / 24%);
}

.bp-panel:focus {
  outline: none;
}

.bp-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 6%, var(--panel-bg, #fff));
  color: var(--muted);
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bp-close:hover {
  background: color-mix(in srgb, var(--text) 14%, var(--panel-bg, #fff));
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
  color: var(--text);
}

.bp-close:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.bp-close-icon {
  display: block;
}

.bp-close[hidden] {
  display: none;
}

.bp-autoclose {
  margin: 14px 0 2px;
}

.bp-autoclose-track {
  height: 3px;
  overflow: hidden;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: 999px;
}

.bp-autoclose-bar {
  display: block;
  width: 100%;
  height: 100%;
  background: color-mix(in srgb, var(--brand) 65%, transparent);
  border-radius: inherit;
  transition: width 1s linear;
}

.bp-autoclose-text {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.bp-title {
  margin: 0 44px 8px 0;
  font-size: 17px;
  line-height: 1.4;
  color: var(--text);
}

.bp-desc {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.bp-url {
  margin: 0 0 14px;
  padding: 8px 10px;
  font-family: Consolas, Menlo, monospace;
  font-size: 13px;
  color: var(--text);
  background: color-mix(in srgb, var(--brand) 6%, var(--panel-bg, #fff));
  border: 1px solid var(--line);
  border-radius: 8px;
  user-select: all;
  overflow-wrap: anywhere;
}

.bp-tip {
  margin: -6px 0 12px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.bp-cta {
  display: block;
  width: 100%;
  min-height: 40px;
  margin: 0 0 10px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
}

.bp-cta-secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 400;
  line-height: 38px;
}

.bp-feedback {
  margin: -4px 0 10px;
  font-size: 12px;
  color: var(--brand);
}

.bp-feedback[hidden] {
  display: none;
}

.bp-hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  background: color-mix(in srgb, var(--brand) 8%, var(--panel-bg, #fff));
  border: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line));
  border-radius: 10px;
}

.bp-hint[hidden] {
  display: none;
}

.bp-hint-item {
  margin: 0;
}

.bp-contacts {
  margin: 4px 0 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.bp-contacts-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.bp-contact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bp-contact-item {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
  font-size: 13px;
}

.bp-contact-label {
  color: var(--muted);
}

.bp-contact-value {
  color: var(--text);
  overflow-wrap: anywhere;
  user-select: all;
}

.bp-contact-link {
  color: var(--brand);
}
