/* =========================================================
   themes.css —— 多皮肤主题系统（前后台通用）
   语义变量 + 主题类（body.theme-xxx 覆盖变量，切换即换肤）
   使用：在 body 上设置主题类，或在页面加载时
   document.body.classList.add('theme-aurora') 等。
   默认主题为 default（青绿玻璃），无需显式类。
   ========================================================= */

/* ---------- 默认主题：青绿玻璃（现有配色） ---------- */
:root,
body.theme-default {
  /* 主色系（前台按钮/链接/强调、后台按钮/选中态通用） */
  --brand: #16baaa;
  --brand-2: #4a67d8;
  --brand-rgb: 22, 186, 170;
  --brand2-rgb: 74, 103, 216;

  /* 后台玻璃背景三段渐变 */
  --bg-g1: #0a1218;
  --bg-g2: #14202b;
  --bg-g3: #1d3340;
  /* 装饰光斑 */
  --glow-a-rgb: 22, 186, 170;
  --glow-b-rgb: 88, 108, 245;
  /* 顶栏 / 侧边栏 / 子菜单 / Logo 底色 */
  --hdr-bg: rgba(23, 45, 72, 0.55);
  --side-bg: rgba(20, 32, 51, 0.5);
  --child-bg: rgba(20, 32, 51, 0.88);
  --logo-bg: rgba(23, 45, 72, 0.55);

  /* 前台页面氛围（深色底 -> 浅色玻璃卡与彩色描边才跳得出来） */
  --page-bg: #0b1514;
  --page-bg-2: #10201d;
  --page-bg-3: #0f2a26;
  --card-bg: rgba(252, 252, 252, 0.644);
  --topbar-bg: rgba(198, 218, 210, 0.93);
  --text-main: #eaf5f1;      /* 卡片之外（深底）文字 */
  --text-body: #dcebe6;
  --text-sub: #a9c1bb;

  /* ============================================================
     前台玻璃卡片（浅绿灰磨砂玻璃 + 品牌色描边 + 深墨字）
     底色浅绿灰半透明（约 72%），blur 后仍透出天气粒子；
     卡内正文 #10201d 相对浅绿灰玻璃约 7:1，满足 WCAG AA
     ============================================================ */
  --glass-bg: rgba(213, 232, 223, 0.72);
  --glass-bg-s: rgba(213, 232, 223, 0.78);
  --glass-blur: 14px;
  --glass-border: rgba(var(--brand-rgb), 0.82);
  --glass-border-hover: rgba(var(--brand-rgb), 1);
  --glass-text: #10201d;
  --glass-text-sub: #2c423d;
  --glass-text-mute: #33473f;
  --glass-text-title: #06120f;
  --glass-text-link: #064e47;
  --glass-text-strong: #064e47;
  --glass-hover-bg: rgba(var(--brand-rgb), 0.16);
  --glass-hover-text: var(--brand);

  /* ============================================================
     后台：浅灰绿磨砂玻璃面板 + 深墨字（面板之外为深色底）
     面板不透明度 0.86–0.88，保证表格/表单在深底上绝对清晰；
     顶栏/侧栏/Logo 外壳保持深色 + 浅字
     ============================================================ */
  --admin-glass-bg: rgba(222, 231, 227, 0.86);
  --admin-glass-bg-s: rgba(210, 221, 216, 0.88);
  --admin-glass-text: #101c1a;
  --admin-glass-text-sub: #33473f;
  --admin-glass-text-mute: #55685f;
  --admin-glass-text-title: #08120f;
  --admin-glass-border: rgba(var(--brand-rgb), 0.78);
  --admin-glass-header-bg: rgba(var(--brand-rgb), 0.16);
  --admin-glass-hover-bg: rgba(var(--brand-rgb), 0.14);
  --admin-glass-selected-bg: rgba(var(--brand-rgb), 0.26);
  --admin-glass-zebra-bg: rgba(6, 46, 40, 0.045);

  /* 后台外壳（顶栏/侧栏/Logo）：深色玻璃 + 浅字 */
  --admin-shell-bg: rgba(16, 30, 30, 0.92);
  --admin-shell-bg-2: rgba(11, 22, 22, 0.96);
  --admin-shell-text: #eaf5f1;
  --admin-shell-text-sub: #b5c9c3;
}

/* ---------- 极光紫（紫罗兰 × 品红） ---------- */
body.theme-aurora {
  --brand: #8b5cf6;
  --brand-2: #d946ef;
  --brand-rgb: 139, 92, 246;
  --brand2-rgb: 217, 70, 239;

  --bg-g1: #150a24;
  --bg-g2: #251241;
  --bg-g3: #381a5c;
  --glow-a-rgb: 139, 92, 246;
  --glow-b-rgb: 217, 70, 239;
  --hdr-bg: rgba(59, 28, 97, 0.55);
  --side-bg: rgba(39, 18, 64, 0.5);
  --child-bg: rgba(39, 18, 64, 0.9);
  --logo-bg: rgba(59, 28, 97, 0.55);
}

/* ---------- 深海蓝（蓝 × 青） ---------- */
body.theme-ocean {
  --brand: #3b82f6;
  --brand-2: #06b6d4;
  --brand-rgb: 59, 130, 246;
  --brand2-rgb: 6, 182, 212;

  --bg-g1: #071226;
  --bg-g2: #0d1f3c;
  --bg-g3: #143052;
  --glow-a-rgb: 59, 130, 246;
  --glow-b-rgb: 6, 182, 212;
  --hdr-bg: rgba(13, 33, 62, 0.55);
  --side-bg: rgba(9, 24, 46, 0.5);
  --child-bg: rgba(9, 24, 46, 0.9);
  --logo-bg: rgba(13, 33, 62, 0.55);
}

/* ---------- 暖阳橙（琥珀 × 珊瑚红） ---------- */
body.theme-sunset {
  --brand: #f59e0b;
  --brand-2: #ef4444;
  --brand-rgb: 245, 158, 11;
  --brand2-rgb: 239, 68, 68;

  --bg-g1: #241107;
  --bg-g2: #3a1c0a;
  --bg-g3: #54270f;
  --glow-a-rgb: 245, 158, 11;
  --glow-b-rgb: 239, 68, 68;
  --hdr-bg: rgba(74, 40, 12, 0.55);
  --side-bg: rgba(50, 26, 8, 0.5);
  --child-bg: rgba(50, 26, 8, 0.9);
  --logo-bg: rgba(74, 40, 12, 0.55);
}

/* ---------- 森林绿（翡翠 × 薄荷） ---------- */
body.theme-forest {
  --brand: #10b981;
  --brand-2: #2dd4bf;
  --brand-rgb: 16, 185, 129;
  --brand2-rgb: 45, 212, 191;

  --bg-g1: #07140f;
  --bg-g2: #0d2419;
  --bg-g3: #143627;
  --glow-a-rgb: 16, 185, 129;
  --glow-b-rgb: 45, 212, 191;
  --hdr-bg: rgba(13, 40, 28, 0.55);
  --side-bg: rgba(8, 28, 19, 0.5);
  --child-bg: rgba(8, 28, 19, 0.9);
  --logo-bg: rgba(13, 40, 28, 0.55);
}

/* ---------- 樱花粉（粉 × 紫） ---------- */
body.theme-sakura {
  --brand: #ec4899;
  --brand-2: #8b5cf6;
  --brand-rgb: 236, 72, 153;
  --brand2-rgb: 139, 92, 246;

  --bg-g1: #2a0f1e;
  --bg-g2: #3d1530;
  --bg-g3: #521c44;
  --glow-a-rgb: 236, 72, 153;
  --glow-b-rgb: 139, 92, 246;
  --hdr-bg: rgba(74, 27, 56, 0.55);
  --side-bg: rgba(48, 17, 36, 0.5);
  --child-bg: rgba(48, 17, 36, 0.9);
  --logo-bg: rgba(74, 27, 56, 0.55);
}

/* ---------- 曜石暗夜（纯黑 × 霓虹青，后台专用深色） ---------- */
body.theme-dark {
  --brand: #22d3ee;
  --brand-2: #6366f1;
  --brand-rgb: 34, 211, 238;
  --brand2-rgb: 99, 102, 241;

  --bg-g1: #050505;
  --bg-g2: #0c0c0e;
  --bg-g3: #141418;
  --glow-a-rgb: 34, 211, 238;
  --glow-b-rgb: 99, 102, 241;
  --hdr-bg: rgba(14, 14, 16, 0.72);
  --side-bg: rgba(8, 8, 10, 0.72);
  --child-bg: rgba(8, 8, 10, 0.94);
  --logo-bg: rgba(14, 14, 16, 0.72);
}

/* 深色系主题：背景上的默认文字改为浅色，保证可读
   注意：玻璃卡片/表格/输入框内已有显式深色文字（#2a3a52 等），不受本规则影响 */
body.theme-aurora,
body.theme-ocean,
body.theme-sunset,
body.theme-forest,
body.theme-sakura,
body.theme-dark {
  color: rgba(255, 255, 255, 0.88);
}

/* ---------- 字体：字号切换（fs-normal / fs-lg / fs-xl） ---------- */
body { font-size: 14px; }
body.fs-lg { font-size: 15px; }
body.fs-xl { font-size: 16.5px; }
/* 前台正文阅读区跟随字号 */
body.fs-lg .detail-content,
body.fs-lg .post-content,
body.fs-lg .comment-content,
body.fs-lg .card .title,
body.fs-lg .post-list .post-title { font-size: 16.5px; }
body.fs-xl .detail-content,
body.fs-xl .post-content,
body.fs-xl .comment-content,
body.fs-xl .card .title,
body.fs-xl .post-list .post-title { font-size: 18px; }
/* 后台内容区跟随字号（卡片/表格/输入框） */
body.fs-lg .layui-card-body,
body.fs-lg .layui-table td,
body.fs-lg .layui-table th,
body.fs-lg .layui-input { font-size: 14.5px; }
body.fs-xl .layui-card-body,
body.fs-xl .layui-table td,
body.fs-xl .layui-table th,
body.fs-xl .layui-input { font-size: 16px; }

/* ---------- 字体：字族切换（fnt-default / fnt-song / fnt-hei / fnt-kai / fnt-yh / fnt-custom） ---------- */
body.fnt-song, body.fnt-song .detail-content, body.fnt-song .comment-content, body.fnt-song .post-content,
body.fnt-song .layui-card-body, body.fnt-song .layui-table { font-family: "宋体", "SimSun", serif; }
body.fnt-hei, body.fnt-hei .detail-content, body.fnt-hei .comment-content, body.fnt-hei .post-content,
body.fnt-hei .layui-card-body, body.fnt-hei .layui-table { font-family: "黑体", "SimHei", "Microsoft YaHei", sans-serif; }
body.fnt-kai, body.fnt-kai .detail-content, body.fnt-kai .comment-content, body.fnt-kai .post-content,
body.fnt-kai .layui-card-body, body.fnt-kai .layui-table { font-family: "楷体", "KaiTi", "STKaiti", serif; }
body.fnt-yh, body.fnt-yh .detail-content, body.fnt-yh .comment-content, body.fnt-yh .post-content,
body.fnt-yh .layui-card-body, body.fnt-yh .layui-table { font-family: "微软雅黑", "Microsoft YaHei", sans-serif; }
/* 自定义字体：字体名存于 body 内联变量 --font-custom，由 theme.js 注入 */
body.fnt-custom,
body.fnt-custom .detail-content, body.fnt-custom .comment-content, body.fnt-custom .post-content,
body.fnt-custom .layui-card-body, body.fnt-custom .layui-table { font-family: var(--font-custom, inherit); }

/* 自定义字体输入框 */
.appr-font-input {
  width: 190px; height: 30px; border: 1px solid #e3e6ee; border-radius: 8px;
  padding: 0 10px; font-size: 13px; background: #fff; color: #333; outline: none;
  transition: border-color .15s;
}
.appr-font-input:focus { border-color: var(--brand); }
.appr-dark .appr-font-input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #e8ecf4; }
.appr-dark .appr-font-input:focus { border-color: var(--brand); }

/* ---------- 外观设置面板（用户中心 / 后台弹窗通用） ---------- */
.appr-section { margin-bottom: 16px; }
.appr-label { font-size: 13px; color: #666; margin-bottom: 8px; font-weight: 600; }
.appr-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.appr-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 14px;
  border: 1px solid #e3e6ee; border-radius: 16px; background: #fff; color: #333;
  font-size: 13px; cursor: pointer; transition: all .15s;
}
.appr-chip:hover { border-color: var(--brand); color: var(--brand); }
.appr-chip.cur { border-color: var(--brand); background: rgba(var(--brand-rgb), .1); color: var(--brand); font-weight: 600; }
.appr-swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15); cursor: pointer; transition: transform .15s; box-sizing: border-box;
}
.appr-swatch:hover { transform: scale(1.1); }
.appr-swatch.cur { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(var(--brand-rgb), .4); }
.appr-color-input { width: 42px; height: 30px; border: 1px solid #e3e6ee; border-radius: 8px; padding: 0 2px; cursor: pointer; background: #fff; }
.appr-tip { font-size: 12px; color: #999; margin-top: 6px; }
.appr-btn-reset {
  border: 1px dashed #d0d4de; background: transparent; color: #888;
  border-radius: 14px; padding: 5px 14px; font-size: 12px; cursor: pointer;
}
.appr-btn-reset:hover { border-color: #f5576c; color: #f5576c; }
/* 弹窗内深色适配（后台弹窗） */
.appr-dark .appr-label { color: #c3cad6; }
.appr-dark .appr-chip { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #e8ecf4; }
.appr-dark .appr-chip:hover { border-color: var(--brand); color: var(--brand); }
.appr-dark .appr-chip.cur { border-color: var(--brand); background: rgba(var(--brand-rgb), .18); color: var(--brand); }
.appr-dark .appr-tip { color: #8a93a3; }

/* ---------- 主题切换器（后台顶栏 / 前台顶栏通用） ---------- */
.theme-swt { position: relative; }
.theme-swt-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(var(--brand-rgb), .45);
  background: rgba(var(--brand-rgb), .12);
  color: var(--brand);
  border-radius: 16px; padding: 6px 14px;
  font-size: 12px; cursor: pointer; line-height: 1;
  transition: all .2s; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.theme-swt-btn:hover { background: var(--brand); color: #fff; }
.theme-swt-panel {
  display: none; position: absolute; right: 0; top: 40px;
  background: #fff; border: 1px solid #e6e8ee; border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0,0,0,.16); padding: 12px; width: 228px; z-index: 900;
}
.theme-swt-panel.show { display: block; }
.theme-swt-title { font-size: 12px; color: #8a9099; margin-bottom: 10px; }
.theme-swt-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.theme-swt-item { cursor: pointer; text-align: center; }
.theme-swt-swatch {
  width: 34px; height: 34px; margin: 0 auto 3px; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: transform .15s; box-sizing: border-box;
}
.theme-swt-item:hover .theme-swt-swatch { transform: scale(1.12); }
.theme-swt-item.cur .theme-swt-swatch { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(var(--brand-rgb), .35); }
.theme-swt-item .ts-name { font-size: 11px; color: #555; }
/* 前台深色顶栏上的切换器（白色文字） */
.theme-swt-dark .theme-swt-btn { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff; }
.theme-swt-dark .theme-swt-btn:hover { background: var(--brand); border-color: var(--brand); }
