/* ════════════════════════════════════════════════════════════
   阁楼全站主题引擎(2026-06-12)— 纸 / 水玻璃 / 泡泡
   主页(index)有内置主题系统;本文件服务其余子页。
   paper = 各页原样;glass / bubble = 变量重定义 + 通用卡片改造。
   选择与主页共用 localStorage 的 fox.theme,全站同步。
   ════════════════════════════════════════════════════════════ */

/* ── 切换钮(右上角小胶囊,theme.js 注入)── */
.theme-pick-mini {
  position: fixed; top: 10px; right: 12px; z-index: 999;
  display: flex; gap: 2px; padding: 4px 8px;
  font-size: 11px; letter-spacing: 0.08em; border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 3px 10px rgba(100, 120, 140, 0.15);
}
.theme-pick-mini button {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: inherit; color: #8a8078; padding: 2px 6px; border-radius: 999px;
}
.theme-pick-mini button.on { background: rgba(255,255,255,0.75); color: #5a8aa0; font-weight: 600; }
body[data-theme="bubble"] .theme-pick-mini button.on { color: #56a8a4; }
body[data-page="vent"] .theme-pick-mini { background: rgba(40, 50, 58, 0.6); border-color: rgba(255,255,255,0.14); }
body[data-page="vent"] .theme-pick-mini button { color: #98a8b0; }

/* ════ 水玻璃:变量重定义(覆盖各页 :root 旧变量)════ */
body[data-theme="glass"] {
  --cream: #dfeaf2;
  --card: rgba(255, 255, 255, 0.46);
  --dark: #2a414d;
  --light: #6e8b99;
  --rose: #b87a90;
  --soft-green: #5fa098;
  --mint: #8fc4bd;
  --pink: #d9a3b4;
  --gold: #c0a36e;
  --cream-dark: rgba(235, 243, 248, 0.6);
  background:
    radial-gradient(640px 520px at 12% 6%, rgba(140, 196, 232, 0.50), transparent 62%),
    radial-gradient(560px 480px at 88% 22%, rgba(196, 168, 228, 0.42), transparent 60%),
    radial-gradient(700px 600px at 22% 88%, rgba(150, 222, 200, 0.45), transparent 58%),
    radial-gradient(520px 460px at 78% 72%, rgba(255, 190, 205, 0.32), transparent 62%),
    linear-gradient(160deg, #e9f1f6 0%, #dcebf1 45%, #d2e4ed 100%) !important;
  background-attachment: fixed !important;
}
/* 通用卡片玻璃化:各页主要容器类宽撒网(不存在的类无副作用) */
body[data-theme="glass"] .post-area, body[data-theme="glass"] .post,
body[data-theme="glass"] .moment, body[data-theme="glass"] .moment-card,
body[data-theme="glass"] .question-card, body[data-theme="glass"] .record-box,
body[data-theme="glass"] .write-box, body[data-theme="glass"] .stat-box,
body[data-theme="glass"] .h-item, body[data-theme="glass"] .now-playing,
body[data-theme="glass"] .search-box, body[data-theme="glass"] .level-bar,
body[data-theme="glass"] .badge, body[data-theme="glass"] .card,
body[data-theme="glass"] .diary-card, body[data-theme="glass"] .diary-entry,
body[data-theme="glass"] .mood-card, body[data-theme="glass"] .day-cell,
body[data-theme="glass"] .item, body[data-theme="glass"] .box,
body[data-theme="glass"] .stats-row, body[data-theme="glass"] .calendar-box {
  background: linear-gradient(172deg, rgba(255,255,255,0.46) 0%, rgba(255,255,255,0.28) 100%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.75) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(130, 165, 190, 0.2),
    0 10px 28px rgba(80, 120, 155, 0.15) !important;
  border-radius: 16px !important;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
body[data-theme="glass"] input, body[data-theme="glass"] textarea, body[data-theme="glass"] select {
  background: rgba(255, 255, 255, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  color: var(--dark) !important;
}
/* 树洞特调:深色水玻璃,不破坏树洞的夜气质 */
body[data-page="vent"][data-theme="glass"] {
  --dark-bg: transparent; --dark-card: rgba(28, 42, 52, 0.55);
  --soft: #c2d4dc; --dim: #7e95a2; --ember: #c98a96;
  background:
    radial-gradient(640px 520px at 16% 10%, rgba(60, 110, 150, 0.35), transparent 60%),
    radial-gradient(600px 520px at 84% 80%, rgba(90, 70, 130, 0.28), transparent 58%),
    linear-gradient(165deg, #18242c 0%, #131d24 60%, #0e161c 100%) !important;
}
body[data-page="vent"][data-theme="glass"] .write-box,
body[data-page="vent"][data-theme="glass"] .item,
body[data-page="vent"][data-theme="glass"] .card {
  background: rgba(34, 50, 62, 0.5) !important;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid rgba(160, 190, 210, 0.18) !important;
  box-shadow: inset 0 1px 0 rgba(200, 225, 240, 0.12), 0 10px 26px rgba(0, 0, 0, 0.3) !important;
  border-radius: 16px !important;
}
body[data-page="vent"][data-theme="glass"] input,
body[data-page="vent"][data-theme="glass"] textarea {
  background: rgba(20, 32, 40, 0.6) !important;
  border: 1px solid rgba(160, 190, 210, 0.22) !important;
  color: #d8e4ea !important;
}

/* ════ 泡泡 🫧:变量重定义 ════ */
body[data-theme="bubble"] {
  --cream: #f3fafa;
  --card: rgba(255, 255, 255, 0.74);
  --dark: #3a4a4e;
  --light: #8aa6a8;
  --rose: #e8a4b8;
  --soft-green: #6dbcb8;
  --mint: #9ad8d4;
  --pink: #f4bccb;
  --gold: #d8bc8a;
  --cream-dark: #e6f3f4;
  background: linear-gradient(170deg, #fdfbf8 0%, #eef7f7 55%, #dcf0f2 100%) !important;
  background-attachment: fixed !important;
}
body[data-theme="bubble"] .post-area, body[data-theme="bubble"] .post,
body[data-theme="bubble"] .moment, body[data-theme="bubble"] .moment-card,
body[data-theme="bubble"] .question-card, body[data-theme="bubble"] .record-box,
body[data-theme="bubble"] .write-box, body[data-theme="bubble"] .stat-box,
body[data-theme="bubble"] .h-item, body[data-theme="bubble"] .now-playing,
body[data-theme="bubble"] .search-box, body[data-theme="bubble"] .level-bar,
body[data-theme="bubble"] .badge, body[data-theme="bubble"] .card,
body[data-theme="bubble"] .diary-card, body[data-theme="bubble"] .diary-entry,
body[data-theme="bubble"] .mood-card, body[data-theme="bubble"] .day-cell,
body[data-theme="bubble"] .item, body[data-theme="bubble"] .box,
body[data-theme="bubble"] .stats-row, body[data-theme="bubble"] .calendar-box {
  background: rgba(255, 255, 255, 0.74) !important;
  border: 1px solid rgba(126, 198, 194, 0.24) !important;
  border-radius: 20px !important;
  box-shadow: 0 5px 16px rgba(126, 198, 194, 0.12) !important;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
body[data-theme="bubble"] .post-area:hover, body[data-theme="bubble"] .question-card:hover,
body[data-theme="bubble"] .h-item:hover, body[data-theme="bubble"] .moment:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 22px rgba(126, 198, 194, 0.18) !important;
}
/* 树洞的泡泡版:夜里的泡泡 */
body[data-page="vent"][data-theme="bubble"] {
  --dark-bg: transparent; --dark-card: rgba(36, 52, 58, 0.7);
  background: linear-gradient(170deg, #1a262b 0%, #15222a 60%, #102028 100%) !important;
}
body[data-page="vent"][data-theme="bubble"] .bub { opacity: 0.18; }

/* 漂浮泡泡(bubble 主题专属,theme.js 生成) */
#bubbles { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
body[data-theme="bubble"] #bubbles { display: block; }
.bub { position: absolute; bottom: -80px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: radial-gradient(circle at 30% 28%, rgba(255,255,255,0.9), rgba(255,255,255,0.12) 42%, rgba(180,226,228,0.28));
  opacity: 0.38; animation: bubFloat linear infinite; }
@keyframes bubFloat { to { transform: translateY(-118vh); } }
@media (prefers-reduced-motion: reduce) { .bub { animation: none; opacity: 0.16; } }
