/*
 * ============================================================

 * 版权所有 (c) 2026 Wukong Quick Apps (qquiz.cn). All Rights Reserved.

 * 

 * 本软件（QQuiz智考）为专有软件，受中华人民共和国著作权法及国际版权公约保护。

 * 未经版权所有者明确的书面授权，任何个人或组织不得：

 * 1. 复制、分发、传播、出租、出售本软件的全部或部分源代码。

 * 2. 将本软件部署于任何公网或私有服务器对外提供服务。

 * 3. 修改、反编译、反向工程或创作衍生作品。

 * 4. 移除或修改本软件中的任何版权声明、商标或所有权标识。

 * ============================================================
 */
/* ========== 科技感 UI · 昼夜自适应 · 字体美化版 ========== */
:root {
  --bg: #f4f7fc;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-solid: #ffffff;
  --border: rgba(0, 120, 255, 0.15);
  --text: #1a2634;
  --text-dim: #5b6b7c;
  --primary: #0d8bf0;
  --primary-glow: rgba(13, 139, 240, 0.3);
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 80, 180, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}
body.dark {
  --bg: #0b0f14;
  --surface: rgba(18, 26, 36, 0.8);
  --surface-solid: #121a24;
  --border: rgba(0, 180, 255, 0.2);
  --text: #e8f0fe;
  --text-dim: #8fa3b8;
  --primary: #2fa8ff;
  --primary-glow: rgba(47, 168, 255, 0.4);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0.3px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
  padding: 12px;
  -webkit-tap-highlight-color: transparent;
}

/* 应用容器 */
.app {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px; /* 卡片的间距改为 12px 适中，或者保持 8px 也可以 */
}

/* 顶栏 */
.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
}
.brand img { height: 34px; width: auto; }
.brand-name sup { font-size: 0.6em; color: var(--primary); }

/* 主题按钮 */
.theme-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  cursor: pointer;
  color: var(--text);
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}
.theme-btn:hover { border-color: var(--primary); box-shadow: 0 0 12px var(--primary-glow); }

/* 卡片 */
.card {
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 80, 180, 0.06);
  padding: 16px 20px; /* 上下 16px，左右 20px，这个比例视觉上最舒服 */
}
body.dark .card {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* 按钮 */
.qq_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--surface-solid);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: var(--font);
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  min-height: 44px;
  text-align: center;
  text-decoration: none;
}
.qq_button:hover {
  border-color: var(--primary);
  box-shadow: 0 0 14px var(--primary-glow);
  transform: translateY(-1px);
  text-decoration: none;
}
.qq_button:active { transform: scale(0.97); }
.qq_button.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.qq_button.primary:hover { filter: brightness(1.1); }

/* 模式入口卡片 - 2x2 网格横向布局 */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.mode-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 80, 180, 0.06);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: var(--font);
  transition: all 0.25s;
  min-height: 88px;
  overflow: hidden;
}
body.dark .mode-card { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4); }
.mode-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.25s;
}
.mode-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 28px var(--primary-glow);
  transform: translateY(-3px);
}
.mode-card:hover::before { opacity: 1; }

.mode-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  border-radius: 14px;
  font-size: 1.45rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}
/* 每个模式不同配色 */
.mode-card[data-color="purple"] .mode-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); box-shadow: 0 4px 12px rgba(139,92,246,0.35); }
.mode-card[data-color="teal"]   .mode-icon { background: linear-gradient(135deg, #14b8a6, #0d9488); box-shadow: 0 4px 12px rgba(20,184,166,0.35); }
.mode-card[data-color="orange"] .mode-icon { background: linear-gradient(135deg, #f97316, #ea580c); box-shadow: 0 4px 12px rgba(249,115,22,0.35); }
.mode-card[data-color="purple"]:hover { border-color: #8b5cf6; }
.mode-card[data-color="teal"]:hover   { border-color: #14b8a6; }
.mode-card[data-color="orange"]:hover { border-color: #f97316; }
.mode-card[data-color="purple"]:hover::before { background: #8b5cf6; }
.mode-card[data-color="teal"]:hover::before   { background: #14b8a6; }
.mode-card[data-color="orange"]:hover::before { background: #f97316; }

.mode-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.mode-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mode-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 小屏幕：1 列 */
@media (max-width: 560px) {
  .mode-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .mode-card {
    padding: 14px 14px;
    min-height: 76px;
    gap: 12px;
  }
  .mode-icon {
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
  }
  .mode-name { font-size: 1rem; }
  .mode-desc { font-size: 0.76rem; -webkit-line-clamp: 1; }
}

/* 表单元素 */
input[type="text"], input[type="number"], input[type="password"], input[type="search"] {
  font-size: 1rem;
  font-family: var(--font);
  letter-spacing: 0.5px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-solid);
  color: var(--text);
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 100%;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 10px var(--primary-glow); }
select {
  width: 100%;
  font-size: 1rem;
  font-family: var(--font);
  letter-spacing: 0.5px;
  height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
}
label { font-size: 0.95rem; color: var(--text); }

/* 页面通用 */
.page { display: flex; flex-direction: column; gap: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.tip { font-size: 0.8rem; color: var(--text-dim); }
hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}
small { color: var(--text-dim); font-size: 0.8rem; }

/* 列表与选项 */
ol, ul { padding-left: 1.4em; }
li { margin: 6px 0; }
.answer { font-size: 0.9rem; font-weight: 600; margin-top: 10px; }
.notetitle {
  font-size: 0.9rem;
  background: var(--surface-solid);
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 0;
  cursor: pointer;
  border: 1px solid var(--border);
}
.notetitle:hover { border-color: var(--primary); }

/* 底部 */
.app-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 16px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.brand-line { font-weight: 600; color: var(--text); margin-bottom: 4px; }

/* 折叠面板：改为"浅底 + 边框"，不用大面积蓝底 */
.collapse-header {
  background: var(--surface-solid);
  color: var(--text);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.collapse-header:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--primary);
}
.collapse-header small {
  color: inherit !important;
  font-size: 0.92rem;
}
.collapse-body {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  background: var(--surface-solid);
}

/* 水墨屏下：折叠标题也走黑白 */
body.ink .collapse-header {
  background: #ffffff !important;
  color: #000000 !important;
  border: 1.5px solid #000000 !important;
}
body.ink .collapse-header:hover {
  background: #eeeeee !important;
}

/* ===== 标题字体层级美化 ===== */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 0.5em;
}
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { font-size: 1.05rem; line-height: 1.7; }

/* ============================================================
   ★ 新增 1：文字链接统一美化
   ============================================================ */
a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}
a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: var(--primary);
}
/* 按钮型链接不要下划线 */
a.qq_button, a.btn-sm, a.mode-card, a.brand { text-decoration: none !important; }

/* 显式的 text-link 类：更精致的下划线动画 + 悬停背景 */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  transition: background 0.2s, transform 0.15s;
  position: relative;
}
.text-link:hover {
  background: var(--primary-glow);
  color: var(--primary);
  text-decoration: none;
}
.text-link:active { transform: scale(0.96); }

/* ============================================================
   ★ 新增 2：右下角浮动按钮（返回首页 + 返回顶部）
   ============================================================ */
.float-btns {
  position: fixed;
  right: 16px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 900;
  pointer-events: none;
}
.float-btn {
  pointer-events: auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 80, 180, 0.15);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--text);
  text-decoration: none !important;
  transition: all 0.25s;
  user-select: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.float-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 22px var(--primary-glow);
  transform: translateY(-2px);
  text-decoration: none;
}
.float-btn:active { transform: scale(0.94); }
body.dark .float-btn {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  background: rgba(18, 26, 36, 0.9);
}
#floatTop {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
}
#floatTop.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#floatDown {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
}
#floatDown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (max-width: 480px) {
  .float-btns { right: 12px; bottom: 16px; gap: 8px; }
  .float-btn { width: 42px; height: 42px; font-size: 1.05rem; }
}

/* ============================================================
   ★ 浮动按钮：返回首页的 SVG 图标（跨系统统一，跟随主题变色）
   ============================================================ */

/* 只针对"返回首页"的浮动按钮（有 href="main.php" 属性） */
.float-btn[href="main.php"]::before {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  background-color: var(--text);
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l9-7 9 7'/%3E%3Cpath d='M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M10 21v-6h4v6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l9-7 9 7'/%3E%3Cpath d='M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M10 21v-6h4v6'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 0.2s;
}

/* 悬停时图标变主题蓝 */
.float-btn[href="main.php"]:hover::before {
  background-color: var(--primary);
}

/* 深色模式图标自动变浅色 */
body.dark .float-btn[href="main.php"]::before {
  background-color: var(--text);
}

/* 水墨屏纯黑白 */
body.ink .float-btn[href="main.php"]::before {
  background-color: #000;
}

/* 红与黑主题：图标变红 */
body.crimson .float-btn[href="main.php"]::before {
  background-color: #E5E9F2;
}
body.crimson .float-btn[href="main.php"]:hover::before {
  background-color: #F53F3F;
}

/* ============================================================
   ★ 新增 3：注册页专用美化
   ============================================================ */
.register-wrap {
  max-width: 480px;
  margin: 40px auto;
  animation: fadeInUp 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.register-card {
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 80, 180, 0.1);
  padding: 34px 28px 26px;
}
body.dark .register-card {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.register-card h2 {
  font-size: 1.5rem;
  margin: 0 0 6px;
  text-align: center;
  letter-spacing: -0.5px;
}
.register-card .subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-bottom: 24px;
}
.form-item { margin-bottom: 14px; }
.form-item label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-item input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface-solid);
  border: 1.5px solid var(--border);
  border-radius: 11px;
  outline: none;
  transition: all 0.22s;
}
.form-item input::placeholder { color: var(--text-dim); opacity: 0.55; }
.form-item input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
  transform: translateY(-1px);
}
.register-btn {
  width: 100%;
  height: 50px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #0570cc 100%);
  color: #fff;
  font-size: 1.02rem;
  font-weight: 700;
  font-family: var(--font);
  letter-spacing: 3px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 8px 20px var(--primary-glow);
}
.register-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px var(--primary-glow);
  filter: brightness(1.08);
}
.register-btn:active { transform: translateY(0); }
.register-bottom {
  text-align: center;
  margin-top: 22px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.err-box {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  animation: shake 0.4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* 响应式 */
@media (max-width: 480px) {
  body { padding: 8px; font-size: 14px; }
  .mode-card { padding: 16px; }
  .qq_button { padding: 8px 14px; font-size: 0.9rem; }
  .brand img { height: 28px; }
  .brand-name { font-size: 1rem; }
  .register-card { padding: 26px 20px 20px; border-radius: 16px; }
}

/* ========== 底部备案样式 ========== */
.app-footer .footer-icp { margin-top: 4px; font-size: 0.85em; }
.app-footer .footer-icp a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.app-footer .footer-icp a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.app-footer .footer-extra { margin-top: 4px; font-size: 0.85em; opacity: 0.85; }

/* 答题页题干字号与选项一致 */
#desc {
  font-size: inherit;
  line-height: 1.7;
}
/* ★ 首页按钮（顶部栏）：和夜间模式按钮同款样式 */
.home-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  cursor: pointer;
  color: var(--text);
  font-size: 1.2rem;
  display: grid;
  place-items: center;
  transition: all 0.2s;
  text-decoration: none !important;
  flex-shrink: 0;
}

/* ★ 返回首页按钮（和夜间模式按钮同款样式） */
/* ★ 首页按钮：SVG 图标（跨系统统一，跟随主题变色） */
.home-btn::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background-color: var(--text);
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l9-7 9 7'/%3E%3Cpath d='M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M10 21v-6h4v6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10l9-7 9 7'/%3E%3Cpath d='M5 9v11a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V9'/%3E%3Cpath d='M10 21v-6h4v6'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 0.2s;
}

/* 悬停时图标变主题色 */
.home-btn:hover::before {
  background-color: var(--primary);
}

/* 深色模式下图标自动变浅色 */
body.dark .home-btn::before {
  background-color: var(--text);
}

/* 水墨屏模式下：黑白高对比 */
body.ink .home-btn::before {
  background-color: #000;
}
.home-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
  transform: scale(1.05);
}
.home-btn:active { transform: scale(0.95); }

/* ============================================================
   ★ 水墨屏（E-Ink）主题：高对比、无彩色、无动画
   ============================================================ */
body.ink {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --border: #000000;
  --text: #000000;
  --text-dim: #444444;
  --primary: #000000;
  --primary-glow: rgba(0, 0, 0, 0.1);
  --radius: 6px;
  --shadow: none;
}

/* 关闭所有过渡、阴影、发光、模糊 */
body.ink * {
  transition: none !important;
  animation: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  text-shadow: none !important;
}
body.ink .card,
body.ink .mode-card,
body.ink .qq_button {
  box-shadow: none !important;
}

/* 主按钮：黑底白字 */
body.ink .qq_button.primary,
body.ink .mode-icon,
body.ink .step-num,
body.ink .toc-num {
  background: #000000 !important;
  color: #ffffff !important;
  border-color: #000000 !important;
  filter: none !important;
  box-shadow: none !important;
  transform: none !important;
}

/* 模式卡片：悬停时黑边框，不做位移 */
body.ink .mode-card::before { display: none !important; }
body.ink .mode-card:hover {
  border-color: #000000 !important;
  background: #eeeeee !important;
  transform: none !important;
  box-shadow: none !important;
}

/* 主题按钮图标：水墨屏 */

body.ink .tip-tag {
  background: #ffffff !important;
  border: 1px solid #000000 !important;
  color: #000000 !important;
}

/* ★ 关键：内联的彩色文字全部变成黑/灰高对比 */
body.ink [style*="color:green"],
body.ink [style*="color: green"],
body.ink [style*="color:#16a34a"],
body.ink [style*="color: #16a34a"],
body.ink [style*="color:#15803d"],
body.ink [style*="color: #15803d"] {
  color: #000000 !important;
  font-weight: 700 !important;
}
body.ink [style*="color:#e74c3c"],
body.ink [style*="color: #e74c3c"],
body.ink [style*="color:red"],
body.ink [style*="color: red"],
body.ink [style*="color:#c0392b"],
body.ink [style*="color: #c0392b"] {
  color: #000000 !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
}
body.ink [style*="color:#e67e22"],
body.ink [style*="color: #e67e22"],
body.ink [style*="color:#b45309"],
body.ink [style*="color: #b45309"] {
  color: #000000 !important;
  font-style: italic !important;
}

/* 排行榜里的名次徽章（🥇🥈🥉）不变，分数颜色由上面内联规则接管 */

/* 表单、输入框：黑边白底 */
body.ink input,
body.ink select,
body.ink textarea {
  border: 1.5px solid #000000 !important;
  background: #ffffff !important;
  color: #000000 !important;
}
body.ink input:focus,
body.ink select:focus,
body.ink textarea:focus {
  border-color: #000000 !important;
  box-shadow: 0 0 0 2px #000000 !important;
}

/* 文字链接下划线 */
body.ink .text-link,
body.ink a { color: #000000 !important; }
body.ink .text-link:hover { background: #eeeeee !important; }

/* ============================================================
   ★ 红与黑主题：暗黑背景 + 红色点缀，赛博朋克风
   ============================================================ */
body.crimson {
  --bg: #0A0F16;
  --surface: rgba(26, 35, 50, 0.85);
  --surface-solid: #1A2332;
  --border: rgba(245, 63, 63, 0.2);
  --text: #E5E9F2;
  --text-dim: #8899AA;
  --primary: #F53F3F;
  --primary-glow: rgba(245, 63, 63, 0.35);
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* 背景加一点径向红光 */
body.crimson {
  background-image: radial-gradient(ellipse at 50% 0%, rgba(245, 63, 63, 0.06) 0%, transparent 60%);
  background-attachment: fixed;
}

/* 顶栏：深色玻璃 + 红边 */
body.crimson .app-bar {
  background: rgba(26, 35, 50, 0.9);
  border-color: rgba(245, 63, 63, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(245, 63, 63, 0.08) inset;
}

/* 卡片：暗黑底 + 红边光晕 */
body.crimson .card {
  background: rgba(26, 35, 50, 0.85);
  border: 1px solid rgba(245, 63, 63, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(245, 63, 63, 0.05) inset;
}

/* 主按钮：红色渐变 */
body.crimson .qq_button.primary {
  background: linear-gradient(135deg, #F53F3F 0%, #B91C1C 100%);
  border-color: #F53F3F;
  box-shadow: 0 4px 16px rgba(245, 63, 63, 0.4);
}
body.crimson .qq_button.primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 6px 22px rgba(245, 63, 63, 0.55);
}

/* 普通按钮：暗底红边 */
body.crimson .qq_button {
  background: #1A2332;
  border-color: rgba(245, 63, 63, 0.25);
  color: #E5E9F2;
}
body.crimson .qq_button:hover {
  border-color: #F53F3F;
  box-shadow: 0 0 14px rgba(245, 63, 63, 0.35);
}

/* 模式图标：红色渐变 */
body.crimson .mode-icon {
  background: linear-gradient(135deg, #F53F3F 0%, #B91C1C 100%);
  box-shadow: 0 4px 12px rgba(245, 63, 63, 0.45);
}

/* 模式卡片：悬停红光 */
body.crimson .mode-card {
  background: rgba(26, 35, 50, 0.85);
  border-color: rgba(245, 63, 63, 0.15);
}
body.crimson .mode-card::before {
  background: #F53F3F;
}
body.crimson .mode-card:hover {
  border-color: #F53F3F;
  box-shadow: 0 8px 28px rgba(245, 63, 63, 0.3);
}

/* 主题按钮图标 */
body.crimson .theme-btn {
  border-color: rgba(245, 63, 63, 0.35);
  color: #F53F3F;
}

/* 折叠标题 */
body.crimson .collapse-header {
  background: rgba(26, 35, 50, 0.85);
  color: #E5E9F2;
  border-color: rgba(245, 63, 63, 0.2);
}
body.crimson .collapse-header:hover {
  border-color: #F53F3F;
  background: rgba(245, 63, 63, 0.1);
  color: #FF6B6B;
}
body.crimson .collapse-body {
  background: rgba(26, 35, 50, 0.85);
  border-color: rgba(245, 63, 63, 0.2);
}

/* 品牌名上标 */
body.crimson .brand-name sup { color: #F53F3F; }

/* 文字链接 */
body.crimson a { color: #FF6B6B; }
body.crimson .text-link { color: #FF6B6B; }
body.crimson .text-link:hover {
  background: rgba(245, 63, 63, 0.15);
  color: #FF6B6B;
}

/* 浮动按钮 */
body.crimson .float-btn {
  background: rgba(26, 35, 50, 0.9);
  border-color: rgba(245, 63, 63, 0.3);
  color: #E5E9F2;
}
body.crimson .float-btn:hover {
  border-color: #F53F3F;
  box-shadow: 0 6px 22px rgba(245, 63, 63, 0.4);
}

/* 输入框 */
body.crimson input,
body.crimson select,
body.crimson textarea {
  background: #0F1A2A;
  border-color: rgba(245, 63, 63, 0.25);
  color: #E5E9F2;
}
body.crimson input:focus,
body.crimson select:focus,
body.crimson textarea:focus {
  border-color: #F53F3F;
  box-shadow: 0 0 0 3px rgba(245, 63, 63, 0.25);
}
body.crimson input::placeholder,
body.crimson textarea::placeholder {
  color: #667788;
}

/* 分割线 */
body.crimson hr { background: rgba(245, 63, 63, 0.15); }

/* 底部 */
body.crimson .app-footer {
  border-top-color: rgba(245, 63, 63, 0.15);
}

/* 收藏、跳转等复选框 */
body.crimson input[type="checkbox"] { accent-color: #F53F3F; }

/* 排行表格 */
body.crimson .rank-row:hover { background: rgba(245, 63, 63, 0.05); }

/* ============================================================
   ★ 页脚导航链接（About · help）—— 紧凑黑字版
   ============================================================ */
.app-footer .footer-links {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-wrap: wrap;
  line-height: 1.4;
}
.app-footer .footer-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 0;
  background: none;
  transition: color 0.2s;
  cursor: pointer;
}
.app-footer .footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.app-footer .footer-sep {
  color: var(--text);
  opacity: 0.5;
  font-weight: 400;
}

/* 水墨屏：页脚链接也走黑白 */
body.ink .app-footer .footer-links a {
  color: #000 !important;
  border: 1px solid #000 !important;
  background: #fff !important;
}
body.ink .app-footer .footer-links a:hover {
  background: #eee !important;
}
body.ink .app-footer .footer-sep {
  color: #000 !important;
  opacity: 1 !important;
}

/* 红与黑：页脚链接变红 */
body.crimson .app-footer .footer-links a {
  color: #FF6B6B;
}
body.crimson .app-footer .footer-links a:hover {
  color: #F53F3F;
  background: rgba(245, 63, 63, 0.1);
}
/* ============================================================
   ★ 主题切换按钮：SVG 图标（跨设备清晰，跟随主题颜色）
   ★ 替代原来的 emoji，让水墨屏、低对比屏幕上也能看清
   ============================================================ */

/* 默认（白天主题）：月亮轮廓，跟随 --text 颜色 */
.theme-btn::before {
  content: "" !important;
  display: block;
  width: 20px;
  height: 20px;
  background-color: var(--text);
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  font-size: 0 !important;
  line-height: 1 !important;
}

/* 夜间主题：太阳轮廓 */
body.dark .theme-btn::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E");
}

/* 水墨屏主题：半黑半白的圆 ◐ */
body.ink .theme-btn::before {
  background-color: #000 !important;
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 3 A 9 9 0 0 1 12 21 Z' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 3 A 9 9 0 0 1 12 21 Z' fill='black'/%3E%3C/svg%3E");
}

/* 红与黑主题：火焰轮廓 */
body.crimson .theme-btn::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3C/svg%3E");
}

/* ============================================================
   ★ 水墨屏：模式卡片 6 个图标 SVG 化（替代 emoji）
   ============================================================ */

body.ink .mode-icon {
  font-size: 0 !important;
  color: transparent !important;
  position: relative;
}
body.ink .mode-icon::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background-color: #fff;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* 学习模式（书） */
body.ink .mode-card:not([data-color]) .mode-icon::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 0 1 6.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z'/%3E%3C/svg%3E");
}

/* 测试模式（笔） */
body.ink .mode-card[data-color="purple"] .mode-icon::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z'/%3E%3C/svg%3E");
}

/* 速查模式（放大镜） */
body.ink .mode-card[data-color="teal"] .mode-icon::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
}

/* 专项练习（靶子） */
body.ink .mode-card[data-color="orange"] .mode-icon::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Ccircle cx='12' cy='12' r='6'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3C/svg%3E");
}

/* 混合测试（骰子） */
body.ink .mode-card[data-color="green"] .mode-icon::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M8 8h.01M16 8h.01M12 12h.01M8 16h.01M16 16h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Cpath d='M8 8h.01M16 8h.01M12 12h.01M8 16h.01M16 16h.01'/%3E%3C/svg%3E");
}

/* 学习报告（柱状图） */
body.ink .mode-card[data-color="cyan"] .mode-icon::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 17v-6M12 17V7M17 17v-4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 17v-6M12 17V7M17 17v-4'/%3E%3C/svg%3E");
}

/* ============================================================
   ★ 主题按钮最终样式（4 主题分别配置）
   ★ 追加到文件末尾，覆盖之前所有规则
   ============================================================ */

/* ① 白天主题：浅灰描边 + 深色图标 */
html body:not(.dark):not(.ink):not(.crimson) .theme-btn {
  background: transparent !important;
  border: 2px solid var(--border) !important;
  box-shadow: none !important;
  transition: all 0.2s !important;
}
html body:not(.dark):not(.ink):not(.crimson) .theme-btn::before {
  background-color: var(--text) !important;
}
html body:not(.dark):not(.ink):not(.crimson) .theme-btn:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 0 12px var(--primary-glow) !important;
}

/* ② 夜间主题：白色描边 + 白色图标（透明底） */
html body.dark .theme-btn {
  background: transparent !important;
  border: 2px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow: none !important;
  transition: all 0.2s !important;
}
html body.dark .theme-btn::before {
  background-color: #ffffff !important;
}
html body.dark .theme-btn:hover {
  border-color: #ffffff !important;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.5) !important;
}

/* ③ 水墨屏：黑色描边 + 黑色图标（白底） */
html body.ink .theme-btn {
  background: #ffffff !important;
  border: 2px solid #000000 !important;
  box-shadow: none !important;
  transition: none !important;
}
html body.ink .theme-btn::before {
  background-color: #000000 !important;
}
html body.ink .theme-btn:hover {
  background: #f5f5f5 !important;
  border-color: #000000 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* ④ 红与黑：白描边 + 白图标（透明底），hover 变红 */
html body.crimson .theme-btn {
  background: transparent !important;
  border: 2px solid rgba(229, 233, 242, 0.85) !important;
  box-shadow: none !important;
  transition: all 0.2s !important;
}
html body.crimson .theme-btn::before {
  background-color: #E5E9F2 !important;
}
html body.crimson .theme-btn:hover {
  border-color: #F53F3F !important;
  box-shadow: 0 0 14px rgba(245, 63, 63, 0.5) !important;
}
html body.crimson .theme-btn:hover::before {
  background-color: #F53F3F !important;
}
/* ============================================================
   ★ 底部版权信息：电脑端自动加圆点，手机端自动换行
   ============================================================ */
.footer-brand {
  position: relative;
  word-break: break-word; /* 防止字数太多撑爆屏幕 */
}

/* 电脑端：通过 CSS 在文字中间强行插入一个圆点（利用伪元素） */
@media (min-width: 601px) {
  .footer-brand {
    /* 如果后台填了名字和域名，我们让文字居中对齐 */
    display: inline-block;
  }
  /* 这一步是在浏览器渲染时自动把空格替换成圆点，由于 CSS 不能直接替换文字，我们用另一种巧妙的方法： */
}

/* 手机端：如果太长会自动折行。第二行开头是纯文字，非常清爽 */
@media (max-width: 600px) {
  .brand-line {
    padding: 0 15px; /* 手机端两边留点白，更好看 */
    line-height: 1.6;
  }
}
/* ============================================================
   ★ 统一底部版本号样式（小字体、淡化颜色）
   ============================================================ */
.version-line {
  font-size: 0.75rem !important;       /* 字体调小 */
  color: var(--text-dim) !important;   /* 颜色变淡 */
  opacity: 0.6;                        /* 增加一点透明度 */
  margin-top: 6px;                     /* 和上面版权声明拉开一点距离 */
  letter-spacing: 0.5px;
}
/* ★ 美化全局滚动条（防止太粗难看） */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(13, 139, 240, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(13, 139, 240, 0.5);
}
body.dark ::-webkit-scrollbar-thumb {
  background: rgba(47, 168, 255, 0.25);
}
body.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(47, 168, 255, 0.5);
}

/* ============================================================
   ★ 个人中心专属：强制统一所有卡片的高度与间距（解决上下留白过大问题）
   ============================================================ */
/* 1. 消除容器原本的缝隙，改由卡片自带的 margin-bottom 控制 */
.app {
    gap: 0 !important; 
}

/* 2. 统一所有卡片的上下左右留白为 16px 20px */
.app > .card,
.form-grid > .card,
.compact-card {
    padding: 16px 20px !important; 
    margin-bottom: 14px !important;
}

/* 3. 统一卡片内标题的边距，避免标题自带的 margin 撑大高度 */
.app > .card > h3,
.compact-card > h3,
.form-grid > .card > h3 {
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    font-size: 1.05rem !important;
    line-height: 1.4 !important;
}

/* 4. 强制让“操作日志”卡片内部紧凑，不要有莫名的大区块 */
.app > .card > p.desc {
    margin-top: 0 !important;
    margin-bottom: 14px !important;
    line-height: 1.6 !important;
}

/* 5. 手机端进一步微调 */
@media (max-width: 640px) {
    .app > .card,
    .form-grid > .card,
    .compact-card {
        padding: 14px 16px !important;
        margin-bottom: 12px !important;
    }
}

/* ============================================================
   ★ 仙门书院主题（白天 · 金色仙气 · 青紫云霞）
   ============================================================ */
body.xianmen {
  --bg: #eef4f8;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --border: rgba(201, 162, 39, 0.35);
  --text: #1a2b3c;
  --text-dim: #5a6b7c;
  --primary: #C9A227;
  --primary-glow: rgba(201, 162, 39, 0.35);
  --radius: 14px;
  --shadow: 0 8px 30px rgba(30, 60, 100, 0.12);
}

body.xianmen {
  background:
    radial-gradient(ellipse at 15% 10%, rgba(120, 90, 200, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 5%, rgba(201, 162, 39, 0.16) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(90, 140, 200, 0.15) 0%, transparent 60%),
    linear-gradient(160deg, #f0f6fb 0%, #e8eef8 45%, #f2ecf8 100%);
  background-attachment: fixed;
}

body.xianmen .app-bar {
  border-color: rgba(201, 162, 39, 0.35);
  box-shadow: 0 6px 24px rgba(30, 60, 100, 0.1), 0 0 0 1px rgba(201, 162, 39, 0.08) inset;
}
body.xianmen .card {
  border: 1px solid rgba(201, 162, 39, 0.28);
  box-shadow: 0 6px 24px rgba(30, 60, 100, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}
body.xianmen .qq_button.primary,
body.xianmen .btn-login {
  background: linear-gradient(135deg, #E0B93A 0%, #B8860B 100%);
  border-color: #C9A227;
  color: #fff;
  box-shadow: 0 6px 18px rgba(201, 162, 39, 0.4);
}
body.xianmen .mode-icon {
  background: linear-gradient(135deg, #E0B93A 0%, #B8860B 100%);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.4);
}
body.xianmen .mode-card:hover {
  border-color: #C9A227;
  box-shadow: 0 8px 28px rgba(201, 162, 39, 0.3);
}
body.xianmen .mode-card::before { background: #C9A227; }
body.xianmen a,
body.xianmen .text-link { color: #B8860B; }
body.xianmen .text-link:hover { background: rgba(201, 162, 39, 0.15); }
body.xianmen .brand-name sup { color: #C9A227; }

/* 主题按钮：仙门书院 */
html body.xianmen .theme-btn {
  background: transparent !important;
  border: 2px solid rgba(201, 162, 39, 0.6) !important;
  box-shadow: none !important;
  transition: all 0.2s !important;
}
html body.xianmen .theme-btn::before { background-color: #8a6d1a !important; }
html body.xianmen .theme-btn:hover {
  border-color: #C9A227 !important;
  box-shadow: 0 0 14px rgba(201, 162, 39, 0.5) !important;
}

body.xianmen .float-btn { border-color: rgba(201, 162, 39, 0.4); }
body.xianmen .float-btn:hover {
  border-color: #C9A227;
  box-shadow: 0 6px 22px rgba(201, 162, 39, 0.4);
}
body.xianmen input:focus,
body.xianmen select:focus,
body.xianmen textarea:focus {
  border-color: #C9A227;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}
body.xianmen ::-webkit-scrollbar-thumb { background: rgba(201, 162, 39, 0.35); }
body.xianmen ::-webkit-scrollbar-thumb:hover { background: rgba(201, 162, 39, 0.6); }
body.xianmen .app-footer .footer-links a { color: #B8860B; }
body.xianmen .app-footer .footer-links a:hover { color: #C9A227; }

body.xianmen .brand-name,
body.xianmen .mode-name,
body.xianmen h1,
body.xianmen h2,
body.xianmen h3 {
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", serif;
}
/* ★ 云端白昼（light）主题按钮最终样式 */
html body:not(.dark):not(.ink):not(.crimson):not(.xianmen) .theme-btn {
  background: transparent !important;
  border: 2px solid var(--border) !important;
  box-shadow: none !important;
  transition: all 0.2s !important;
}
html body:not(.dark):not(.ink):not(.crimson):not(.xianmen) .theme-btn::before {
  background-color: var(--text) !important;
}
html body:not(.dark):not(.ink):not(.crimson):not(.xianmen) .theme-btn:hover {
  border-color: var(--primary) !important;
  box-shadow: 0 0 12px var(--primary-glow) !important;
}
/* ============================================================
   ★ 最终完美版：5大主题专属图标（实心太极 + 旋转特效）
   ============================================================ */

/* 基础占位 */
.theme-btn::before {
  content: "" !important;
  display: block;
  width: 24px;
  height: 24px;
  background-color: var(--text);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  font-size: 0 !important;
  line-height: 1 !important;
}

/* ① 仙门书院：☯ 实心阴阳鱼（深蓝色，自动旋转） */
html body .theme-btn[data-mode="xianmen"]::before {
  background-color: #0d47a1 !important; /* 呼应你的 Logo 深蓝色 */
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2a8 8 0 0 1 8 8 8 8 0 0 1-8 8 4 4 0 0 1 0-8 4 4 0 0 0 0-8zm0 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm0 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2a8 8 0 0 1 8 8 8 8 0 0 1-8 8 4 4 0 0 1 0-8 4 4 0 0 0 0-8zm0 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm0 12a2 2 0 1 1 0-4 2 2 0 0 1 0 4z'/%3E%3C/svg%3E");
  animation: spinTaiChi 8s linear infinite;
}
html body .theme-btn[data-mode="xianmen"]:hover::before {
  animation-play-state: paused; /* 鼠标悬停时暂停旋转 */
}
@keyframes spinTaiChi {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ② 云端白昼：☀️ 太阳 */
html body .theme-btn[data-mode="light"]::before {
  background-color: #0d8bf0 !important;
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E");
}

/* ③ 夜间模式：🌙 月亮 */
html body .theme-btn[data-mode="dark"]::before {
  background-color: #e8f0fe !important;
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z'/%3E%3C/svg%3E");
}

/* ④ 水墨屏：◐ 半黑半白的圆 */
html body .theme-btn[data-mode="ink"]::before {
  background-color: #000 !important;
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 3 A 9 9 0 0 1 12 21 Z' fill='black'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 3 A 9 9 0 0 1 12 21 Z' fill='black'/%3E%3C/svg%3E");
}

/* ⑤ 红与黑：🔥 火焰 */
html body .theme-btn[data-mode="crimson"]::before {
  background-color: #F53F3F !important;
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z'/%3E%3C/svg%3E");
}

/* 针对不同主题的按钮边框颜色微调 */
html body .theme-btn[data-mode="xianmen"] { border-color: rgba(201, 162, 39, 0.6) !important; }
html body .theme-btn[data-mode="light"]   { border-color: rgba(13, 139, 240, 0.4) !important; }
html body .theme-btn[data-mode="dark"]    { border-color: rgba(255, 255, 255, 0.5) !important; }
html body .theme-btn[data-mode="ink"]     { border-color: #000000 !important; }
html body .theme-btn[data-mode="crimson"] { border-color: rgba(245, 63, 63, 0.6) !important; }

/* ★ 进阶特效：仙门书院的太极图标缓慢旋转 */
@keyframes spinTaiChi {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
html body .theme-btn[data-mode="xianmen"]::before {
  animation: spinTaiChi 8s linear infinite;
}
/* 鼠标悬停时暂停旋转，方便点击 */
html body .theme-btn[data-mode="xianmen"]:hover::before {
  animation-play-state: paused;
}