/* 效果样式：加载动画与自定义背景图玻璃层 */
/* ---------- 居中圆形加载动画 ---------- */
.circle-spinner {
  width: 38px; height: 38px; border-radius: 50%; display: block;
  border: 3px solid rgba(23, 32, 51, .1);
  border-top-color: var(--blue);
  border-right-color: var(--violet);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.route-loading {
  position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center;
  pointer-events: none; opacity: 0; transition: opacity .18s ease;
}
.route-loading .circle-spinner { width: 34px; height: 34px; border-width: 3px; filter: drop-shadow(0 6px 16px rgba(37, 99, 235, .2)); }
.route-loading.active { opacity: 1; }
.boot-screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; }
.boot-screen .circle-spinner { width: 44px; height: 44px; border-width: 3.5px; }
.boot-copy { text-align: center; }
.boot-text { font-size: 11px; letter-spacing: .16em; color: var(--ink-soft); }
.boot-sub { display: block; margin-top: 6px; font-size: 7.5px; letter-spacing: .36em; color: var(--ink-dim); opacity: .7; }
.loader-screen { min-height: calc(100vh - 150px); min-height: calc(100dvh - 150px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 26px 16px; }
.loader-screen > p { font-size: 10.5px; color: var(--ink-dim); letter-spacing: .12em; }
.loader-card { width: min(420px, 88vw); padding: 24px 20px; border-radius: 18px; text-align: center; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.boot-fail { min-height: 70vh; width: min(420px, 88vw); margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.boot-fail-icon { width: 42px; height: 42px; margin-bottom: 3px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; font-weight: 800; color: #b54708; background: #fffaeb; border: 1px solid #fedf89; }
.boot-fail h2 { font-size: 17px; letter-spacing: -.02em; }
.boot-fail-detail { font-size: 11px; color: var(--ink-soft); line-height: 1.7; word-break: break-word; }
.boot-fail-hint { font-size: 9.5px; color: var(--ink-dim); line-height: 1.8; max-width: 320px; }
.boot-fail-retry { margin-top: 6px; }

.toast-host { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 7px; align-items: center; pointer-events: none; }
.toast { max-width: min(400px, calc(100vw - 28px)); padding: 9px 14px; border-radius: 10px; color: #f8fafc; background: rgba(23, 32, 51, .94); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 14px 38px rgba(23, 32, 51, .28); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); font-size: 10.5px; animation: toast-in .24s cubic-bezier(.2, .8, .2, 1); }
.toast.error { color: #ffe4e6; border-color: rgba(255, 141, 151, .3); }
.toast.success { color: #d3fae9; border-color: rgba(52, 211, 153, .3); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
/* 注意：不要使用 forwards/both，动画结束后必须让 transform 回到 none，
   否则会为手机端抽屉和弹窗制造 fixed 包含块，导致它们相对正文而不是视口定位。 */
.page-enter { animation: page-in .38s cubic-bezier(.2, .8, .2, 1); }
@keyframes page-in { from { opacity: 0; transform: translateY(7px); } }
.skeleton { border-radius: 14px; background: linear-gradient(90deg, #eef2f6, #f8fafc, #eef2f6); background-size: 220% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* ---------- 自定义背景：半透明毛玻璃，让背景图透出来 ---------- */
body.has-custom-bg { --glass: rgba(255, 255, 255, .38); --glass-strong: rgba(255, 255, 255, .48); }
body.has-custom-bg .nav-shell,
body.has-custom-bg .home-hero,
body.has-custom-bg .home-hub,
body.has-custom-bg .home-search-panel,
body.has-custom-bg .category-card,
body.has-custom-bg .resource-row,
body.has-custom-bg .search-box,
body.has-custom-bg .stage-panel,
body.has-custom-bg .intro-flow,
body.has-custom-bg .empty-state,
body.has-custom-bg .category-headline,
body.has-custom-bg .sidebar-panel,
body.has-custom-bg .detail-hero,
body.has-custom-bg .glass-card,
body.has-custom-bg .browse-card,
body.has-custom-bg .browse-tile,
body.has-custom-bg .result-category,
body.has-custom-bg .feature-card,
body.has-custom-bg .intro-cta {
  background: rgba(255, 255, 255, .5);
  border-color: rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  box-shadow: 0 12px 36px rgba(23, 32, 51, .08), inset 0 1px 0 rgba(255, 255, 255, .55);
}
body.has-custom-bg .stage-row,
body.has-custom-bg .eyebrow-pill,
body.has-custom-bg .category-count,
body.has-custom-bg .res-version,
body.has-custom-bg .back-pill,
body.has-custom-bg .browse-exit,
body.has-custom-bg .browse-count,
body.has-custom-bg .browse-lead-stats span,
body.has-custom-bg .home-hero-stats span,
body.has-custom-bg .cat-badge,
body.has-custom-bg .nav-icon-btn,
body.has-custom-bg .view-pill,
body.has-custom-bg .browse-group-count { background: rgba(255, 255, 255, .4); border-color: rgba(255, 255, 255, .5); }
body.has-custom-bg .sidebar-link:hover,
body.has-custom-bg .stage-search { background: rgba(255, 255, 255, .34); }
body.has-custom-bg .sidebar-link.active { background: rgba(255, 255, 255, .5); }
body.has-custom-bg .intro-copy h1 .line-soft,
body.has-custom-bg .page-hero h1,
body.has-custom-bg .category-headline-text h1,
body.has-custom-bg .detail-info h1 { text-shadow: 0 1px 3px rgba(255, 255, 255, .8); }
body.has-custom-bg .intro-copy,
body.has-custom-bg .page-hero,
body.has-custom-bg .browse-hero { position: relative; isolation: isolate; }
body.has-custom-bg .intro-copy::before,
body.has-custom-bg .page-hero::before {
  content: "";
  position: absolute;
  inset: -18px -20px;
  z-index: -1;
  border-radius: 22px;
  background: rgba(255, 255, 255, .4);
  border: 1px solid rgba(255, 255, 255, .46);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 16px 44px rgba(23, 32, 51, .07), inset 0 1px 0 rgba(255, 255, 255, .5);
}
body.has-custom-bg .browse-hero::before { inset: -14px -18px; }
body.has-custom-bg .section-head,
body.has-custom-bg .section-block-head,
body.has-custom-bg .browse-body-head {
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .38);
  border: 1px solid rgba(255, 255, 255, .44);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
}
body.has-custom-bg .breadcrumbs {
  padding: 4px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .4);
  border: 1px solid rgba(255, 255, 255, .46);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
}
body.has-custom-bg .site-footer {
  margin-top: 14px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 255, 255, .46);
  border-radius: 14px;
  background: rgba(255, 255, 255, .4);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
}
body.has-custom-bg .browse-foot-note {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .44);
  border-radius: 10px;
  background: rgba(255, 255, 255, .36);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
}

