/* 核心视觉主题：深蓝科技感
   主色：深空蓝 #0f172a / 霓虹青 #22d3ee / 预警橙 #f59e0b
   辅助：命中=红、未中=绿、待定=橙 */
:root {
  --bg: #eef2f8;                         /* 冷调浅蓝底 */
  --surface: #ffffff;                    /* 卡片/表面 */
  --surface-2: #f1f5f9;                  /* 嵌套卡片底（月份格子） */
  --ink: #0f172a;                        /* 深空蓝作正文（呼应品牌） */
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #22d3ee;                      /* 霓虹青（主色） */
  --brand-weak: rgba(34,211,238,.14);
  --hit: #16a34a;                        /* 在线/盈利绿 */
  --miss: #dc2626;                       /* 红 */
  --pending: #f59e0b;                    /* 预警橙 */
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.06);
  --radius: 14px;
}

/* ===== 启动页 splash（首屏视觉） ===== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(ellipse at center, #0b1224 0%, #000 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity .6s ease, visibility .6s ease;
}
.splash.is-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.splash__inner {
  position: relative;
  width: 100%;
  height: 100%;
  /* 安全边距：顶部更紧凑(8px)，左右/底部 16px，让海报顶部更贴近 */
  box-sizing: border-box;
  padding:
    max(8px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}
/* 海报：带安全边距居中，锁定 9:16 比例（海报框恒为 9:16，不随视口乱留边） */
.splash__bg {
  position: relative;
  height: 100%;
  aspect-ratio: 9 / 16;   /* 固定 9:16 海报比例 */
  max-width: 100%;        /* 超宽屏时按宽度收，比例仍保持 */
  object-fit: contain;     /* 在 9:16 框内完整显示（保留海报上下设计留白），不变形 */
object-position: center top; /* 顶部对齐，海报顶部更贴近、顶部金句更靠上 */
  object-position: center;
  display: block;
  margin: auto;
  background-color: #0b1224;   /* 图片到位前的兜底（防首帧白闪） */
}
/* 横屏海报同样完整显示；提示与三圆点已移至顶部安全区，不再隐藏（不压海报内容） */
@media (orientation: landscape) {
  .splash__text { top: max(16px, env(safe-area-inset-top)); }
}
/* 手机端：恢复满屏布局（cover 铺满，无安全边距）；桌面端保持带边距的完整显示 */
@media (max-width: 640px) {
  .splash__bg {
    position: fixed;
    inset: 0;
    top: 0; right: 0; bottom: 0; left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;   /* 手机满屏铺满，海报本就竖版正合适 */
    background-color: #0b1224;
  }
}
.splash__text {
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;           /* 距顶部 10px 居中显示 */
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;      /* 白色 */
  letter-spacing: 2px;
  text-shadow: 0 0 16px rgba(200, 225, 255, 0.55);
  white-space: normal;
  padding: 0 24px;
  line-height: 1.45;
}
/* 三圆点加载指示（青 / 蓝 / 金 分色） */
.splash__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.splash__dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  animation: dotBounce 1.2s ease-in-out infinite;
}
.splash__dots i:nth-child(1) {
  background: #22d3ee;
  box-shadow: 0 0 10px rgba(34, 211, 238, .75);
  animation-delay: 0s;
}
.splash__dots i:nth-child(2) {
  background: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, .75);
  animation-delay: .2s;
}
.splash__dots i:nth-child(3) {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, .75);
  animation-delay: .4s;
}
@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-12px); opacity: 1; }
}

/* ===== 亮色主题变量（浅灰蓝渐变 + 纯白卡 + 蓝紫点缀，明亮通透） ===== */
:root.dark {
  --bg: linear-gradient(165deg, #eef1fb 0%, #e6ebf8 55%, #dde6f7 100%); /* 浅灰蓝渐变背景 */
  --surface: #ffffff;                    /* 纯白卡片（统一白色） */
  --surface-2: #f1f5f9;                  /* 嵌套卡片底（月份格子等） */
  --ink: #1e293b;                        /* 深色文字（亮底），阅读舒适 */
  --muted: #64748b;                      /* 次要文字 */
  --line: #e2e8f0;                       /* 淡灰蓝分割线 */
  --brand: #6366f1;                      /* 品牌蓝紫（主强调色） */
  --brand-weak: rgba(99,102,241,.12);
  --brand-2: #8b5cf6;                    /* 渐变紫（标题用） */
  --hit: #16a34a;                        /* 绿（状态标签 / 盈利） */
  --miss: #dc2626;                       /* 红 */
  --pending: #f59e0b;                    /* 预警橙 */
  --shadow: 0 1px 3px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.10); /* 柔和悬浮投影 */
}

/* 暗色主题：修正硬编码表面，确保对比协调（深蓝科技感） */
:root.dark .sync-time { color: var(--ink); }
:root.dark .topbar { background: var(--bg); backdrop-filter: blur(10px); }
:root.dark .tabbar {
  background: var(--bg);
  border-top-color: rgba(255,255,255,.5);
  box-shadow: 0 -4px 18px rgba(15,23,42,.08);
}
:root.dark .grid thead th { background: transparent; color: #e5e7eb; }
:root.dark .grid thead th.col-date { background: var(--surface); }
:root.dark .grid thead .grp { background: var(--brand-weak); color: var(--brand); }
:root.dark #btnDeleteAll { background: var(--surface); border-color: var(--line); color: var(--muted); }
:root.dark #btnDeleteAll:hover { background: var(--line); }
:root.dark .btn--danger { color: #0f172a; }
:root.dark .login-box__input { background: #0b1224; color: var(--ink); }
:root.dark .login-box__input:focus { background: #16243f; box-shadow: 0 0 0 3px var(--brand-weak); }
:root.dark .add-cards-row .add-card { border-color: var(--line); }
:root.dark .thumb { background: var(--surface); }
/* 状态分色高亮（暗色：半透明科技色 + 亮色文字） */
/* 状态分色高亮（暗色：命中=红 / 未中=绿 / 待定=黄；鲜艳色板 + 同色描边 + 圆角 + 加粗，呈标签高亮） */
:root.dark .cell.st-命中 { background: rgba(244,63,94,.20); color: #fb7185; box-shadow: inset 0 0 0 1px rgba(244,63,94,.55); border-radius: 8px; font-weight: 700; }
:root.dark .cell.st-未中 { background: rgba(34,197,94,.20); color: #4ade80; box-shadow: inset 0 0 0 1px rgba(34,197,94,.55); border-radius: 8px; font-weight: 700; }
:root.dark .cell.st-待定 { background: rgba(250,204,21,.20); color: #facc15; box-shadow: inset 0 0 0 1px rgba(250,204,21,.55); border-radius: 8px; font-weight: 700; }
:root.dark .app.is-locked .cell.st-命中 { color: #fb7185; font-weight: 700; }
:root.dark .app.is-locked .cell.st-未中 { color: #4ade80; font-weight: 700; }
:root.dark .app.is-locked .cell.st-待定 { color: #facc15; font-weight: 700; }

/* 第2列 精选二串一·推荐：海蓝字体 + 标签分色高亮（圆角 + 同色描边 + 加粗，与第6列紫标签一致） */
.grid tbody td[data-key="combo"] .cell { color: #38bdf8; }
:root.dark .grid tbody td[data-key="combo"] .cell {
  background: rgba(56,189,248,.20);
  color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56,189,248,.55);
  border-radius: 8px;
  font-weight: 700;
}
:root.dark .grid thead th[data-key="combo"] { color: #38bdf8; }

/* 第6列 总进球单关·推荐：紫色字体 + 标签分色高亮（圆角 + 同色描边 + 加粗，与状态标签一致） */
.grid tbody td[data-key="goal"] .cell { color: #c084fc; }
:root.dark .grid tbody td[data-key="goal"] .cell {
  background: rgba(168,85,247,.20);
  color: #c084fc;
  box-shadow: inset 0 0 0 1px rgba(168,85,247,.55);
  border-radius: 8px;
  font-weight: 700;
}
:root.dark .grid thead th[data-key="goal"] { color: #c084fc; }

/* 第3、4列 精选二串一·投注/收益：海蓝字体 + 标签分色高亮（与第2列一致） */
.grid tbody .cell[data-key="comboBet"],
.grid tbody .cell[data-key="comboProfit"] { color: #38bdf8; }
:root.dark .grid tbody .cell[data-key="comboBet"],
:root.dark .grid tbody .cell[data-key="comboProfit"] {
  background: rgba(56,189,248,.20);
  color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56,189,248,.55);
  border-radius: 8px;
  font-weight: 700;
}
:root.dark .grid thead th[data-key="comboBet"],
:root.dark .grid thead th[data-key="comboProfit"] { color: #38bdf8; }

/* 第7、8列 总进球单关·投注/收益：紫字体 + 标签分色高亮（与第6列一致） */
.grid tbody .cell[data-key="goalBet"],
.grid tbody .cell[data-key="goalProfit"] { color: #c084fc; }
:root.dark .grid tbody .cell[data-key="goalBet"],
:root.dark .grid tbody .cell[data-key="goalProfit"] {
  background: rgba(168,85,247,.20);
  color: #c084fc;
  box-shadow: inset 0 0 0 1px rgba(168,85,247,.55);
  border-radius: 8px;
  font-weight: 700;
}
:root.dark .grid thead th[data-key="goalBet"],
:root.dark .grid thead th[data-key="goalProfit"] { color: #c084fc; }

/* 总进球单关组：紫色辅助背景（海紧紫）+ 紫字（海紧） */
/* tfoot 合计行（非 tbody，不受斑马纹影响）直接套用 */
.grid tfoot td[data-group="总进球单关"] {
  background: rgba(168,85,247,.12);
}
/* 注：tbody 单元格有斑马纹规则 background:transparent（特异性 0,2,3），
   此处用 :root.dark .grid tbody tr 提升特异性至 (0,4,3) 以覆盖 */
:root.dark .grid tbody tr td[data-group="总进球单关"],
:root.dark .grid tbody tr th[data-group="总进球单关"] {
  background: rgba(168,85,247,.12);
}
:root.dark .grid thead th[data-group="总进球单关"] { color: #c084fc; }
:root.dark .grid thead th.grp[data-group="总进球单关"] {
  background: rgba(168,85,247,.22);
  color: #c084fc;
}

/* 精选二串一组：海蓝辅助背景（海蓝 #38bdf8）+ 海蓝字，与总进球单关组对称 */
/* tfoot 合计行（非 tbody，不受斑马纹影响）直接套用 */
.grid tfoot td[data-group="精选二串一"] {
  background: rgba(56,189,248,.12);
}
/* tbody 单元格有斑马纹规则 background:transparent（特异性 0,2,3），
   此处用 :root.dark .grid tbody tr 提升特异性至 (0,4,3) 以覆盖 */
:root.dark .grid tbody tr td[data-group="精选二串一"],
:root.dark .grid tbody tr th[data-group="精选二串一"] {
  background: rgba(56,189,248,.12);
}
:root.dark .grid thead th[data-group="精选二串一"] { color: #38bdf8; }
:root.dark .grid thead th.grp[data-group="精选二串一"] {
  background: rgba(56,189,248,.22);
  color: #38bdf8;
}

/* ===== 主题切换：全局平滑过渡（仅在已就绪后启用，避免首屏动画） ===== */
html.theme-ready * {
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease;
}

/* ===== 入场动画：覆盖整个界面的渐入（表头 / 卡片 / 行级 / 各模块错落） ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* 顶栏与底部栏整体淡入 */
.topbar { animation: fadeIn .5s ease both; }
.tabbar { animation: fadeIn .5s ease both; }

/* 面板进入时，按视觉顺序错落渐入（切到该面板即重新播放） */
.panel--enter .year-picker { animation: fadeUp .42s ease both; }
.panel--enter .slogan-banner,
.panel--enter .scroll-hint { animation: fadeUp .44s ease both; animation-delay: .04s; }
.panel--enter .summary .card { animation: fadeUp .5s ease both; }
.panel--enter .table-wrap { animation: fadeIn .5s ease both; }
.panel--enter .grid thead th { animation: fadeIn .42s ease both; }
.panel--enter .grid tbody tr { animation: fadeUp .46s ease both; }
.panel--enter .actions { animation: fadeUp .46s ease both; }
.panel--enter .foot { animation: fadeUp .42s ease both; }
/* 悬浮新增按钮：登录后显示时弹入 */
.fab { animation: popIn .5s ease both; animation-delay: .22s; }

/* 汇总面板：同步提示 / 分析 / 历史 */
.panel--enter .sync-note { animation: fadeUp .44s ease both; animation-delay: .04s; }
.panel--enter .analysis { animation: fadeUp .5s ease both; }
.panel--enter .analysis__list li { animation: fadeUp .46s ease both; }
.panel--enter .history { animation: fadeUp .5s ease both; }
.panel--enter .history__table tbody tr { animation: fadeUp .46s ease both; }

/* 图库面板：提示 / 日期组标题 / 缩略图 / 上传按钮 / 空态 */
.panel--enter .gallery__hint--top { animation: fadeUp .42s ease both; }
.panel--enter .gallery__day { animation: fadeUp .5s ease both; animation-delay: .03s; }
.panel--enter .gallery .thumb { animation: popIn .46s ease both; }
.panel--enter .upload-actions { animation: fadeUp .46s ease both; }
.panel--enter .gallery__empty { animation: fadeUp .42s ease both; }

/* 错落：汇总卡片轻错峰 */
.panel--enter .summary .card:nth-child(1) { animation-delay: .06s; }
.panel--enter .summary .card:nth-child(2) { animation-delay: .13s; }
.panel--enter .summary .card:nth-child(3) { animation-delay: .20s; }
/* 表头逐列 */
.panel--enter .grid thead th:nth-child(1) { animation-delay: .05s; }
/* 数据行逐行渐入（约 12 行后统一节奏） */
.panel--enter .grid tbody tr:nth-child(1) { animation-delay: .08s; }
.panel--enter .grid tbody tr:nth-child(2) { animation-delay: .12s; }
.panel--enter .grid tbody tr:nth-child(3) { animation-delay: .16s; }
.panel--enter .grid tbody tr:nth-child(4) { animation-delay: .20s; }
.panel--enter .grid tbody tr:nth-child(5) { animation-delay: .24s; }
.panel--enter .grid tbody tr:nth-child(6) { animation-delay: .28s; }
.panel--enter .grid tbody tr:nth-child(7) { animation-delay: .32s; }
.panel--enter .grid tbody tr:nth-child(8) { animation-delay: .36s; }
.panel--enter .grid tbody tr:nth-child(9) { animation-delay: .40s; }
.panel--enter .grid tbody tr:nth-child(10) { animation-delay: .44s; }
.panel--enter .grid tbody tr:nth-child(11) { animation-delay: .48s; }
.panel--enter .grid tbody tr:nth-child(12) { animation-delay: .52s; }
.panel--enter .grid tbody tr:nth-child(n+13) { animation-delay: .56s; }
/* 历史月度逐行 */
.panel--enter .history__table tbody tr:nth-child(1) { animation-delay: .10s; }
.panel--enter .history__table tbody tr:nth-child(2) { animation-delay: .13s; }
.panel--enter .history__table tbody tr:nth-child(3) { animation-delay: .16s; }
.panel--enter .history__table tbody tr:nth-child(4) { animation-delay: .19s; }
.panel--enter .history__table tbody tr:nth-child(5) { animation-delay: .22s; }
.panel--enter .history__table tbody tr:nth-child(6) { animation-delay: .25s; }
.panel--enter .history__table tbody tr:nth-child(n+7) { animation-delay: .28s; }
/* 分析条目逐条 */
.panel--enter .analysis__list li:nth-child(1) { animation-delay: .12s; }
.panel--enter .analysis__list li:nth-child(2) { animation-delay: .16s; }
.panel--enter .analysis__list li:nth-child(3) { animation-delay: .20s; }
.panel--enter .analysis__list li:nth-child(4) { animation-delay: .24s; }
/* 图库缩略图逐张 */
.panel--enter .gallery .thumb:nth-child(1) { animation-delay: .08s; }
.panel--enter .gallery .thumb:nth-child(2) { animation-delay: .12s; }
.panel--enter .gallery .thumb:nth-child(3) { animation-delay: .16s; }
.panel--enter .gallery .thumb:nth-child(4) { animation-delay: .20s; }
.panel--enter .gallery .thumb:nth-child(5) { animation-delay: .24s; }
.panel--enter .gallery .thumb:nth-child(6) { animation-delay: .28s; }
.panel--enter .gallery .thumb:nth-child(n+7) { animation-delay: .32s; }

/* hover 标签 / 按钮放大发光（全界面一致的交互反馈） */
.tab { transition: transform .18s ease, color .18s ease; will-change: transform; }
.tab:hover {
  transform: scale(1.09);
  color: var(--brand);
  text-shadow: 0 0 10px var(--brand);
}
.tab:hover svg { filter: drop-shadow(0 0 6px var(--brand)); }
.tab:active { transform: scale(1.02); }

.btn, .fab, .upload-actions .btn {
  transition: transform .16s ease, box-shadow .16s ease, color .16s ease, background-color .16s ease, border-color .16s ease;
}
.btn:hover, .upload-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255,255,255,.7);
}
.btn--primary:hover, .fab:hover {
  box-shadow: 0 8px 22px rgba(255,255,255,.75);
  text-shadow: 0 0 10px rgba(255,255,255,.55);
}
.btn--danger:hover {
  box-shadow: 0 6px 18px rgba(239,68,68,.4);
  text-shadow: 0 0 8px rgba(239,68,68,.6);
}
.fab:hover { transform: translateY(-2px) scale(1.06); }
.fab:active { transform: scale(.94); }

/* 尊重系统「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  .topbar, .tabbar, .fab,
  .panel--enter .year-picker,
  .panel--enter .slogan-banner,
  .panel--enter .scroll-hint,
  .panel--enter .summary .card,
  .panel--enter .table-wrap,
  .panel--enter .grid thead th,
  .panel--enter .grid tbody tr,
  .panel--enter .actions,
  .panel--enter .foot,
  .panel--enter .sync-note,
  .panel--enter .analysis,
  .panel--enter .analysis__list li,
  .panel--enter .history,
  .panel--enter .history__table tbody tr,
  .panel--enter .gallery__hint--top,
  .panel--enter .gallery .thumb,
  .panel--enter .upload-actions,
  .panel--enter .gallery__empty { animation: none !important; }
  .tab, .btn, .fab, .upload-actions .btn { transition: none; }
  .tab:hover { transform: none; text-shadow: none; }
  .tab:hover svg { filter: none; }
  .btn:hover, .upload-actions .btn:hover, .btn--primary:hover, .fab:hover, .btn--danger:hover {
    transform: none; box-shadow: none; text-shadow: none;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

.app {
  max-width: 920px;
  margin: 0 auto;
  height: 100%;
  height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 70px 14px 76px;
  transition: max-width .2s ease;
}

/* 顶部栏（固定） */
.topbar {
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 920px;
  z-index: 60;
  transition: max-width .2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: max(11px, env(safe-area-inset-top)) 14px 11px;
}
.topbar__left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 0 auto; }
.logo {
  display: block;
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  cursor: pointer;
}
.logo:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
/* 顶栏中心标题框：标题 + 阅读 + 在线 居中（绝对居中，不受左右两侧宽度影响） */
.topbar__center {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0;
  text-align: center;
  pointer-events: none;   /* 让下方交互穿透，仅标题框本身可点 */
}
.board-title {
  border: none; background: transparent;
  font-size: 16px; font-weight: 800;
  color: #4f46e5;  /* 品牌蓝紫，醒目 */
  text-shadow: 0 1px 3px rgba(79,70,229,.22);  /* 柔和阴影 */
  padding: 0; width: 100%; outline: none; text-align: center;
}
.board-title:focus { box-shadow: 0 1px 0 var(--brand); }
.board-title[readonly] { cursor: default; }
.board-title[readonly]:focus { box-shadow: none; outline: none; }

/* 顶栏阅读/在线人数 */
.presence-label {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 10px; color: var(--muted); margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.presence__item { white-space: nowrap; }
.presence__online { color: var(--hit); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot--online { background: var(--hit); box-shadow: 0 0 0 0 rgba(22,163,74,.5); animation: pulse-online 1.8s infinite; }
@keyframes pulse-online {
  0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); }
  70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

.topbar__right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; position: relative; z-index: 1; }

.topbar__center .board-title,
.topbar__center .presence-label { pointer-events: auto; }

/* 顶栏「刷新」按钮：按需求暂时隐藏（display:none）；代码与刷新同步逻辑保留，后续可随时恢复 */
#refreshBtn { display: none; }

/* 记录页月份选择器内居中的日期时间（年份 + 日期 + 周几 + 时间），每秒刷新 */
.yp__datetime {
  flex: 1 1 auto;
  margin: 0 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}

/* 刷新图标旋转反馈 */
.is-spinning svg { animation: icon-spin .6s linear; }
@keyframes icon-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.sync-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 3px;
  background: var(--muted); transition: background .2s;
}
/* 时间作为第二行：等宽数字，黑色 */
.sync-time {
  display: block;
  font-variant-numeric: tabular-nums;
  color: #000;
  opacity: 1;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* 标题栏右侧本地时钟：年份 + 日期 + 周几 + 时间 */
.local-clock {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; line-height: 1; color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px; font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .05s, background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #0f172a; }
.btn--ghost { background: var(--surface); }
.btn--block { width: 100%; }

/* 登录弹窗（点头像弹出，不支持注册） */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal.is-open { display: flex; }
.modal__mask { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.modal__dialog {
  position: relative; width: min(92vw, 360px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.18);
  padding: 18px; max-height: 88vh; overflow-y: auto;
}
.modal__head { position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.modal__title { font-size: 17px; font-weight: 800; color: var(--ink); text-align: center; }
.modal__x { position: absolute; top: -2px; right: 0; border: none; background: transparent; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal__form { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.modal__form .login-box__input { text-align: center; width: 100%; }
.modal__hint { margin-top: 12px; text-align: center; }
.modal__status { text-align: center; margin-bottom: 12px; color: var(--ink); font-weight: 600; }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--danger { background: var(--miss); border-color: var(--miss); color: #fff; }
.btn--danger:hover { filter: brightness(1.06); }
.btn--danger:active { transform: translateY(1px); }
/* 「删除全部记录」按钮：白底、白边框、灰字（低对比、克制风格） */
#btnDeleteAll { background: #fff; border-color: #fff; color: var(--muted); }
#btnDeleteAll:hover { background: #f3f4f6; }
#btnDeleteAll:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 备注 */
.note-input {
  border: none; background: transparent;
  color: var(--muted); font-size: 13px;
  width: 100%; outline: none; padding: 2px 0;
}
.note-input:focus { color: var(--ink); }

/* 汇总卡片 */
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}
/* 记录页卡片数据解读：上方间距 8px（仅作用于 #recSummary，汇总页不受影响） */
#recSummary { margin-top: 8px; }
#recSummary .card { text-align: center; }
#recSummary .card__value { font-size: 18px; }
/* 汇总页卡片：内容居中（本年投注/本年收益/命中率） */
#tabSummary .card { text-align: center; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px;
  box-shadow: var(--shadow);
}
.card__label { font-size: 12px; color: var(--muted); }
.card__value { font-size: 22px; font-weight: 800; margin-top: 4px; letter-spacing: .3px; }
/* 显式红：收益汇总数字强制红字（用户要求 ¥466,474 红） */
.card__value.is-red { color: var(--miss); }
/* 命中率：≥50% 红，<50% 绿（用户要求） */
.card__value.is-green { color: var(--hit); }

/* 首页分享卡片：二维码 + 复制链接 */
.share-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 12px;
  margin: 2px 0;
  min-height: 100px;
  box-sizing: border-box;
}
.share-card__qr { flex: 0 0 auto; }
.share-card__qr-img {
  width: 72px;
  height: 72px;
  display: block;
  border-radius: 10px;
  background: #fff;
  padding: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.share-card__qr-img:active { transform: scale(.94); }
/* 灯箱放大二维码：白底方图、可长按保存，居中更醒目 */
.lightbox__img.qr-zoom {
  width: min(78vw, 340px);
  height: min(78vw, 340px);
  background: #fff;
  padding: 14px;
  box-sizing: border-box;
  object-fit: contain;
}
.share-card__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.share-card__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.share-card__title { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.share-card__desc { font-size: 11px; color: var(--muted); margin: 0; line-height: 1.4; max-height: 2.8em; overflow: hidden; }
/* 98px 态：复制按钮改为行内小按钮，与标题同一行 */
.share-card .btn--block { flex: 1 1 0; width: auto; padding: 6px 12px; font-size: 10px; }
/* 一键生成专属海报：与复制链接等宽平铺同一行（海报在左、复制到右边），上拉贴合；海蓝辅助色（字体海蓝 + 描边 + 浅底标签高亮） */
.share-card__poster { flex: 1 1 0; margin-top: 0; padding: 6px 10px !important; font-size: 11px; color: var(--brand) !important; border-color: var(--brand) !important; background: var(--brand-weak) !important; }
/* 图库分享卡片：按钮内文字水平居中 */
.share-card__head .btn { justify-content: center; }


/* 年月选择器（汇总 / 记录 Tab 顶部） */
.year-picker {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0 14px;
  margin: 0;
  height: 40px;
  overflow: hidden;
}
.yp__group { display: flex; align-items: center; gap: 4px; }
.yp__arrow {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--ink);
  font-size: 18px; line-height: 1; cursor: pointer;
  transition: transform .05s, border-color .15s, background .15s, color .15s;
}
.yp__arrow:active:not(:disabled) { transform: scale(.92); background: var(--brand); border-color: var(--brand); color: #fff; }
.yp__arrow:disabled { opacity: .35; cursor: not-allowed; }
.yp__val {
  font-weight: 800; color: var(--brand); font-size: 20px;
  min-width: 2.2em; text-align: center;
  cursor: pointer; user-select: none; transition: transform .05s;
}
.yp__month { min-width: 1.5em; }
.yp__val:active { transform: scale(.96); }
.yp__val:focus { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.yp__sep { color: var(--muted); font-size: 14px; }
.yp__sync { flex: 0 0 auto; padding: 4px 10px; }

/* 汇总：更明显的日期选择栏（仅作用于 #yearPicker，记录页不受影响） */
#yearPicker {
  padding: 0 12px;
  height: 40px;
  gap: 6px;
  justify-content: flex-start;
  border-width: 1px;
  box-shadow: 0 2px 10px rgba(255,255,255,.6);
}
#yearPicker .yp__sync { margin-left: auto; }
#yearPicker .yp__val { font-size: 18px; }
#yearPicker .yp__year { min-width: 2.6em; }
#yearPicker .yp__month { min-width: 1.8em; }
#yearPicker .yp__arrow { width: 26px; height: 26px; font-size: 18px; }
#yearPicker .yp__sep { font-size: 18px; font-weight: 700; color: var(--brand); }

/* 记录页：月份靠左、日期时间居中一行、回到本月靠右 */
#rpPicker { justify-content: flex-start; flex-wrap: nowrap; height: auto; overflow: visible; }
#rpPicker .yp__sync { margin-left: auto; }

/* 口号横幅：浅蓝色圆角提示语（记录页中部） */
.slogan-banner {
  margin: 1px 0 12px;
  padding: 0 16px;
  height: 25px;
  box-sizing: border-box;
  overflow: hidden;
  background: var(--brand-weak);
  color: var(--brand);
  border: 1px solid rgba(37,99,235,0.28);
  border-radius: 10px;
  text-align: center;
  font-size: 12px; font-weight: 800; line-height: 23px;
  box-shadow: 0 2px 8px rgba(255,255,255,.55);
}
.scroll-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--muted);
  font-size: 11px;
  margin: 8px 4px 6px;
  text-align: center;
}
.scroll-hint__left { text-align: left; display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--ink); }
.scroll-hint__right {
  text-align: right;
  white-space: nowrap;
  color: var(--brand);
  background: var(--brand-weak);
  border-radius: 8px;
  padding: 3px 9px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(34,211,238,.55);
}
.scroll-dot {
  flex: 0 0 auto;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--hit);
}
/* 顶部提示：左更新时间 / 右滑动提示 一行两端对齐 */

/* 表格 */
.table-wrap {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.grid {
  border-collapse: collapse;
  width: auto;
  min-width: 100%;
  table-layout: auto;
}
.grid th, .grid td {
  border: none;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

/* 表格行背景透明：透出深空底 + 青色光晕；状态单元格保留红/绿底 */
.grid tbody tr:nth-child(odd) td,
.grid tbody tr:nth-child(even) td { background: transparent; }
/* 冻结日期列保留实色底，避免横向滚动时透出其它列内容 */
.grid tbody tr td.col-date,
.grid tfoot tr td.col-date { background: var(--surface); }

.grid thead th {
  background: #0f172a;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  padding: 9px 8px;
  text-align: center;
  position: sticky; top: 0;
}
.grid thead .grp {
  background: var(--brand-weak);
  color: var(--brand);
  font-size: 14px;   /* 五号字 */
  font-weight: 700;  /* 加粗 */
}
.grid thead .col-date { text-align: center; }
.grid th.col-date, .grid td.col-date {
  white-space: nowrap;
  width: 60px;
  position: sticky;
  left: 0;
  z-index: 2;
}
/* 左上角（日期列表头）需同时冻结上下，层级最高 */
.grid thead th.col-date {
  z-index: 3;
  background: #1e293b;
}

/* 单元格输入 */
.cell {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 9px 8px;
  outline: none;
  text-align: center;
}
.cell:focus { background: var(--brand-weak); border-radius: 6px; box-shadow: 0 0 0 2px var(--brand) inset; }
.cell--num { text-align: center; font-variant-numeric: tabular-nums; }
.cell--date { font-weight: 600; width: 60px; }

select.cell {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  text-align: center;
  text-align-last: center;
  padding: 9px 6px;
}
/* 推荐列（第 2、6 列）：自动换行 + 行高自适应（table-layout:auto 下宽度按内容自适应） */
.grid th.col-wrap, .grid td.col-wrap { white-space: normal; }
/* 第6列（总进球单关·推荐）：按需求强制整列 80px 宽，内容/表头由 overflow 裁切 */
.grid th[data-key="goal"], .grid td[data-key="goal"] {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  padding: 0;
  overflow: hidden;
}
/* 单元格内边距随 80px 列宽恢复正常，内容可见（fitFont 会按列宽自适应字号） */
.grid td[data-key="goal"] .cell--wrap { padding: 9px 4px; }
/* 合计行第6列空单元格需单独覆盖 .grid tfoot td 的 10px 8px 内边距，否则会把列顶宽 */
.grid tfoot td[data-key="goal"] { width: 80px; min-width: 80px; max-width: 80px; padding: 0; overflow: hidden; }
.cell--wrap {
  display: inline-block;
  vertical-align: middle;
  width: 100%;
  height: auto;
  min-height: 38px;
  margin: 0;
  padding: 9px 8px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  resize: none;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
}

.st-命中 { color: var(--hit); font-weight: 700; }
.st-未中 { color: var(--miss); font-weight: 700; }
.st-待定 { color: #facc15; font-weight: 700; }

/* 状态分色高亮：命中=红、未中=绿、待定=橙（暗色版见 :root.dark 覆盖） */
.cell.st-命中 { background: #fee2e2; color: #dc2626; }
.cell.st-未中 { background: #dcfce7; color: #16a34a; }
.cell.st-待定 { background: #fef9c3; color: #a16207; }
/* 状态列固定宽度 50px（两串一·状态 / 总进球单关·状态） */
.cell.st-命中, .cell.st-未中, .cell.st-待定 { width: 50px; }
.grid th.col-status, .grid td.col-status { width: 50px; }
/* 只读态：仅文字着色 + 圆角 pill（无背景，颜色同状态色） */
.app.is-locked .cell.st-命中 { color: #dc2626; border-radius: 15px; height: 30px; padding: 0 8px; }
.app.is-locked .cell.st-未中 { color: #16a34a; border-radius: 15px; height: 30px; padding: 0 8px; }
.app.is-locked .cell.st-待定 { color: #a16207; border-radius: 15px; height: 30px; padding: 0 8px; }

/* 状态为「跟推荐时」(待定)：同一分组的「投注 / 收益」输入格与状态同色一起高亮 */
.grid tbody tr[data-cs="待定"] td[data-key="comboBet"] .cell,
.grid tbody tr[data-cs="待定"] td[data-key="comboProfit"] .cell,
.grid tbody tr[data-gs="待定"] td[data-key="goalBet"] .cell,
.grid tbody tr[data-gs="待定"] td[data-key="goalProfit"] .cell {
  background: #fef9c3;
  border-radius: 8px;
}
:root.dark .grid tbody tr[data-cs="待定"] td[data-key="comboBet"] .cell,
:root.dark .grid tbody tr[data-cs="待定"] td[data-key="comboProfit"] .cell,
:root.dark .grid tbody tr[data-gs="待定"] td[data-key="goalBet"] .cell,
:root.dark .grid tbody tr[data-gs="待定"] td[data-key="goalProfit"] .cell {
  background: rgba(250,204,21,.20);
  border-radius: 8px;
}

/* 删除按钮 */
.row-del {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  border: none; background: transparent;
  color: var(--muted); cursor: pointer;
  padding: 9px 6px;
}
.row-del:hover { color: var(--miss); }

/* 合计行：统一表面色高亮（非斑马纹，主题自动适配） */
.grid tfoot td {
  background: transparent;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding: 10px 8px;
}
.grid tfoot .foot-label { color: var(--muted); font-weight: 700; }

/* 操作区 */
.actions { margin-top: 12px; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
/* 访客（未登录）纯阅读：隐藏管理控件（新增一行 + 操作列） */
.app.is-locked .actions { display: none; }
.app.is-locked .col-op { display: none; }

/* 悬浮新增按钮（右下角） */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 6px 18px rgba(255,255,255,.7);
  cursor: pointer;
  z-index: 55;
}
.fab:active { transform: scale(.92); }
.fab svg { width: 26px; height: 26px; }

.foot { margin-top: 18px; margin-bottom: 20px; text-align: center; }
/* 页脚提示：海灰字体 + 灰色框 */
.foot .note-input {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 10px;
  padding: 10px 16px;
  color: #94a3b8;
  background: rgba(148,163,184,.12);
  border: 1px solid rgba(148,163,184,.4);
  border-radius: 12px;
  font-weight: 700;
  line-height: 1.6;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) translateY(20px);
  max-width: 80vw; width: max-content;
  text-align: center;
  background: #111827; color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 10px 16px; border-radius: 10px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) translateY(0); }

/* 标签面板 */
.panel { display: none; }
.panel.is-active { display: block; }

/* 底部标签栏 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 920px;
  display: flex;
  transition: max-width .2s ease;
  background: var(--bg);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 -4px 18px rgba(15,23,42,.08);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 50;
}
.tab {
  flex: 1; border: none; background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0 7px; cursor: pointer;
  color: var(--muted); font-size: 10px; font-weight: 600;
}
.tab svg { width: 15px; height: 15px; }
.tab.is-active { color: var(--brand); }

/* 我的 */
.mine {
  max-width: 360px; margin: 24px auto 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 20px; text-align: center;
}
.mine__status { color: var(--muted); font-size: 13px; margin: 4px 0 18px; }

/* 关于页内联登录 */
.about-login {
  display: flex; flex-direction: column; gap: 10px;
  margin: 8px 0 2px;
}
.login-box__input {
  width: 100%; box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; outline: none; background: #fbfcfe;
}
.login-box__input:focus { border-color: var(--brand); background: #fff; }

/* 未登录：仅可查看，不可编辑；单元格保持透明（状态色除外） */
.app.is-locked .cell { background: transparent; }
/* 只读态禁用单元格保持原色（不被浏览器灰掉），仅禁止交互 */
.app.is-locked .cell:disabled {
  opacity: 1;
  -webkit-text-fill-color: currentColor;
  cursor: default;
}
.app.is-locked .row-del { opacity: .35; cursor: not-allowed; }
.app.is-locked #addBtn { opacity: .5; cursor: not-allowed; }
.mine__hint { color: var(--muted); font-size: 12px; margin: 14px 0 0; }

/* 汇总页：同步说明 + 详细分析 + 历史月度净盈利 */
.sync-note {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); margin: 14px 2px 0;
}
.sync-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #15803d;
  box-shadow: 0 0 0 3px rgba(21,128,61,.15);
}
/* 汇总页同步说明：圆点状态色与标题栏 sync-pill 统一 */
.sync-note.is-ok .sync-dot { background: var(--hit); box-shadow: 0 0 0 3px rgba(21,128,61,.15); }
.sync-note.is-syncing .sync-dot { background: var(--brand); animation: pulse 1s infinite; }
.sync-note.is-error .sync-dot { background: var(--miss); box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

/* 全局多端同步标识：手机与浏览器打开同一链接即自动同步，所有面板可见（按需求暂时隐藏） */
.sync-banner {
  display: none; align-items: center; justify-content: center; gap: 8px;
  margin: 10px 12px 0; padding: 9px 12px;
  font-size: 12.5px; line-height: 1.4; color: #22d3ee; text-align: center;
  background: rgba(34,211,238,.10);
  border: 1px solid rgba(34,211,238,.28);
  border-radius: 12px;
  box-shadow: 0 0 18px rgba(34,211,238,.08) inset;
}
.sync-banner__icon { font-size: 15px; line-height: 1; }
.sync-banner__text { font-weight: 600; letter-spacing: .2px; }

/* 标题栏右侧系统状态：与 sync-note 共用圆点配色 */
.sys-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.sys-status .sync-dot { margin-top: 0; }
.sys-status.is-ok .sync-dot { background: var(--hit); box-shadow: 0 0 0 3px rgba(21,128,61,.15); }
.sys-status.is-syncing .sync-dot { background: var(--brand); animation: pulse 1s infinite; }
.sys-status.is-error .sync-dot { background: var(--miss); box-shadow: 0 0 0 3px rgba(220,38,38,.15); }
.analysis {
  margin-top: 10px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.analysis__title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.analysis__list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.analysis__list li { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.a-k { color: var(--muted); }
.a-v { font-weight: 700; color: var(--ink); }
.a-v.pos { color: #c62828; }
.a-v.neg { color: #15803d; }

.history { margin-top: 12px; }
.history__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 2px 8px; flex-wrap: wrap;
}
.history__hint { font-size: 12px; font-weight: 600; color: var(--muted); }
.history__toggle { font-size: 12px; padding: 4px 10px; white-space: nowrap; }

/* 历史列表：年份倒序分组 + 点击展开 */
.history__list { display: flex; flex-direction: column; gap: 8px; }
.history__empty { font-size: 13px; color: var(--muted); padding: 8px 2px; }
.hist-year {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.hist-year__row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; cursor: pointer; user-select: none;
}
.hist-year__name { font-size: 14px; font-weight: 700; color: var(--ink); }
.hist-year__net { margin-left: auto; font-size: 14px; font-weight: 700; }
.hist-year__net.pos { color: #c62828; }
.hist-year__net.neg { color: #15803d; }
.hist-caret { font-size: 12px; color: var(--brand); transition: transform .2s ease; }
.hist-year.is-open .hist-caret { transform: rotate(180deg); }
.hist-year__detail { padding: 4px 12px 12px; border-top: 1px dashed var(--line); animation: fadeUp .24s ease both; }
.hist-year__sum {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 14px;
  font-size: 12px; color: var(--muted); padding: 8px 0; text-align: center;
}
.hist-year__sum b { color: var(--ink); font-weight: 700; }
.hist-months {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 4px;
}
.hist-month-card {
  display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 6px;
  padding: 10px 12px; border-radius: 10px; min-width: 0;
  background: var(--surface-2, #f1f5f9); border: 1px solid var(--line);
}
.hist-month-card.is-empty { opacity: .55; }
.hist-month-card.is-empty .hist-month-name,
.hist-month-card.is-empty .hist-month-net { color: var(--muted); }
.hist-month-name { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.hist-month-net { font-size: 14px; font-weight: 700; white-space: nowrap; }
.hist-month-net.pos { color: #c62828; }
.hist-month-net.neg { color: #15803d; }
.history__table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; font-size: 13px;
}
.history__table th, .history__table td { padding: 9px 12px; text-align: left; }
.history__table thead th {
  background: var(--brand-weak); color: var(--brand);
  font-weight: 700; font-size: 12px;
}
.history__table thead th:first-child { text-align: left; }
.history__table thead th:last-child { text-align: right; }
.history__table tbody td:last-child { text-align: right; font-weight: 700; }
.history__table tbody td.pos { color: #c62828; }
.history__table tbody td.neg { color: #15803d; }
.history__table tbody tr + tr td { border-top: 1px solid var(--line); }
.history__table tfoot td {
  background: var(--brand-weak); font-weight: 700;
  border-top: 2px solid var(--line);
}
.history__table tfoot td:first-child { text-align: left; color: var(--brand); }
.history__table tfoot td:last-child { text-align: right; }
.history__table tfoot td.pos { color: #c62828; }
.history__table tfoot td.neg { color: #15803d; }

/* 新增记录弹窗表单 */
.add-form { display: flex; flex-direction: column; gap: 12px; }
/* 卡片：标签在上、输入在下，内容居中 */
.add-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
  text-align: center;
}
.add-card__label { font-size: 12px; font-weight: 700; color: var(--muted); }
.add-card .login-box__input { text-align: center; }
.add-card #afDate { width: 100%; max-width: 168px; margin: 0 auto; }
.add-card select.login-box__input {
  appearance: none; -webkit-appearance: none;
  text-align: center; text-align-last: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 28px;
}
/* 每个板块：分区标题 + 推荐卡片 + 投注/收益/状态三卡片并排（均居中） */
.add-sec { display: flex; flex-direction: column; gap: 10px; }
.add-sec__title { font-size: 14px; font-weight: 800; color: var(--brand); text-align: left; padding-left: 10px; border-left: 4px solid var(--brand); line-height: 1.25; }
.add-card--rec .login-box__input { font-weight: 600; }
.add-cards-row { display: flex; gap: 10px; }
.add-cards-row .add-card { flex: 1 1 0; min-width: 0; }
.add-actions { display: flex; gap: 10px; margin-top: 2px; }
.add-actions .btn { flex: 1 1 0; }

/* 自定义日期大按钮：隐藏原生日期框，整块点击区覆盖唤起原生选择器 */
.add-date { display: flex; flex-direction: column; gap: 6px; text-align: center; }
.add-date__pick { position: relative; }
.add-date__btn {
  width: 100%; padding: 14px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, color .15s, transform .05s;
}
.add-date__btn.is-set { color: var(--brand); border-color: var(--brand); }
.add-date__btn:active { transform: translateY(1px); }
.add-date__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; margin: 0; cursor: pointer; }
/* 投注/收益/状态三卡片浅蓝底，层次清晰 */
.add-cards-row .add-card { background: var(--brand-weak); border-color: #dbe6ff; }

/* 弹窗入场动画 */
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.modal.is-open .modal__dialog { animation: modalIn .22s cubic-bezier(.22,.61,.36,1); }

/* 输入框聚焦蓝色描边 */
.login-box__input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-weak); outline: none; }

/* 主色按钮：清新现代的交互反馈 */
.btn--primary { transition: filter .15s, transform .05s; }
.btn--primary:hover { filter: brightness(1.06); }
.btn--primary:active { transform: translateY(1px); }
/* 新增行高亮（提交后即时反馈，随后自动回落到斑马纹） */
.grid tbody tr.row-new td { box-shadow: inset 0 0 0 2px var(--brand); }

/* 底部「图库」入口：与其他 tab 一致，左侧用品牌色描边区分入口 */
.tab--upload { border-left: 2px solid var(--brand); }
.tab--upload svg { color: var(--brand); }
.tab--upload span { color: var(--brand); }

/* 视觉隐藏（文件选择器：保留可被 JS 触发，不占据布局） */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 图库画廊 */
.gallery {
  display: block;
  margin-top: 4px;
}
.gallery__empty {
  text-align: center; color: var(--muted); font-size: 13px;
  margin: 18px 4px 10px; line-height: 1.5;
}
.gallery__hint {
  text-align: center; color: var(--muted); font-size: 11px;
  margin: 12px 4px 0; line-height: 1.5;
}
/* 按天分组：日期标题行（海蓝文字 + 分隔线；点击展开/收起当日缩略图） */
.gallery__day {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 2px 2px; padding-top: 4px;
  font-size: 13px; font-weight: 600; letter-spacing: .5px;
  cursor: pointer; user-select: none;
}
.gallery__day:first-child { margin-top: 2px; }
.gallery__day-label {
  color: #0f172a;
  font-weight: 800;
  white-space: nowrap;
}
.gallery__day-line {
  flex: 1 1 auto; height: 1px;
  background: linear-gradient(90deg, rgba(15,23,42,.18), rgba(15,23,42,.04));
}
.gallery__day-toggle { color: var(--muted); font-size: 12px; line-height: 1; }
/* 可折叠缩略图组（默认收起，点击日期行展开） */
.gallery__thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.gallery__thumbs[hidden] { display: none; }
/* 分组依据 + 操作提示条 */
.gallery__groupbar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 12px 2px 2px;
  font-size: 12px;
}
.gallery__groupbar-label { color: var(--muted); font-weight: 600; }
.gallery__groupbar-hint {
  color: var(--brand);
  background: var(--brand-weak);
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(34,211,238,.55);
}
.gallery__toggle {
  margin: 0; border: none; cursor: pointer; font-family: inherit;
  color: var(--brand); background: var(--brand-weak);
  border-radius: 8px; padding: 4px 9px; font-size: 11px; font-weight: 700;
  white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(34,211,238,.55);
}
.gallery__toggle[aria-pressed="true"] { background: var(--brand); color: #06222a; }
.thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  cursor: pointer;
}
.thumb__img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.thumb__del {
  position: absolute; top: 3px; right: 3px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: rgba(17,24,39,.62); color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer;
  padding: 0;
}
.thumb__del:hover { background: var(--miss); }
.thumb__del:active { transform: scale(.92); }
/* 缩略图时间角标：各自上传时分（左下角，海蓝背景，避免与右上角删除按钮冲突） */
.thumb__time {
  position: absolute; left: 4px; bottom: 4px;
  padding: 1px 5px; border-radius: 6px;
  background: rgba(34,211,238,.82); color: #022630;
  font-size: 10px; line-height: 1.4; letter-spacing: .3px;
  font-weight: 600;
  pointer-events: none;
}

/* 拍照 / 相册 选择按钮 */
.upload-actions {
  display: flex; gap: 10px; margin-top: 14px;
}
.upload-actions .btn { flex: 1 1 0; justify-content: center; }

/* 图库面板（整页画廊） */
.gallery--page { margin-top: 12px; }
.upload-actions--page { margin-top: 16px; }

/* 拖拽放置区：把图片拖到这里或点击批量选择，上传即自动同步。
   新功能：按需求暂时隐藏（display:none）；代码与拖拽/批量上传功能保留，后续可随时恢复。 */
.dropzone {
  margin: 14px 0 4px; padding: 22px 16px;
  display: none; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; cursor: pointer;
  border: 1.5px dashed rgba(34,211,238,.45); border-radius: 14px;
  background: rgba(34,211,238,.06); color: var(--brand, #22d3ee);
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.dropzone:hover { background: rgba(34,211,238,.10); }
.dropzone.is-dragover {
  border-color: var(--brand, #22d3ee); background: rgba(34,211,238,.16);
  transform: translateY(-1px); box-shadow: 0 8px 22px rgba(255,255,255,.7);
}
.dropzone__icon { font-size: 26px; line-height: 1; }
.dropzone__text { font-size: 13.5px; font-weight: 600; }
.dropzone__link { text-decoration: underline; text-underline-offset: 2px; }
.dropzone__hint { font-size: 11px; color: var(--muted, #8aa); }
.gallery__hint--top {
  text-align: center; color: var(--muted); font-size: 12px;
  margin: 14px 4px 0; line-height: 1.5;
}
/* 图库：默认只读（访客）；登录后（.can-manage）显示相册上传与删除 */
#btnCamera { display: none; } /* 本次仅保留相册上传，拍照入口始终隐藏 */
#tabGallery:not(.can-manage) .upload-actions--page,
#tabGallery:not(.can-manage) .thumb__del,
#tabGallery:not(.can-manage) .gallery__hint--top { display: none; }
#tabGallery.can-manage .upload-actions--page { display: flex; }
#tabGallery.can-manage .thumb__del { display: grid; }
#tabGallery.can-manage .gallery__hint--top { display: block; }

/* 图库：底部圆形「+」浮动按钮（点击打开相册选图） */
.gallery-fab {
  position: fixed; right: 16px; bottom: 92px; z-index: 60;
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2dd4ff, #0ea5b7);
  color: #04222b; border: none; cursor: pointer;
  box-shadow: 0 10px 26px rgba(255,255,255,.75);
}
.gallery-fab:hover { filter: brightness(1.06); }
.gallery-fab:active { transform: scale(.93); }
.gallery-fab svg { width: 26px; height: 26px; }
/* 访客（未登录）隐藏浮动按钮，与上传操作一致 */
#tabGallery:not(.can-manage) .gallery-fab { display: none; }

/* 图库网格底部圆角卡片（仅在有图片时显示，空态不渲染卡片） */
#tabGallery #gallery:not(:empty) {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 18px 18px;
  padding: 8px;
}

/* 大图灯箱 */
.lightbox { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 70; padding: 16px; }
.lightbox.is-open { display: flex; }
.lightbox__mask { position: absolute; inset: 0; background: rgba(0,0,0,.82); }
.lightbox__img {
  position: relative; max-width: 94vw; max-height: 86vh;
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.4);
  object-fit: contain;
}
.lightbox__close {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.16); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer; z-index: 1;
}
.lightbox__close:active { transform: scale(.92); }




@media (max-width: 560px) {
  .card__value { font-size: 18px; }
  .board-title { font-size: 16px; }
  .btn-label { display: none; }
  .summary { gap: 8px; }
  .card { padding: 11px 10px; }
}

/* 桌面 / 浏览器：主要字号随屏放大，手机（<768px）保持原样 */
@media (min-width: 768px) {
  .board-title { font-size: 16px; }
  .slogan-banner { font-size: 14px; line-height: 27px; height: 29px; }
  .card__label { font-size: 14px; }
  .card__value { font-size: 26px; }
  #recSummary .card__value { font-size: 22px; }
  #yearPicker .yp__val,
  #yearPicker .yp__arrow,
  #yearPicker .yp__sep { font-size: 22px; }
  .history__head { font-size: 15px; }
  .history__table { font-size: 15px; }
  .history__table thead th { font-size: 14px; }
  .analysis__title { font-size: 15px; }
  .analysis__list li { font-size: 15px; }
  .sync-note { font-size: 15px; }
  .note-input { font-size: 13px; }
  .tab { font-size: 13px; }
  .tab svg { width: 24px; height: 24px; }
  .add-sec__title { font-size: 16px; }
  .add-card__label { font-size: 14px; }
  .modal__title { font-size: 19px; }
  .login-box__input { font-size: 15px; }
  .mine__status { font-size: 14px; }
}

/* 记录页 + 汇总页历史表文字统一黑色 */
.grid, .grid *,
.history__table, .history__table * { color: #0f172a; }

/* 伪状态着色：推荐列文字随本行状态变红绿黄（命中=红、未中=绿、待定=黄）
   需覆盖上方「表格全黑」规则，故用高特异性选择器并置于其后 */
.grid td[data-key="combo"] textarea.reco-命中,
.grid td[data-key="goal"] textarea.reco-命中 { color: #dc2626; font-weight: 700; }
.grid td[data-key="combo"] textarea.reco-未中,
.grid td[data-key="goal"] textarea.reco-未中 { color: #16a34a; font-weight: 700; }
.grid td[data-key="combo"] textarea.reco-待定,
.grid td[data-key="goal"] textarea.reco-待定 { color: #ca8a04; font-weight: 700; }

[hidden] { display: none !important; }

/* ============ 图库页：可点击 3D 悬浮倾斜卡 ============ */
.card3d {
  margin: 14px 0 4px;
  perspective: 1000px;
  -webkit-perspective: 1000px;
  cursor: pointer;                 /* 可点击 */
  -webkit-tap-highlight-color: transparent;
}
.card3d__inner {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 14px 16px 16px;          /* 内容贴顶，整体左上对齐 */
  text-align: left;
  background:
    radial-gradient(120% 120% at 12% 8%, rgba(255,255,255,.95) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
  box-shadow:
    0 1px 3px rgba(15,23,42,.10),
    0 14px 30px rgba(99,102,241,.26);
  transform-style: preserve-3d;
  transform: rotateX(0deg) rotateY(0deg);
  transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s ease;
  will-change: transform;
}
/* 跟随指针的高光层（JS 更新 --mx/--my） */
.card3d__glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
  background: radial-gradient(
    220px 220px at var(--mx, 50%) var(--my, 50%),
    rgba(255,255,255,.42) 0%,
    rgba(255,255,255,.10) 40%,
    rgba(255,255,255,0) 70%
  );
}
.card3d.is-active .card3d__inner {
  transition: transform .08s linear, box-shadow .35s ease;
  box-shadow: 0 2px 6px rgba(15,23,42,.12), 0 22px 44px rgba(99,102,241,.32);
}
.card3d.is-active .card3d__glare { opacity: 1; }
.card3d:active .card3d__inner { transform: scale(.985) !important; }  /* 点击下压反馈 */
.card3d__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 50px; height: 50px;        /* 正方形 50×50 */
  margin: 0 0 9px;                  /* 靠左，不再水平居中 */
  background: transparent;          /* 位图自含背景，去掉之前的白色描边框 */
  box-shadow: none;
  transform: translateZ(28px);
}
.card3d__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;              /* 正方形位图完整显示，不裁切 */
  border-radius: 80px;              /* 50×50 下 >25px 即成正圆 */
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.20));   /* 阴影随尺寸调轻 */
}
.card3d__title {
  position: relative;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-shadow: 0 1px 3px rgba(79,70,229,.35);
  transform: translateZ(20px);
}
/* 卡片文案已移除：仅保留图标 + 标题「扫盘参考」 */

/* ============ 全屏空白新功能页（纯空白，仅左上角返回） ============ */
.blankpage {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg, #f4f6fb);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .32s cubic-bezier(.22,.61,.36,1), visibility .32s;
}
.blankpage.is-open {
  transform: translateX(0);
  visibility: visible;
}
.blankpage__back {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #4f46e5;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(15,23,42,.14);
  transition: transform .12s ease;
}
.blankpage__back:active { transform: scale(.92); }

/* ---------- 3D福彩页（独立模块） ---------- */
.blankpage { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fc3d {
  min-height: 100%;
  padding: max(64px, calc(env(safe-area-inset-top) + 60px)) 14px calc(24px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}
/* 顶部：主题日期（自动同步） */
.fc3d__head { text-align: center; margin-bottom: 16px; }
.fc3d__title {
  font-size: 13px; font-weight: 700;
  letter-spacing: .3px;                 /* 长标题收紧字距，避免挤出一行 */
  line-height: 1.5;
  color: var(--brand);
  margin: -1px 0 2px;                   /* 整体上移 1px，与月份卡间距 2px */
}
/* 月份选择区：一张卡（左右切换 + 回到本月） */
.fc3d__monthcard {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 20px rgba(99,102,241,.08);
}
.fc3d__nav {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  cursor: pointer;
}
.fc3d__nav:active { background: #f5f3ff; }
.fc3d__month {
  flex: 1;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink, #0f172a);
  font-variant-numeric: tabular-nums;
}
.fc3d__today {
  flex: none;
  padding: 6px 12px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.fc3d__today:disabled {
  background: transparent;
  border-color: var(--line);
  color: #94a3b8;
  cursor: default;
}

/* 三个统计卡 */
.fc3d__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.fstat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 20px rgba(99,102,241,.08);
}
.fstat__label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.fstat__value { font-size: 17px; font-weight: 800; color: var(--ink, #0f172a); }
.fstat__value.is-red { color: #dc2626; }
.fstat__value.is-green { color: #16a34a; }

/* 日期表格 */
.fc3d__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 20px rgba(99,102,241,.08);
}
.fc3d__tablewrap { overflow-x: auto; }
.fctable { width: 100%; border-collapse: collapse; font-size: 12px; }
.fctable col.fc-c-date { width: 52px; }
.fctable col.fc-c-num { width: 66px; }
.fctable col.fc-c-status { width: 56px; }
.fctable thead th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.fctable tbody td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--ink, #0f172a);
  vertical-align: middle;
}
.fctable tbody tr:last-child td { border-bottom: none; }
.fctable tbody tr { cursor: pointer; }
.fctable tbody tr:active { background: #f8fafc; }
/* 只读（未登录）：行不可点、无按压反馈 */
.fc3d.is-locked .fctable tbody tr { cursor: default; }
.fc3d.is-locked .fctable tbody tr:active { background: transparent; }
.fc-date { text-align: center; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.fc-num { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-num.is-red { color: #dc2626; font-weight: 700; }
.fc-num.is-green { color: #16a34a; font-weight: 700; }
.fc-reco { text-align: center; line-height: 1.45; word-break: break-all; }
.fc-status { text-align: center; }
.fcdash { color: #94a3b8; }
.fcbadge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.fcbadge.is-hit { background: #fee2e2; color: #dc2626; }
.fcbadge.is-miss { background: #dcfce7; color: #16a34a; }
.fcbadge.is-pending { background: #fef9c3; color: #ca8a04; }
.fc3d__empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* 右下角悬浮新建按钮（紫蓝渐变圆形） */
.fc3d__fab {
  position: fixed;               /* blankpage 带 transform，实际相对其定位；页面滚动时保持不动 */
  right: max(16px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 15;
  width: 54px; height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(99,102,241,.45);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease;
}
.fc3d__fab:active {
  transform: scale(.92);
  box-shadow: 0 3px 12px rgba(99,102,241,.40);
}

/* 新建 / 编辑浮层 */
.fcform {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15,23,42,.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s;
}
.fcform.is-open { opacity: 1; visibility: visible; }
.fcform__box {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(15,23,42,.28);
}
.fcform__title { font-size: 15px; font-weight: 800; margin-bottom: 12px; color: var(--ink, #0f172a); }
.fcform__row { display: block; margin-bottom: 10px; }
.fcform__row span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.fcform__row input,
.fcform__row select {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink, #0f172a);
  font-size: 15px;
  height: 44px;
}
.fcform__row input:focus,
.fcform__row select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.fcform__actions { display: flex; gap: 8px; margin-top: 14px; }
.fcbtn {
  flex: 1;
  padding: 10px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink, #0f172a);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.fcbtn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.fcbtn--danger { color: #dc2626; }
.fcbtn:active { opacity: .85; }




















