/* 基础样式：变量、重置、布局、导航、页脚、按钮与通用组件 */
/* =========================================================
   资源站 · 白色主题
   浅色底 + 白色卡片 + 强调色点缀，整体比例更紧凑。
   ========================================================= */
:root {
  --ink: #172033;
  --ink-soft: #4a5568;
  --ink-dim: #7b879b;
  --line: rgba(23, 32, 51, .08);
  --line-strong: rgba(23, 32, 51, .14);
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-mute: #f2f5f9;
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .84);
  --stroke: rgba(23, 32, 51, .08);
  --stroke-bright: rgba(23, 32, 51, .13);
  --accent: #12b886;
  --accent-ink: #0d6950;
  --accent-soft: rgba(18, 184, 134, .12);
  --accent-blue: #3b82f6;
  --blue: #2563eb;
  --blue-soft: #eef4ff;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --rose: #e11d48;
  --rose-soft: #fff1f2;
  --danger: #d92d20;
  --shadow: 0 18px 50px rgba(23, 32, 51, .08);
  --shadow-soft: 0 8px 26px rgba(23, 32, 51, .06);
  --blur-sm: 8px;
  --blur-md: 14px;
  --blur-lg: 18px;
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 13px;
  --radius-sm: 10px;
  --page-bg-image: none;
  --font: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: #f5f7fb; }
body {
  position: relative;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  background:
    radial-gradient(circle at 12% 0%, rgba(18, 184, 134, .06), transparent 28%),
    radial-gradient(circle at 94% 4%, rgba(59, 130, 246, .05), transparent 26%),
    #f5f7fb;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* 自定义背景层：页面本身透明，图片固定在视口上，再叠一层浅色薄纱保证可读性。 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(180deg, rgba(247, 249, 252, .3), rgba(247, 249, 252, .44)),
    radial-gradient(circle at 50% 0%, rgba(247, 249, 252, .06), rgba(247, 249, 252, .22)),
    var(--page-bg-image);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(6px) saturate(1.06);
  transform: scale(1.04);
  opacity: 0;
  transition: opacity .5s ease;
}
body.has-custom-bg { background: transparent; }
body.has-custom-bg::before { opacity: 1; }
#app { position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a, button, input, textarea, select, [role="button"] { -webkit-tap-highlight-color: transparent; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
::selection { background: var(--accent-soft); color: var(--ink); }
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(23, 32, 51, .16); border: 3px solid transparent; border-radius: 20px; background-clip: content-box; }

.rh-icon { width: 1em; height: 1em; display: inline-block; flex: 0 0 auto; vertical-align: -.12em; }
.desktop-only { display: initial; }
.muted-text { color: var(--ink-dim); font-size: 10.5px; }

/* ---------- 基础布局 ---------- */
.shell, .nav-shell, .page-main, .site-footer { width: min(1060px, calc(100% - 40px)); margin: 0 auto; }
.site-header { position: relative; z-index: 40; padding-top: max(14px, env(safe-area-inset-top)); }
.nav-shell {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 10px 8px 16px;
  border-radius: 16px;
  position: relative;
}
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(150%);
  backdrop-filter: blur(var(--blur-md)) saturate(150%);
}
.glass-strong {
  background: var(--glass-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(150%);
  backdrop-filter: blur(var(--blur-lg)) saturate(150%);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent-ink), #27374b);
  box-shadow: 0 6px 16px rgba(23, 32, 51, .16), inset 0 1px 0 rgba(255, 255, 255, .22);
  color: #fff;
}
.brand-mark .rh-icon { width: 19px; height: 19px; stroke-width: 2; }
/* 管理员上传的站点头像：图片填满方形 Logo 区域，不再叠加默认渐变。 */
.brand-mark.has-avatar { background: var(--surface); border: 1px solid var(--line); overflow: hidden; padding: 0; }
.brand-mark.has-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.brand-text { min-width: 0; }
.brand-text strong { display: block; font-size: 14px; line-height: 1.2; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { display: block; margin-top: 2px; font-size: 7.5px; font-weight: 700; letter-spacing: .18em; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav-links a { padding: 7px 12px; border-radius: 9px; color: var(--ink-soft); font-size: 12.5px; font-weight: 600; transition: background .18s, color .18s; }
.nav-links a:hover { background: var(--surface-mute); color: var(--ink); }
.nav-links a.active { color: var(--accent-ink); background: var(--accent-soft); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.nav-icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  color: var(--ink-soft); border: 1px solid var(--line); background: var(--surface);
  transition: background .18s, color .18s, border-color .18s;
}
.nav-icon-btn:hover { background: var(--surface-soft); color: var(--ink); border-color: var(--line-strong); }
.nav-icon-btn .rh-icon { width: 16px; height: 16px; }

/* 不建立独立层叠上下文，手机端抽屉 / 弹窗才能盖住顶部导航。 */
.page-main { padding: 26px 0 42px; }
.site-footer {
  padding: 20px 0 max(26px, env(safe-area-inset-bottom));
  color: var(--ink-dim); font-size: 10.5px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border-top: 1px solid var(--line);
}
.site-footer strong { color: var(--ink-soft); font-weight: 600; }
.footer-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.footer-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(23, 32, 51, .22); }
.footer-live { display: inline-flex; align-items: center; gap: 6px; }
.footer-live::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- 通用组件 ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-dim); }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: linear-gradient(90deg, var(--accent-ink), transparent); }
.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 10px;
  color: var(--ink-soft); letter-spacing: .02em; box-shadow: 0 3px 10px rgba(23, 32, 51, .04);
}
.eyebrow-pill .pulse-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.gradient-text { background: linear-gradient(115deg, var(--accent-ink), #2563eb 78%); -webkit-background-clip: text; background-clip: text; color: transparent; }

.btn {
  min-height: 38px; padding: 0 15px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .01em; border: 1px solid transparent;
  transition: transform .18s, box-shadow .18s, background .18s, border-color .18s;
}
.btn:active { transform: scale(.985); }
.btn .rh-icon { width: 15px; height: 15px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, #2563eb, #6d28d9); box-shadow: 0 8px 20px rgba(59, 91, 219, .24); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(59, 91, 219, .32); }
.btn-download { color: #fff; background: linear-gradient(135deg, #12b886, #0a7a5c); box-shadow: 0 8px 20px rgba(18, 184, 134, .22); }
.btn-download:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(18, 184, 134, .3); }
.btn-update { color: #fff; background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 8px 20px rgba(217, 119, 6, .2); }
.btn-update:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(217, 119, 6, .28); }
.btn-blue { color: #fff; background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 8px 20px rgba(37, 99, 235, .2); }
.btn-blue:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(37, 99, 235, .28); }
.btn-tinted { color: var(--tone-ink, var(--blue)); background: var(--tone-soft, var(--blue-soft)); border-color: transparent; }
.btn-glass { color: var(--ink); background: var(--surface); border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(23, 32, 51, .05); }
.btn-glass:hover { background: var(--surface-soft); border-color: rgba(23, 32, 51, .2); transform: translateY(-1px); }
.btn-ghost { color: var(--ink-soft); background: transparent; border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-mute); color: var(--ink); }
.btn-lg { min-height: 44px; padding: 0 20px; border-radius: 13px; font-size: 13.5px; }
.btn-icon { width: 38px; min-height: 38px; padding: 0; flex: 0 0 38px; }
.btn.is-disabled { opacity: .5; pointer-events: none; }

.tone-green { --tone-ink: #0d6950; --tone-soft: #e9f9f3; --tone-fill: #12b886; }
.tone-blue { --tone-ink: #1d4ed8; --tone-soft: #eef4ff; --tone-fill: #3b82f6; }
.tone-violet { --tone-ink: #6d28d9; --tone-soft: #f5f3ff; --tone-fill: #8b5cf6; }
.tone-amber { --tone-ink: #b45309; --tone-soft: #fffaeb; --tone-fill: #f59e0b; }
.tone-rose { --tone-ink: #be123c; --tone-soft: #fff1f2; --tone-fill: #f43f5e; }
.icon-orb {
  position: relative;
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: var(--tone-ink, var(--accent-ink)); background: var(--tone-soft, var(--accent-soft));
  border: 1px solid rgba(23, 32, 51, .06);
  overflow: hidden; flex: 0 0 auto;
}
/* 头像绝对定位，尺寸只由外层容器决定，不会被图片撑成“大头”。 */
.icon-orb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.icon-orb .rh-icon { width: 18px; height: 18px; }

.empty-state { padding: 38px 20px; border-radius: 16px; text-align: center; border: 1px dashed var(--line-strong); background: rgba(255, 255, 255, .7); }
.empty-icon { width: 46px; height: 46px; border-radius: 13px; margin: 0 auto 12px; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent-soft); border: 1px solid var(--line); }
.empty-icon .rh-icon { width: 21px; height: 21px; }
.empty-state h3 { font-size: 14.5px; letter-spacing: -.02em; margin-bottom: 5px; }
.empty-state p { max-width: 380px; margin: 0 auto 14px; font-size: 11px; color: var(--ink-dim); line-height: 1.7; }
.empty-state .btn { min-height: 34px; font-size: 11px; }

