/* ================================================================
   微光宝盒 手机版 — 绿色主题（延续桌面版 #4CAF50）
   移动优先，桌面浏览器测试时居中显示
   ================================================================ */

:root {
  --primary: #4CAF50;
  --primary-dark: #388E3C;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #333333;
  --text-light: #8a8f98;
  --border: #e0e0e0;
  --radius: 14px;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  --tabbar-h: 58px;
  --topbar-h: 52px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #e8eaed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

/* === 暗色模式 === */
:root[data-theme="dark"] {
  --bg: #14181d;
  --card: #1e242c;
  --text: #e8ebef;
  --text-light: #98a1ab;
  --border: #2e3640;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
:root[data-theme="dark"] body { background: #0b0e11; }
:root[data-theme="dark"] #app { box-shadow: 0 0 24px rgba(0, 0, 0, 0.5); }
:root[data-theme="dark"] .game-cover,
:root[data-theme="dark"] .iz-img,
:root[data-theme="dark"] .shot,
:root[data-theme="dark"] .auth-avatar,
:root[data-theme="dark"] .av-preset { background: #2a313a; }
:root[data-theme="dark"] .auth-stats span { background: #2a313a; }
:root[data-theme="dark"] .fav-btn { background: var(--card); color: var(--text-light); }
:root[data-theme="dark"] .announce-frame iframe { background: #1e242c; }

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 520px;          /* 桌面浏览器测试时居中，手机上全宽 */
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* === 顶部通栏 === */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  padding: 0 16px;
  padding-top: env(safe-area-inset-top);
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand { font-size: 17px; font-weight: bold; color: var(--text); }
.brand::first-letter { color: var(--primary); }
.ver {
  font-size: 11px;
  font-weight: normal;
  color: var(--primary);
  background: rgba(76, 175, 80, 0.12);
  border-radius: 8px;
  padding: 1px 7px;
  margin-left: 6px;
  vertical-align: 2px;
}

.clock { font-size: 13px; color: var(--text-light); font-variant-numeric: tabular-nums; }

/* === 页面视图 === */
#view {
  flex: 1;
  min-height: 0;              /* flex 滚动安全：防止内容把容器撑破导致无法滚动 */
  overflow-y: auto;
  padding: 12px 12px calc(var(--tabbar-h) + 16px);
}

/* === 页面标题块 === */
.page-title { font-size: 16px; font-weight: bold; margin: 6px 2px 10px; }

.page-note {
  font-size: 12px; color: var(--text-light);
  background: rgba(76, 175, 80, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

/* === 首页组件卡片网格 === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.widget-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 14px;
  cursor: pointer;
  transition: transform 0.08s ease;
  user-select: none;
}
.widget-card:active { transform: scale(0.97); }

.widget-icon { font-size: 26px; display: block; margin-bottom: 6px; }
.widget-name { font-size: 14px; font-weight: 600; }
.widget-desc { font-size: 11px; color: var(--text-light); margin-top: 2px; }

/* === 通用列表项 === */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: none;
}
.list-item:active { transform: scale(0.98); }

.list-icon { font-size: 22px; }
.list-name { font-size: 15px; font-weight: 600; flex: 1; }
.list-desc { font-size: 12px; color: var(--text-light); }

.badge {
  font-size: 11px;
  color: var(--primary);
  background: rgba(76, 175, 80, 0.12);
  border-radius: 10px;
  padding: 2px 8px;
}

/* === 占位详情页 === */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--primary-dark);
  cursor: pointer;
  margin-bottom: 12px;
  user-select: none;
  position: sticky;          /* 详情页滚动时固定在顶部 */
  top: -12px;
  background: var(--bg);
  padding: 6px 8px;
  margin-left: -8px;
  z-index: 5;
  border-radius: 6px;
  width: fit-content;
}

.placeholder-box {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 24px;
  text-align: center;
}
.placeholder-box .big-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.placeholder-box .title { font-size: 17px; font-weight: bold; }
.placeholder-box .desc { font-size: 13px; color: var(--text-light); margin-top: 8px; }

/* === 底部 Tab 栏 === */
#tabbar {
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--text-light);
  cursor: pointer;
  user-select: none;
}
.tab-icon { font-size: 21px; line-height: 1; }
.tab-label { font-size: 11px; }
.tab.active { color: var(--primary); font-weight: 600; }

/* === 工具页通用（第②步组件） === */
.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 2px 12px;
}
.tool-title { font-size: 16px; font-weight: bold; }
.tool-login-note {
  font-size: 11px;
  color: var(--text-light);
  font-weight: normal;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 7px 16px;
  font-size: 14px;
  cursor: pointer;
}
.btn-primary:active { background: var(--primary-dark); }

.btn-danger {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: var(--card);
  color: #e53935;
  border: 1px solid #ffcdd2;
  border-radius: var(--radius);
  padding: 11px;
  font-size: 14px;
  cursor: pointer;
}
.btn-danger:active { background: #fff5f5; }

.note-editor {
  width: 100%;
  min-height: 55vh;
  background: var(--card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  resize: none;
  outline: none;
}

.list-body { flex: 1; min-width: 0; }
.list-body .list-name {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  color: var(--text-light);
  padding: 48px 16px;
  font-size: 13px;
  line-height: 2;
}

/* === 待办清单 === */
.todo-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.todo-input {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
}
.todo-input:focus { border-color: var(--primary); }

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.todo-check {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border: 2px solid #c8cdd4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  user-select: none;
}
.todo-check.checked { background: var(--primary); border-color: var(--primary); }
.todo-text { flex: 1; font-size: 15px; word-break: break-all; }
.todo-text.done { color: var(--text-light); text-decoration: line-through; }
.todo-del {
  color: #c8cdd4;
  font-size: 15px;
  padding: 4px 8px;
  cursor: pointer;
}
.todo-del:active { color: #e53935; }

.todo-section {
  margin-top: 16px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}
.todo-section-title { font-size: 12px; color: var(--text-light); margin: 0 2px 10px; }
.todo-clear {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 13px;
  padding: 8px;
  cursor: pointer;
}
.todo-clear:active { color: #e53935; }

/* === 倒计时 === */
.hidden { display: none !important; }

.cd-form {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.cd-form .todo-input { margin-bottom: 8px; width: 100%; }
.cd-form-btns { display: flex; gap: 8px; justify-content: flex-end; }
.btn-plain {
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 14px;
  padding: 7px 14px;
  cursor: pointer;
}

.cd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 10px;
}
.cd-title { font-size: 15px; font-weight: 600; }
.cd-remaining {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary);
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}
.cd-target-date { font-size: 12px; color: var(--text-light); }
.cd-item.passed .cd-remaining { color: var(--text-light); }
.cd-item.passed .cd-title { color: var(--text-light); }

/* === 任务倒计时 === */
.tcd-remaining {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary);
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}
.cd-item.passed .tcd-remaining { color: #e53935; }

.tcd-btns { display: flex; gap: 8px; margin-top: 10px; }
.tcd-btn {
  border: none;
  border-radius: 14px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
  background: #f0f2f5;
  color: var(--text);
}
.tcd-btn.ok { background: rgba(76, 175, 80, 0.12); color: var(--primary-dark); }
.tcd-btn.snooze { background: rgba(255, 152, 0, 0.12); color: #e65100; }
.tcd-btn.del { background: rgba(229, 57, 53, 0.08); color: #e53935; }
.tcd-btn:active { opacity: 0.7; }

.cd-item.done .cd-title { color: var(--text-light); text-decoration: line-through; }

/* === 二维码 === */
.qr-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* 固定正方形框；库生成的 img 是唯一显示元素，等比填满绝不变形 */
.qr-frame {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#qrcode { width: 100%; height: 100%; }
#qrcode img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
.qr-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}
.qr-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 10px;
}
.qr-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-overlay-box { text-align: center; }
.qr-overlay-box img {
  max-width: min(78vw, 440px);
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
}
.qr-overlay-save { margin-top: 16px; }
.img-ov-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}
.img-ov-link { color: #fff; opacity: 0.85; }
.qr-overlay-hint {
  color: #fff;
  font-size: 13px;
  margin-top: 14px;
  opacity: 0.85;
  line-height: 1.8;
}

/* === 书签 === */
.bm-item { cursor: pointer; }
.bm-avatar-box {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bm-favicon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
}
.bm-avatar {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  user-select: none;
}
.bm-item .list-desc { word-break: break-all; }
.bm-edit {
  color: #c8cdd4;
  font-size: 15px;
  padding: 4px 8px;
  cursor: pointer;
}
.bm-edit:active { color: var(--primary); }

/* === 首页游戏门户 === */
.chips-row {
  display: flex;
  flex-wrap: wrap;   /* 换行显示全部栏目（横滚会藏掉后面的，用户看到不全） */
  gap: 8px;
  margin: 2px 0 12px;
}
.chip {
  white-space: nowrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
  user-select: none;
}
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.game-item {
  display: flex;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  align-items: center;
  user-select: none;
}
.game-item:active { transform: scale(0.98); }
.game-cover {
  width: 76px;
  height: 100px;
  min-width: 76px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef1f4;
}
.game-item .list-name {
  font-size: 14px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.game-item .list-desc { margin-top: 4px; }

.search-result-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 2px 10px;
  font-size: 13px;
  color: var(--text-light);
}
.search-result-bar .btn-plain { font-size: 13px; padding: 2px 6px; }

/* === 游戏详情页 === */
.gd-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.gd-title { font-size: 17px; font-weight: bold; line-height: 1.5; }
.gd-date { font-size: 12px; color: var(--text-light); margin: 6px 0 12px; }
.gd-content {
  word-break: break-word;
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: break-word;
}
.gd-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 6px 0;
}
.gd-content video { max-width: 100%; border-radius: 8px; }
.gd-content a { color: var(--primary-dark); }

/* === 二级目录导航（首页游戏门户） === */
.primary-row .chip { font-weight: 600; padding: 7px 16px; }
.sub-row {
  margin-top: -6px;
  margin-bottom: 12px;
}
.sub-row .chip { padding: 4px 12px; font-size: 12px; background: rgba(76, 175, 80, 0.06); border-color: transparent; }

/* === 分组标题（列表/详情共用） === */
.gd-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin: 14px 2px 8px;
}

/* === 下载区（按钮图，参考桌面版 dl_imgs） === */
.dl-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
}
.dl-item {
  flex: 1;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.dl-item:active { transform: scale(0.96); }
.dl-img {
  width: 100%;
  max-width: 150px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #f7f9fa;
}
.dl-name { font-size: 13px; font-weight: 600; color: var(--text); }

/* === 游戏截图区 === */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.shot {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  cursor: zoom-in;
  background: #eef1f4;
}
.shot:active { opacity: 0.8; }

/* === 详情页收藏按钮 === */
.gd-head { position: relative; padding-bottom: 14px; }
.gd-head .gd-title { padding-right: 84px; }
.fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-light);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.fav-btn.on {
  border-color: #ffc107;
  background: #fff8e1;
  color: #f57f17;
}

/* === 登录卡片 === */
.auth-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 10px;
}
.auth-user { font-size: 16px; font-weight: bold; }
.auth-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.auth-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(76, 175, 80, 0.25);
  cursor: pointer;
  background: #eef1f4;
}
.auth-avatar.emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  cursor: default;
}
.auth-head .auth-stats { margin: 4px 0 0; }
.auth-stats {
  display: flex;
  gap: 16px;
  margin: 8px 0 12px;
  font-size: 13px;
  color: var(--text-light);
}
.auth-stats span { background: #f0f2f5; border-radius: 12px; padding: 4px 12px; }
.auth-actions { display: flex; gap: 10px; align-items: center; }
.auth-note {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-top: 14px;
}
.auth-link { text-decoration: none; display: inline-block; padding: 7px 14px; }

/* === 更换头像 === */
.avatar-big {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}
.avatar-big img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(76, 175, 80, 0.3);
  background: #eef1f4;
}
.av-presets {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 10px 0;
}
.av-preset {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  background: #eef1f4;
}
.av-preset:active { border-color: var(--primary); }

/* === 娱乐区子Tab + 视频区 === */
.fun-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 12px;
  position: sticky;          /* 滚动时固定顶部 */
  top: -12px;
  background: var(--bg);
  padding: 6px 0;
  z-index: 5;
}
/* 工具页子Tab不吸顶（避免 WebView 里吸顶+滚动的兼容问题） */
#tool-tabs { position: static; }
.fun-auto-btn {
  margin-left: auto;         /* 自动滚动按钮靠右 */
  font-size: 13px;
  padding: 6px 14px;
}
.vz-sec { margin-bottom: 6px; }
.vz-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.vz-row::-webkit-scrollbar { height: 4px; }
.vz-card {
  min-width: 150px;
  width: 150px;
  flex-shrink: 0;
  cursor: pointer;
}
.vz-card:active { transform: scale(0.97); }
.vz-thumb {
  position: relative;
  width: 100%;
  height: 84px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.vz-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
}
.vz-thumb-video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vz-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: linear-gradient(135deg, #43a047, #1b5e20);
}
.vz-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 20px;
  background: rgba(0, 0, 0, 0.55);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vz-title {
  font-size: 12px;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}
.player-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.pl-count { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }

/* 播放器应用内全屏（切视频保持全屏） */
#pl-wrap.player-fs {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 150;
  padding: 12px;
  display: flex;
  flex-direction: column;
  margin: 0;
}
#pl-wrap.player-fs #player-box { flex: 1; display: flex; align-items: center; }
#pl-wrap.player-fs #vplayer {
  max-height: none;
  flex: 1;
  border-radius: 0;
}
#pl-wrap.player-fs .player-title,
#pl-wrap.player-fs .pl-count { color: #ddd; }
#pl-wrap.player-fs .pl-count { color: #999; }
#pl-wrap.player-fs .btn-primary { flex-shrink: 0; }

/* === 图片区瀑布流（CSS columns） === */
.fun-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 6px 2px 10px;
}
.fun-title-row .page-title { margin: 0; }
.iz-wall {
  column-count: 2;
  column-gap: 8px;
}
.iz-img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 8px;
  display: block;
  background: #eef1f4;
  cursor: zoom-in;
  break-inside: avoid;
}
.iz-img:active { opacity: 0.85; }

/* === 日期时间 === */
.date-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
}
.dt-big {
  font-size: 42px;
  font-weight: bold;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}
.dt-date { font-size: 15px; color: var(--text); margin-top: 8px; }
.dt-cal { margin-top: 16px; }
.dt-cal-week, .dt-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dt-cal-week span {
  font-size: 11px;
  color: var(--text-light);
  padding: 4px 0;
}
.dt-cal-grid span {
  font-size: 13px;
  padding: 7px 0;
  border-radius: 8px;
}
.dt-cal-grid span.today {
  background: var(--primary);
  color: #fff;
  font-weight: bold;
}

/* === 感谢墙（红砖背景+名单瀑布流） === */
.tw-page {
  margin: -12px;
  padding: 12px 12px 24px;
  min-height: calc(100vh + 12px);
  background-color: #9c3d2c;
  background-image: url(../img/xie.jpeg);   /* 用户提供的砖纹图，随包走 */
  background-repeat: repeat;
  background-size: 460px auto;
  background-attachment: fixed;             /* 背景固定，不随内容滚动 */
}
.tw-back { color: #1a1a1a; }
.tw-title {
  text-align: center;
  font-size: 22px;
  font-weight: bold;
  color: #1a1a1a;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.35);
  margin-top: 6px;
}
.tw-sub {
  text-align: center;
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
  margin: 4px 0 14px;
}
#tw-wall { column-count: 2; column-gap: 10px; }
.tw-card {
  background: rgba(255, 250, 240, 0.96);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  break-inside: avoid;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  text-align: center;
}
.tw-name {
  font-size: 15px;
  font-weight: bold;
  color: #9c3d2c;
}
.tw-date { font-size: 11px; color: #b0857a; margin-top: 4px; }
.tw-empty { color: rgba(0, 0, 0, 0.75); }

/* === 工具包第二波 === */
.unit-sel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.unit-eq {
  text-align: center;
  font-size: 20px;
  color: var(--text-light);
  margin: 6px 0;
}
.money-out {
  font-size: 20px;
  font-weight: bold;
  color: var(--primary-dark);
  margin-top: 12px;
  word-break: break-all;
}
.money-out-sub { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.dc-result { font-size: 15px; margin-top: 8px; color: var(--primary-dark); }
.rand-big {
  font-size: 34px;
  font-weight: bold;
  text-align: center;
  margin: 10px 0;
  min-height: 44px;
}
.sw-laps { margin-top: 12px; text-align: left; }
.sw-lap {
  font-size: 13px;
  color: var(--text-light);
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.pom-count { font-size: 12px; color: var(--text-light); margin-top: 6px; }
.wc-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.wc-time { font-weight: bold; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.pw-check { display: block; margin: 6px 0; font-size: 14px; }
.tx-stat { font-size: 12px; color: var(--text-light); margin-top: 8px; }
.tool-img {
  max-width: 100%;
  max-height: 45vh;
  margin: 10px auto;
  display: block;
  border-radius: 10px;
}
.ng-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 10px;
}
.ng-grid img { width: 100%; display: block; }
.cl-preview {
  height: 90px;
  border-radius: 10px;
  margin-top: 10px;
  border: 1px solid var(--border);
}

/* === 图片工具包 === */
.pick-label {
  display: inline-block;
  text-align: center;
  cursor: pointer;
  user-select: none;
}
.widget-card.pack-card {
  background: linear-gradient(135deg, #43a047, #1b5e20);
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(27, 94, 32, 0.35);
}
.widget-card.pack-card .widget-desc { color: rgba(255, 255, 255, 0.85); }
.wm-pos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 140px;
  margin: 10px auto;
}
.wm-cell {
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--card);
}
.wm-cell.on { background: var(--primary); border-color: var(--primary); }
.cr-stage {
  position: relative;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  user-select: none;
  touch-action: none;
}
.cr-stage img { display: block; max-width: none; }
.cr-box {
  position: absolute;
  border: 2px dashed #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: move;
  touch-action: none;
}
.cr-box-circle {
  border-radius: 50%;
}
.cr-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 2px solid #4caf50;
  border-radius: 50%;
  z-index: 6;
  touch-action: none;
}
.cr-handle[data-corner="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.cr-handle[data-corner="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.cr-handle[data-corner="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.cr-handle[data-corner="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.co-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}
.co-swatch { text-align: center; cursor: pointer; }
.co-chip {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.co-hex { font-size: 10px; color: var(--text-light); margin-top: 4px; }

/* === GIF 动图制作 === */
.mg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.mg-row img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef1f4;
}
.mg-idx { font-size: 12px; color: var(--text-light); min-width: 16px; }
.mg-row-btns { display: flex; gap: 6px; margin-left: auto; }
.mg-row-btns button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 13px;
}
.mg-row-btns button:active { background: rgba(76, 175, 80, 0.15); }

/* === 视频截帧（一行3个，大图） === */
.vf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.vf-cell {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
}
.vf-cell.on { border-color: var(--primary); }
.vf-cell img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }

/* === 素材区操作行（小字按钮） === */
.mg-actions .btn-primary,
.mg-actions .btn-plain,
.mg-actions .pick-label {
  font-size: 12px;
  padding: 5px 10px;
}
.vf-check {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vf-cell.on .vf-check { background: var(--primary); }

/* === 打赏支持 === */
.rw-intro {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.8;
  padding: 14px;
}
.rw-amounts {
  display: flex;
  gap: 12px;
  margin: 12px 0;
}
.rw-item {
  flex: 1;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  text-align: center;
  cursor: zoom-in;
}
.rw-item:active { transform: scale(0.97); }
.rw-qr {
  width: 100%;
  max-width: 160px;
  border-radius: 8px;
  background: #fff;
}
.rw-price {
  margin-top: 8px;
  font-size: 16px;
  font-weight: bold;
  color: #e65100;
}
.rw-qgroup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
}
.rw-q-label { font-size: 13px; color: var(--text-light); }

/* === 设置页 === */
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
}
.set-label { font-size: 14px; font-weight: 600; }
.set-switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.set-switch input { opacity: 0; width: 0; height: 0; }
.set-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #c8cdd4;
  border-radius: 26px;
  transition: 0.2s;
  cursor: pointer;
}
.set-slider:before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}
.set-switch input:checked + .set-slider { background: var(--primary); }
.set-switch input:checked + .set-slider:before { transform: translateX(20px); }
.set-speed { display: flex; gap: 8px; margin-top: 10px; }
.set-cache-size { font-size: 11px; color: var(--text-light); font-weight: normal; }
.rw-q-num {
  flex: 1;
  font-size: 18px;
  font-weight: bold;
  color: var(--primary-dark);
  letter-spacing: 1px;
}

/* === 公告中心 === */
.announce-frame iframe {
  width: 100%;
  height: 72vh;
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

/* === 注册验证码 === */
.cap-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.cap-img {
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.cap-row .btn-plain { font-size: 12px; padding: 4px 6px; }

/* === 版本信息 === */
.version-line {
  text-align: center;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 16px;
}

/* === Toast === */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 32px);
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 99;
  max-width: 80%;
  text-align: center;
}
#toast.show { opacity: 1; }
