/* ============================================================
 * 全站统一页脚（footer.js 渲染，面板 / 登录页 / 安装页共用）
 * 颜色全部走页面主题变量，安装页的浅色模式也能直接复用。
 * ============================================================ */

/* ---------------- 主题皮肤 ----------------
 * 皮肤由 footer.js 写在 <html data-theme="dark|light">。
 * 这里集中定义两套调色板（页面 CSS 的 :root 只作未启用皮肤时的兜底），
 * 新增颜色请两边同步：styles.css 的 :root（深色默认）与本文件的 light 块。
 */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12;
  --panel: #141821;
  --panel-2: #191e2a;
  --border: #232a38;
  --text: #e6e9f0;
  --muted: #8b93a7;
  --accent: #6366f1;
  --accent-2: #818cf8;
  --accent-hover: #5457e5;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --success: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
  --topbar-bg: rgba(13, 16, 23, 0.92);
  --hover-border: #364056;
  --hover-bg: #1f2533;
  --danger-text: #fca5a5;
  --danger-soft: rgba(239, 68, 68, 0.08);
  --danger-soft-2: rgba(239, 68, 68, 0.16);
  --success-text: #86efac;
  --warn-text: #fcd34d;
  --neutral-text: #cbd5e1;
  --cyan-text: #a5f3fc;
  --accent-text: #c7d2fe;
  --link: #a5b4fc;
  --link-soft: rgba(165, 180, 252, 0.5);
  --input-bg: #0f131b;
  --log-bg: #05070b;
  --log-border: #1a2130;
  --log-text: #c9d4e6;
  --tag-bg: #1e2534;
  --tag-text: #a9b3c7;
  --chip-bg: #262e3f;
  --chip-text: #b9c2d6;
  --dot-idle: #3f4759;
  --toast-bg: #1a2030;
  --toast-border: #33405a;
  --overlay: rgba(4, 6, 12, 0.66);
  --shadow: rgba(0, 0, 0, 0.8);
  --shadow-strong: rgba(0, 0, 0, 0.9);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f2f4f9;
  --border: #dfe3ee;
  --text: #141a27;
  --muted: #667085;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --success: #0f9d58;
  --danger: #dc2626;
  --warn: #b45309;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --hover-border: #c9d0e2;
  --hover-bg: #eaedf6;
  --danger-text: #b91c1c;
  --danger-soft: rgba(220, 38, 38, 0.07);
  --danger-soft-2: rgba(220, 38, 38, 0.14);
  --success-text: #0f7a45;
  --warn-text: #a15c07;
  --neutral-text: #475467;
  --cyan-text: #0e7490;
  --accent-text: #4338ca;
  --link: #4338ca;
  --link-soft: rgba(67, 56, 202, 0.35);
  --input-bg: #ffffff;
  /* 日志区保持深色终端观感，浅色皮肤下也可读 */
  --log-bg: #0f131b;
  --log-border: #1a2130;
  --log-text: #c9d4e6;
  --tag-bg: #eef1f8;
  --tag-text: #475467;
  --chip-bg: #eef1f8;
  --chip-text: #475467;
  --dot-idle: #c3cadb;
  --toast-bg: #ffffff;
  --toast-border: #d5dbe9;
  --overlay: rgba(15, 23, 42, 0.35);
  --shadow: rgba(15, 23, 42, 0.16);
  --shadow-strong: rgba(15, 23, 42, 0.22);
}

.app-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.af-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.af-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(140deg, var(--accent), #22d3ee);
  color: #fff;
}
.af-text { display: flex; flex-direction: column; min-width: 0; }
.af-name { font-size: 12px; font-weight: 700; color: var(--text); }
.af-slogan { color: var(--muted); }

.af-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 18px;
  min-width: 0;
}
.af-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.af-legal { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.af-dot { opacity: 0.55; }
.af-note { white-space: normal; }

/* 皮肤切换：页脚右侧的胶囊按钮，显示当前皮肤并在深色 / 浅色间切换 */
.af-theme {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  line-height: 1.6;
  cursor: pointer;
}
.af-theme:hover { border-color: var(--accent); color: var(--text); }
.af-theme-icon { color: var(--accent-2); font-size: 12px; }

.app-foot a { color: var(--accent); text-decoration: none; }
.app-foot a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .app-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  }
  .af-side { justify-content: flex-start; }
}
