/* ═══════════════════════════════════════════════════════════════
   照片背景主题（全站公开页面共用）
   ───────────────────────────────────────────────────────────────
   换图：直接替换 public/assets/background/page-bg.jpg，
         或改下面的 --pg-photo。
   想调暗一点：改 .page-backdrop 里四个 rgba(...) 的透明度（越大越暗）。
   想统一换色：改 body.photo-shell 里的 --c-* 变量。
   这个文件在所有页面样式之后加载，首页也在用。
   ═══════════════════════════════════════════════════════════════ */

:root {
  --pg-photo: url("/assets/background/page-bg.jpg");
}

/* ═══════════════════════════════════════════════════════════════
   照片背景主题
   背景照片放在 public/assets/background/page-bg.jpg（换图同名覆盖即可）。
   叠色浓度、位置在 .page-backdrop；深色文字色在 .photo-shell 里。
   ═══════════════════════════════════════════════════════════════ */

html {
  background-color: #0a0f16;
  scrollbar-color: #5a6b82 #0b1119;
}

html::-webkit-scrollbar-track {
  background: #0b1119;
}

html::-webkit-scrollbar-thumb {
  border-color: #0b1119;
  background: #4a5a70;
}

body.photo-shell {
  color-scheme: dark;
  /* 深色底上的文字与表面颜色，只影响这五页 */
  --c-paper: #0b1119;
  --c-paper-soft: #121a25;
  --c-paper-deep: #182231;
  --c-surface: #101823;
  --c-ink: #e9eef6;
  --c-ink-soft: #c9d3e0;
  --c-muted: #9aa8ba;
  --c-faint: #8593a6;
  --c-line: #334052;
  --c-line-strong: #5c6c82;
  --c-accent: #a9c9ea;
  --c-accent-deep: #c6def7;
  --c-accent-soft: rgba(169, 201, 234, 0.16);
  --c-focus: #cfe3f7;

  /* pages.css 里引用上面颜色的那几个变量要一起换 */
  --pg-line: var(--c-line);
  --pg-accent: var(--c-accent);
  --pg-auth-card-bg: rgba(12, 18, 26, 0.92);

  color: var(--c-ink);
  background: #0a0f16;

  /* 页脚变量在 components.css 里定义了浅色主题的别名；
     这里重新绑定，避免自定义属性先在 :root 上解析成深色字。 */
  --footer-bg: #0b1119;
  --footer-border: rgba(200, 214, 232, 0.12);
  --footer-text: var(--c-ink);
  --footer-muted: var(--c-muted);
}

/* 固定照片 + 叠色，避免长页面上背景被拉变形
   觉得照片太抢内容：把下面 0.88 / 0.64 / 0.72 / 0.95 调大（更暗），
   或者给 .page-backdrop 加 filter: blur(2px); */
.page-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #0a0f16;
  background-image:
    linear-gradient(
      180deg,
      rgba(5, 9, 15, 0.88) 0%,
      rgba(5, 9, 15, 0.64) 26%,
      rgba(5, 9, 15, 0.72) 64%,
      rgba(5, 9, 15, 0.95) 100%
    ),
    radial-gradient(120% 90% at 50% 18%, rgba(5, 9, 15, 0) 0%, rgba(5, 9, 15, 0.35) 100%),
    var(--pg-photo);
  background-position: center 24%;
  background-size: cover;
  background-repeat: no-repeat;
}

/* 照片在上层内容之下、body 底色之上 */
.photo-shell > main,
.photo-shell > footer {
  position: relative;
  z-index: 1;
}

.photo-shell::after {
  opacity: 0.14;
  mix-blend-mode: soft-light;
}

/* 顶栏：透明压在图上看，滚动后变成深色 */
.photo-shell .site-header {
  background: transparent;
}

.photo-shell .site-header.is-scrolled {
  background: rgba(8, 13, 20, 0.9);
  border-bottom-color: rgba(200, 214, 232, 0.12);
}

.photo-shell .brand__mark,
.photo-shell .auth-brand img {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.photo-shell .header-search:hover,
.photo-shell .user-button:hover,
.photo-shell .user-button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.08);
}

.photo-shell .mobile-menu {
  background: #0b1119;
}

.photo-shell .site-footer {
  background: #0b1119;
  border-top: 1px solid rgba(200, 214, 232, 0.1);
}

/* 深色底上按钮、选中态、提示用浅色 */
.photo-shell .btn--primary {
  background: #e7edf6;
  color: #101720;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.24);
}

.photo-shell .btn--primary:hover {
  background: #ffffff;
}

.photo-shell .btn--accent {
  background: var(--c-accent);
  color: #0a121b;
}

.photo-shell .btn--accent:hover {
  background: var(--c-accent-deep);
}

.photo-shell .chip.is-active {
  border-color: #e7edf6;
  background: #e7edf6;
  color: #101720;
}

.photo-shell .chip.is-active .chip__count {
  background: rgba(16, 23, 32, 0.14);
  color: #101720;
}

.photo-shell .bookmark-btn[aria-pressed="true"] {
  border-color: #e7edf6;
  background: #e7edf6;
  color: #101720;
}

.photo-shell .me-tab[aria-selected="true"] .me-tab__count {
  background: #e7edf6;
  color: #101720;
}

.photo-shell .note-card__index {
  background: rgba(9, 14, 21, 0.84);
  color: var(--c-ink);
}

.photo-shell .skip-link {
  background: #e7edf6;
  color: #101720;
}

.photo-shell ::selection {
  background: #e7edf6;
  color: #101720;
}

/* 表单、骨架、提示框在深色底上的细节 */
.photo-shell .input:focus,
.photo-shell .textarea:focus,
.photo-shell .select:focus {
  box-shadow: 0 0 0 3px rgba(169, 201, 234, 0.16);
}

.photo-shell input:-webkit-autofill,
.photo-shell input:-webkit-autofill:hover,
.photo-shell input:-webkit-autofill:focus {
  -webkit-text-fill-color: #e9eef6;
  caret-color: #e9eef6;
  -webkit-box-shadow: 0 0 0 1000px #101823 inset;
}

.photo-shell .skeleton {
  background: #1a2431;
}

.photo-shell .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(220, 232, 246, 0.14), transparent);
}

.photo-shell .toast {
  border-color: rgba(200, 214, 232, 0.14);
  background: #1b2532;
  color: var(--c-cream);
}

.photo-shell .toast--error {
  background: #7c322c;
}

.photo-shell .toast--success {
  background: #2f5a45;
}

.photo-shell .form-error,
.photo-shell .alert--danger {
  border-color: rgba(240, 160, 150, 0.3);
  background: rgba(125, 46, 40, 0.26);
  color: #f0b6ae;
}

.photo-shell .alert--success {
  border-color: rgba(150, 210, 175, 0.26);
  background: rgba(44, 90, 66, 0.3);
  color: #b7e0c6;
}

.photo-shell .alert--warning {
  border-color: rgba(220, 185, 120, 0.26);
  background: rgba(115, 86, 38, 0.3);
  color: #ecd5a4;
}

.photo-shell .page-state--error .page-state__title,
.photo-shell .comments-error__title,
.photo-shell .comments-error__text {
  color: #f0b6ae;
}

.photo-shell .comments-error {
  border-color: rgba(240, 160, 150, 0.28);
  background: rgba(125, 46, 40, 0.24);
}

.photo-shell .comment__delete:hover,
.photo-shell .my-comment__delete:hover,
.photo-shell .me-logout:hover,
.photo-shell .user-dropdown__item--danger {
  color: #f0b6ae;
}

.photo-shell .avatar,
.photo-shell .note-card__cover,
.photo-shell .me-bookmark__cover,
.photo-shell .article-cover img,
.photo-shell .about-avatar {
  border-color: rgba(200, 214, 232, 0.22);
}

.photo-shell .badge--success {
  background: rgba(60, 114, 87, 0.24);
  color: #aad8bf;
}

.photo-shell .badge--warning {
  background: rgba(145, 97, 29, 0.24);
  color: #e7c98f;
}

@media (max-width: 760px) {
  .page-backdrop {
    background-image:
      linear-gradient(
        180deg,
        rgba(5, 9, 15, 0.9) 0%,
        rgba(5, 9, 15, 0.72) 30%,
        rgba(5, 9, 15, 0.8) 66%,
        rgba(5, 9, 15, 0.96) 100%
      ),
      var(--pg-photo);
    background-position: center 18%;
  }
}

