/* ============================================================
   屠鸭同舟 · Web 桌面端设计系统
   基准宽度 1280px，响应式断点 1100 / 1440
   ============================================================ */

:root {
  --brand: #0F6E56;
  --brand-dark: #085041;
  --brand-50: #E1F5EE;
  --brand-100: #C6EBDE;
  --accent: #534AB7;
  --accent-50: #EEEDFE;

  --skill-l: #378ADD;
  --skill-s: #D85A30;
  --skill-r: #1D9E75;
  --skill-w: #854F0B;

  --warn: #BA7517;
  --warn-50: #FAEEDA;
  --warn-text: #8A6A2B;      /* 琥珀底上的正文色，保证对比度 */
  --warn-strong: #7D5A1E;    /* 琥珀底上的强调字色 */
  --danger: #A32D2D;
  --danger-50: #FCEBEB;
  --info: #185FA5;
  --info-50: #E6F1FB;

  /* 日历热力图色阶（0 → 3 由浅到深），JS 与 CSS 共用同一套令牌 */
  --hm-0: #EFF3F0;
  --hm-1: #9FE1CB;
  --hm-2: #1D9E75;
  --hm-3: #0F6E56;
  /* 热力图格子的边长与间距。格子必须显式定尺寸（不能让它被隐式栅格摊满），
     否则格子会被摊开整张卡，中间空出上百像素。
     随视口平滑放大到 52px 上限：日历是这块区域的主体，
     格子太小会让整个模块被右侧图例主导（实测改造前 1440 时 日历:图例 = 30:70）。
     上限是刻意的——7 列 × 52px ≈ 400px，再大就会把卡片撑得过高，
     而本卡与右栏「通知偏好」同行，行高由较高的一张决定。 */
  --hm-cell: clamp(26px, 3vw, 52px);
  --hm-gap: 6px;
  --track: #EFF3F0;          /* 进度条 / 占位底 */

  --bg: #F4F6F4;
  --surface: #FFFFFF;
  --surface-2: #F7F9F7;
  --text: #26302B;
  /* 辅助文字的两级灰。取色标准是「在 --bg 上也过 AA 4.5:1」，
     因为小字号说明文字经常直接压在页底而不是白卡上。
     旧值 #6B7A72 / #8A968E 在页底只有 4.16 / 3.07，11~12px 时不可读。 */
  --muted: #5A665F;          /* 次要正文，页底 5.52 / 白底 6.00 */
  --faint: #66726A;          /* 说明与时间戳，页底 4.63 / 白底 5.02 */
  --border: rgba(15,110,86,.13);
  --border-soft: rgba(15,110,86,.08);
  --shadow: 0 1px 2px rgba(15,60,45,.04), 0 8px 24px rgba(15,60,45,.05);
  --shadow-lg: 0 12px 40px rgba(15,60,45,.13);
  /* 深色底上的次级白字。
     别再用 opacity 逐个调暗：#085041 上 white@.45 只有 3.22:1、
     @.55 是 4.02:1，11~13px 时都读不清，而且每个元素一个值必然漂移。
     统一取 .72（5.72:1），需要更弱的层级用 .6 但仅限 ≥14px。 */
  --on-dark: rgba(255,255,255,.92);
  --on-dark-soft: rgba(255,255,255,.72);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 8px;
  --sidebar-w: 236px;
  /* 间距阶梯。所有块级间距从这里取，不再各页写内联 margin。
     gap    = 内容区里「块与块」之间的标准间距
     gap-sm = 卡片内部元素之间
     曾经的问题：.card + .card 只管相邻卡片，.card 后面跟 .grid 时
     间距是 0（挑战营的引导卡与营卡网格贴死）。改成 .content > * + *
     统一处理，与后面跟的是什么类型无关。 */
  --gap: 16px;
  --gap-sm: 12px;
  --gap-lg: 24px;
  /* 卡片内部滚动上限：超过则卡内滚动，不把整页拉长 */
  /* 卡片内滚动上限：按视口高度扣掉固定 chrome 估算，而非固定比例。
     用固定 vh 比例的问题见 .list-scroll 处说明。
     下限 280 防止矮窗口压成一条缝，上限 820 防止超高屏无限拉长。 */
  --card-scroll-max: clamp(280px, calc(100dvh - 360px), 820px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: var(--brand); text-decoration: none; }

/* ---------- 应用外壳 ---------- */
.app { display: flex; min-height: 100vh; }

/* 侧边导航 */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px 16px;
}
.sidebar .logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 4px; }
.sidebar .logo .mark {
  width: 34px; height: 34px; border-radius: 10px; background: #fff;
  color: var(--brand-dark); font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar .logo .name { font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.sidebar .logo .slogan { font-size: 11px; color: var(--on-dark-soft); letter-spacing: .3px; }
.sidebar .nav { margin-top: 26px; flex: 1; }
/* 导航项扁平排列，不再有「学习 / 社区 / 数据 / 账户」分组标题。
   原先组间节奏靠 .nav-group 的上下外边距撑开（18px + 6px），
   标题删掉后这段节奏没了来源，因此把项间距从 3px 提到 6px，
   让 6 项平铺后仍留呼吸感，而不是挤成一坨。
   （分组标题在窄屏收图标条时本就不可见，常规宽度下也只是重复信息：
   每个导航项自己的中文名已经说明它是什么。） */
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 9px; margin-bottom: 6px;
  color: var(--on-dark); font-size: 14px; cursor: pointer;
  border: none; background: none; width: 100%; text-align: left;
  transition: background .14s, color .14s;
}
.nav-item .ic { font-size: 16px; width: 20px; text-align: center; }
.nav-item .badge-dot {
  margin-left: auto; background: #D85A30; color: #fff; font-size: 10px;
  border-radius: 999px; padding: 1px 7px; font-weight: 600;
}
.nav-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.on { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.sidebar .user-mini {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border-radius: 10px; background: rgba(255,255,255,.09); margin-top: 8px;
}
.sidebar .user-mini .ava {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0;
}
.sidebar .user-mini .nm { font-size: 13px; font-weight: 600; }
.sidebar .user-mini .sub { font-size: 11px; color: var(--on-dark-soft); }

/* 主区 */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  min-height: 62px; background: var(--surface); border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 16px; padding: 10px 28px;
  position: sticky; top: 0; z-index: 20; flex-wrap: wrap;
}
.topbar h1 { font-size: 20px; font-weight: 600; color: var(--brand-dark); letter-spacing: -.2px; }
.topbar .crumb { font-size: 12px; color: var(--faint); }
.topbar .spacer { flex: 1; }
/* 统计胶囊：宽度不够时自己换行，绝不把右侧内容顶出视口
   （360px 窄屏下「⭐ 本周 185 分」曾整颗被挤出屏幕，引发全局横向滚动） */
.topbar .tb-stat {
  display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--border-soft);
  padding: 6px 13px; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.topbar .tb-stat b { color: var(--brand-dark); font-weight: 600; }

/* 内容区。上内边距要明显大于左右——顶栏是 sticky 的，内容贴着它滚动时
   几乎没有呼吸感（实测 topbar 底到第一张卡顶只有 24px，视觉上像贴住）。
   padding-top 28 + 首块自身无外边距，最终读数约 28px。 */
.content { padding: 28px 28px 72px; max-width: 1440px; width: 100%; min-width: 0; }

/* 块级间距统一入口：内容区里任意相邻两块都吃这个间距，
   不管它们是 .card、.grid 还是别的容器。
   旧写法 `.card + .card` 的漏洞：.card 紧跟 .grid 时（挑战营引导卡 → 营卡网格）
   间距为 0，两块贴死。 */
.content > * + * { margin-top: var(--gap); }
/* 容器本身就是栅格/多栏时，交给它自己的 gap，别叠加 */
.content > .stat-row + *,
.content > .grid + * { margin-top: var(--gap); }

/* ---------- 通用组件 ---------- */

/* 卡片。语义变体用 class 而不是内联 style，保证跨页同款同貌。
   .card.warn  琥珀提示卡（冷却中 / 待补佐证等）
   .card.danger 危险操作区 */
.card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow);
  min-width: 0;
}
/* 纵向堆叠的卡片之间统一间距。注意栅格/多栏容器内已由 gap 处理，
   这里必须排除，否则同排第二张卡会整体下沉（camp 四张营卡曾错位 16px）。 */
.stack > .card + .card,
.content > .card + .card { margin-top: var(--gap); }
.grid > .card + .card,
.rank-grid > .card + .card,
.layout-main > .card + .card,
.layout-2-1 > .card + .card,
.me-col > .card + .card { margin-top: 0; }

/* 卡片内部独立滚动：内容超长时在卡内滚，不把整页越拉越长。
   配合 .card-scroll 使用；标题留在卡头不参与滚动，滚动条只出现在内容区。
   注意 overflow 生效前提是高度受限，所以这里同时给出上限。 */
.card-scroll {
  overflow-y: auto; max-height: var(--card-scroll-max);
  overscroll-behavior: contain;   /* 滚到底不把页面一起带着滚 */
  padding-right: 6px;             /* 给滚动条留位，避免压住内容 */
}
.card-scroll::-webkit-scrollbar { width: 8px; }
.card-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.card-scroll::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.card-scroll::-webkit-scrollbar-track { background: transparent; }
/* 营卡：同排等高的同时把按钮压到底，避免文案长短不同时按钮上下错落 */
.camp-card { display: flex; flex-direction: column; }
.camp-card .camp-desc {
  margin: 0 0 6px; font-size: 13px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.camp-card .btn { margin-top: auto; }
/* 营卡三项指标：横排紧凑，替代原来三行「标签极左 / 值极右」的键值行 */
.camp-meta {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  padding: 12px 0; margin-bottom: 14px;
  border-top: 1px dashed var(--border-soft); border-bottom: 1px dashed var(--border-soft);
}
.camp-meta .k { display: block; font-size: 12px; color: var(--muted); margin-bottom: 1px; }
.camp-meta .v {
  display: block; font-size: 14px; font-weight: 600; color: var(--brand-dark);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
/* 营内详情里的「参与规则」块。
   发起人写的规则是营的核心约定（打卡频次、违规后果等），
   必须与结算规则区分开、有独立视觉边界，否则会被当成又一行元信息跳过。 */
.rules-box {
  background: var(--brand-50); border-radius: var(--radius);
  padding: 12px 14px; margin-top: 14px;
}
.rules-box .rules-title {
  font-size: 12px; font-weight: 600; color: var(--brand);
  margin-bottom: 5px; letter-spacing: .3px;
}
.rules-box .rules-body {
  font-size: 13px; color: var(--text); line-height: 1.7; white-space: pre-wrap;
}
.card.warn { border-color: var(--warn); background: var(--warn-50); box-shadow: none; }
.card.warn .card-head h2 { color: var(--warn-strong); }
/* 危险操作卡：用浅红底 + 红边收边，与常规白色设置卡一眼区分。
   此前「删除账号」是一张无标题的白卡里放一个红按钮，
   既没有说明它属于什么，也和普通卡片长得一样。 */
.card.danger { border-color: rgba(163,45,45,.28); background: #FCF6F6; box-shadow: none; }
.card.danger .card-head h2 { color: var(--danger); }
.card.danger .kv .k { color: var(--danger); opacity: .78; }
.card.danger .inline-note { background: rgba(163,45,45,.05); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; font-weight: 600; color: var(--brand-dark); }
/* 需要略大标题时用 .h-lg，而不是到处写 style="font-size:18px" */
.card-head h2.h-lg, .h-lg { font-size: 18px; }
.card-head .sub { font-size: 12px; color: var(--faint); }
.card-head .spacer { flex: 1; }

/* 琥珀底上的文字：统一取色与字重，避免各页各写一个接近却不相同的棕褐色 */
.on-warn { color: var(--warn-text); }
.on-warn b, .on-warn strong { color: var(--warn-strong); }

/* 网格轨道一律 minmax(0,1fr)：纯 1fr 的轨道有 min-content 下限，
   窄屏时子元素不肯收缩，会把卡片撑破视口（rank 页曾因此横向溢出 138px）。 */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* .layout-main：打卡页的「主操作 + 侧栏」两栏。
   两栏底部齐平：让两栏内部都用纵向 flex，最后一张卡 flex:1 吃掉余量。
   此前两栏各按内容自然高度排（678 vs 634），底部差 44px，
   视觉上右侧像「少了一块」。
   ⚠️ 卡内 gap 必须显式声明：卡片被包进 flex 列后，不再是 .layout-main 的
   直接子级，`.card + .card` 那条间距规则匹配不到，两栏内部会出现 0 间距
   （实测卡0 底=673、卡1 顶=673，两张卡贴死）。
   注：flex:1 只影响卡片外框高度，卡内内容仍从顶部排起，不会变形。 */
.layout-main {
  display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: var(--gap); align-items: stretch;
}
.layout-main > div {
  display: flex; flex-direction: column; gap: var(--gap); min-width: 0;
}
.layout-main > div > .card:last-child { flex: 1; }
.layout-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
/* 「我的」页
   ------------------------------------------------------------
   两栏必须用「共享行」的栅格，不能用两个独立的 flex 列：
   独立列各自排布，首行差多少，后面每一行就错开多少。
   实测首行 194 vs 122 → 第 2 行卡片顶边差 72px，整页看起来都在错位。
   grid-auto-flow: column + 固定 4 行：前 4 张进左栏、后 4 张进右栏，
   行高取两侧较高者，因此每行的顶边与底边都自然对齐。
   单列（窄屏）切回 row 流，按 DOM 顺序依次排，阅读顺序更自然。

   ⚠️ 不要给本容器单独设 max-width 断点（这里踩过坑）：
   它曾有自己的 1280 / 1120 两档上限，与全站 .content 的断点阶梯（1560 /
   1760 / 2000 / 2160）脱节。实测 1920 宽时内容区已有 1669px，而本页
   仍锁在 1280px，**只占 79%、右侧空出 333px**；2560 宽时空 504px。
   同屏下其他页面此时都已铺满（88%+），唯独「我的」页看起来"没做适配"。
   现在改为**跟随父容器宽度**（不设 max-width），宽度策略统一由 .content
   的断点阶梯决定，以后调整内容区宽度无需再改这里。 */
.me-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  gap: var(--gap);
  align-items: stretch;
}
/* 栅格子卡之间已有 gap，不能再吃 .card + .card 的纵向边距 */
.me-cols > .card + .card { margin-top: 0; }
/* 窄屏：单列。这里只切「流向」，宽度仍跟随 .content —— 不另设 max-width。
   阈值定在 1400 而不是 1240：两栏时左栏又要放统计卡行（4 张并排），
   实测 1280 宽下统计卡只剩 122px，「未设置」被截断成「未…」；
   1400 以上两栏时单卡宽 ≥127px 才勉强可读，故 1400 作为切换点。
   （这与改前的切换点一致——本次修复的是宽度上限，不是切换点。） */
@media (max-width: 1400px) {
  .me-cols {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-flow: row;
  }
}
/* 「我的」页里的操作按钮成对并排，不再各占一行。
   原来两个 block 按钮竖着叠，一张卡里堆了三条满宽按钮，
   与卡片本身的宽度形成大片色块，看起来最"乱"。 */
.me-actions { display: flex; gap: 10px; margin-top: 14px; }
.me-actions .btn { flex: 1; }
/* 排行榜：左侧「小组榜」（本营内成员排名）+ 右侧「营地榜」（跨营地人均积分）并排两块。
   右侧要放 8~10 字的营名，需 340px 以上。
   两栏等高：栅格拉伸（stretch）让两张卡等高，卡内列表区 flex 撑满并独立滚动。
   这样「人多的榜单」不会把卡撑长，也不会在页面里留出大块空白。 */
.rank-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, 1fr); gap: var(--gap); align-items: stretch; }
.rank-col { display: flex; flex-direction: column; min-width: 0; }
.rank-col > .card { flex: 1; display: flex; flex-direction: column; }
/* 榜单列表：撑满剩余空间并在卡内滚动。min-height 保证只有 1~2 条时
   列表区仍有合理体积，不会塌成一条缝。
   ⚠️ 内容一律**顶部对齐**：行从列表顶端依次排列，剩余空间留在底部。
   曾用 ::before/::after 的 margin:auto 让短列表在剩余空间里垂直居中，
   视觉上「空白平均分到上下」看着更松弛，但代价是：
     - 第一行与列表顶边之间出现一段说不清来由的空隙；
     - 列表项数变化时整体上下浮动，失去稳定的阅读起点；
     - 与站内其它模块（顶部对齐）不一致。
   按「内容默认顶对齐」的统一口径移除居中，空白只留在末尾。 */
/* 榜单列表：内容按上到下自然排列。
   ⚠️ 两条都不要用：
   1. flex:1（撑满剩余空间）—— 会把后续兄弟（「我的名次」条、说明块）
      推到卡片底部，中间空出一大段；
   2. min-height 保底 —— 列表只有 1 行时会在列表内空出大段空白，
      把「成员行」与「我的名次」隔开。
   两者都会让内容看起来被拆成几截，违背「从上到下依次展示」。
   剩余空间统一留在卡片末尾（由 .rank-grid 的 stretch 决定卡片外框高度，
   不会在卡片内部制造空隙）。列表过长仍可卡内滚动。 */
.rank-list {
  overflow-y: auto; overscroll-behavior: contain; padding-right: 6px;
  display: flex; flex-direction: column;
  align-items: stretch;
}
.rank-list > * { flex: none; }
.rank-list:empty::after {
  content: '暂无排名数据'; display: block; text-align: center;
  color: var(--faint); font-size: 13px; padding: 46px 0;
}
/* 单列（窄屏）：两个榜单上下排列，此时不该再「等高」——
   强行等高反而会让上面那张卡底部空出一大块。恢复自然高度。
   注意：媒体查询必须写在对应的基础规则**之后**，否则同优先级下
   基础规则会反过来覆盖它（这里曾写反，导致窄屏取消等高的规则失效）。 */
@media (max-width: 1240px) {
  .rank-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .rank-col > .card { flex: none; }
}
/* 我的本周战绩：补在小组榜下方，既填掉「只有一两行」留下的空档，
   也把「我和榜首差多少」这个最常看的信息直接摆出来。 */
.mine-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin-top: var(--gap-sm);
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 12px 14px;
}
.mine-strip .k { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.mine-strip .v {
  display: block; font-size: 15px; font-weight: 600; color: var(--brand-dark);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.mine-strip .v.hl { color: var(--brand); }
@media (max-width: 640px) { .mine-strip { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
/* 卡片内滚动区域的滚动条：细、低对比，不抢主体内容 */
.card-scroll::-webkit-scrollbar, .rank-list::-webkit-scrollbar { width: 8px; }
.card-scroll::-webkit-scrollbar-thumb, .rank-list::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 4px;
}
.card-scroll::-webkit-scrollbar-thumb:hover, .rank-list::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.card-scroll::-webkit-scrollbar-track, .rank-list::-webkit-scrollbar-track { background: transparent; }
/* 长列表的滚动区（积分明细的 14 天、营内动态、通知中心等）。
   ⚠️ 不要用固定 vh 比例（如 52vh）限高：
       - 1080 高时 52vh = 562px，而内容有 2724px，占用率 485%；
        同时页面底部还空着 194px —— 一边把内容挤进小窗口，一边浪费视口。
       - 比例不随「顶栏 + 内边距」的实际占用变化，窗口越矮浪费越明显。
   这里改为「按视口高度扣掉固定 chrome（顶栏 74 + 上下内边距/间距约 260）」
   计算可用高度，再用 clamp 兜住极端值：
       - 下限 300px：窗口很矮时滚动区不至于压成一条缝；
       - 上限 900px：超高的显示器不必无限拉长（内容本身也就 2724px）。 */
.list-scroll {
  max-height: clamp(300px, calc(100dvh - 334px), 900px);
  overflow-y: auto;
  overscroll-behavior: contain; padding-right: 6px;
}
/* 明细里的卡片已经是「卡中卡」，滚动区里再给底部间距会把最后一天顶得过高 */
.day-list > .card:last-child { margin-top: 0; }
.day-list .day-card + .day-card { margin-top: var(--gap-sm); }
.rank-card > .inline-note { margin-top: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 18px;
  font-size: 14px; font-weight: 500; background: var(--brand); color: #fff;
  transition: filter .14s, background .14s;
}
.btn:hover { filter: brightness(1.07); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: #fff; color: var(--brand); border-color: var(--border); }
.btn.ghost:hover { background: var(--brand-50); }
.btn.warn { background: var(--danger); }
.btn.purple { background: var(--accent); }
.btn.sm { padding: 5px 13px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.link { background: none; color: var(--brand); padding: 4px 6px; }
/* link 变体必须显式压掉 .btn.danger 的实心底：
   两者特异性相同（.btn.link / .btn.danger），谁写在后面谁赢，
   而「danger 实心红底」写在后面 → 红字压红底，按钮变成一块没有文字的红色胶囊。
   用 .btn.link.danger 三个类的特异性把它钉住。 */
.btn.link.danger { background: none; color: var(--danger); }
.btn.link.danger:hover { background: var(--danger-50); filter: none; }
.btn.link.muted { color: var(--muted); }

/* 危险操作按钮：只换色不改尺寸，避免同款按钮在不同页面大小不一 */
.btn.warn, .btn.danger { background: var(--danger); }

/* 次要但负向的操作（退出 / 解散）：保留 ghost 的低调外形，
   只把文字与描边换成危险色。破坏性确认仍用 .btn.danger 实心红，
   两者形成「这是坏事 → 但你还要再确认一次」的层级。 */
.btn.ghost.danger {
  background: #fff; color: var(--danger); border-color: rgba(163,45,45,.35);
}
.btn.ghost.danger:hover { background: #FCF6F6; filter: none; }

/* 标签语义收敛成三档：
     .ok     正向 / 正常（品牌绿）
     .info   中性状态（灰），如「进行中」「站长专栏」
     .must   缺失或需处理（红），如「未提交」
     .pend / .should  待处理（琥珀，文字取 warn-strong 才够对比度）
   旧版把「今日开营」这类正向状态涂成了红色，读者会先读成警告。 */
/* 基类自带中性底：不带变体的 .tag（如「未打卡」）也应有可见的胶囊形状，
   而不是变成一段裸文字。 */
.tag { display: inline-block; font-size: 11px; border-radius: 999px; padding: 2px 10px; font-weight: 500; background: #EFF3F0; color: var(--muted); }
.tag.must { background: var(--danger-50); color: var(--danger); }
.tag.should { background: var(--warn-50); color: var(--warn-strong); }
.tag.info { background: #EFF3F0; color: var(--muted); }
.tag.ok { background: var(--brand-50); color: var(--brand); }
.tag.pend { background: var(--warn-50); color: var(--warn-strong); }
.tag.lock { background: #EFF3F0; color: var(--muted); }

.pill { font-size: 12px; border-radius: 999px; padding: 2px 11px; font-weight: 500; }
.pill.ok { background: var(--brand-50); color: var(--brand); }
.pill.no { background: var(--danger-50); color: var(--danger); }
.pill.pend { background: var(--warn-50); color: var(--warn-strong); }

.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; flex-shrink: 0;
}
.avatar.me { background: var(--accent); }
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.avatar.lg { width: 54px; height: 54px; font-size: 21px; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
/* 必填星号：只标红一个字符，不改变标签本身的颜色层级 */
.field > label .req { color: var(--danger); margin-left: 1px; }
.field input[type=text], .field input[type=number], .field input[type=date],
.field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; font-size: 14px; background: #fff; color: var(--text);
  transition: border-color .14s, box-shadow .14s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,110,86,.1);
}
.field textarea { resize: vertical; min-height: 84px; }
.field .hint { font-size: 12px; color: var(--faint); margin-top: 5px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* 统计块
   ------------------------------------------------------------
   对齐契约（勿破坏）：`.n` 的 line-height / min-height 固定为 30px，
   这样无论数值多长、是否降档字号，行盒高度都不变，
   下面的 `.l` 标签才能在每一张统计卡上落在同一个 y 上。
   曾经的血泪：camp 页用内联 font-size 缩小超长数值（17px），
   行高随之从 30px 塌到 20px，把「当前进度」标签整体上提了 10px，
   四个标签里就它一个不齐。 */
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
/* 底色规则（一次说清，别再各页各挑）：
     .stat            默认 = 白底 + 细边，用于「陪衬指标」
     .stat.primary    品牌绿浅底，**每页最多一张**，放该页的主角数字
     .stat.pending    琥珀底，专表「待设置 / 待处理」这类需要动作的状态
   旧版有三种底色（brand-50 / accent-50 / surface-2）且按页面随机分配，
   一屏四格像两套组件；surface-2 铺在页底上分离度只有 1.03:1，
   连边框都没有，看起来像「没做样式」。 */
.stat {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 14px 16px;
  min-width: 0;
}
.stat .n {
  font-size: 26px; font-weight: 600; color: var(--text);
  line-height: 30px; min-height: 30px; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat .n.dense { font-size: 17px; letter-spacing: -.2px; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.primary { background: var(--brand-50); border-color: transparent; }
.stat.primary .n { color: var(--brand); }
.stat.pending { background: var(--warn-50); border-color: transparent; }
.stat.pending .n { color: var(--warn-strong); font-size: 20px; }
.stat.plain { background: var(--surface); }

/* 技能块 */
.skill-card { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.skill-head {
  display: flex; align-items: center; gap: 11px; padding: 13px 16px;
  cursor: pointer; user-select: none; background: var(--surface-2);
  transition: background .14s;
}
.skill-head:hover { background: var(--brand-50); }
.skill-head .dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.skill-head .nm { font-weight: 600; font-size: 14px; }
.skill-head .meta { flex: 1; text-align: right; font-size: 12px; color: var(--faint); }
.skill-head .chev { color: var(--faint); font-size: 12px; transition: transform .18s; }
.skill-card.open .skill-head .chev { transform: rotate(90deg); }
.skill-body { padding: 16px; display: none; border-top: 1px solid var(--border-soft); }
.skill-card.open .skill-body { display: block; }

.proof-zone {
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); padding: 13px 15px; margin-top: 4px;
}
.proof-zone .pz-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.proof-zone .pz-head .t { font-size: 13px; font-weight: 600; color: var(--brand-dark); }
.proof-zone .pz-head .spacer { flex: 1; }
.proof-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.proof-done {
  display: flex; align-items: center; gap: 10px;
  background: var(--brand-50); border-radius: 8px; padding: 9px 13px; font-size: 13px;
}
.proof-done .thumb {
  width: 40px; height: 40px; border-radius: 7px; object-fit: cover;
  border: 1px solid var(--border); background: #fff;
}
.countdown-bar {
  display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--warn);
  background: var(--warn-50); border-radius: 8px; padding: 8px 12px; margin-bottom: 12px;
}
.countdown-bar b { font-variant-numeric: tabular-nums; font-weight: 600; }

/* 录音规格条：把「时长/格式/体积/重录」一次性说清楚，省得用户猜 */
.rec-spec {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px;
}
.rec-spec-item {
  font-size: 12px; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: 999px; padding: 4px 12px;
}
.rec-spec-item b { color: var(--brand-dark); }

/* 佐证预览弹窗 */
.pv-block { margin-top: 14px; }
.pv-label { font-size: 13px; font-weight: 600; color: var(--brand-dark); margin-bottom: 4px; }
.pv-imgs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.pv-imgs img {
  width: 128px; height: 128px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--border); background: #fff; cursor: zoom-in; transition: transform .12s;
}
.pv-imgs img:hover { transform: scale(1.03); }
.pv-text {
  margin-top: 8px; max-height: 300px; overflow-y: auto; white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px;
  padding: 13px 15px; font-size: 13.5px; line-height: 1.7; color: var(--text);
}
/* 图片大图预览 */
.lightbox {
  position: fixed; inset: 0; z-index: 9999; background: rgba(10,20,16,.86);
  display: flex; align-items: center; justify-content: center; padding: 28px; cursor: zoom-out;
}
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 10px; box-shadow: 0 12px 48px rgba(0,0,0,.5); }

/* 进度条 */
.bar-row { display: flex; align-items: center; gap: 11px; margin-bottom: 9px; font-size: 13px; }
.bar-row .bl { width: 46px; color: var(--muted); flex-shrink: 0; }
.bar-track { flex: 1; height: 13px; background: #EFF3F0; border-radius: 7px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 7px; transition: width .4s ease; }
.bar-row .bv { width: 82px; text-align: right; color: var(--brand-dark); font-variant-numeric: tabular-nums; }

/* 榜单 */
.rank-row {
  display: flex; align-items: center; gap: 13px; padding: 11px 12px;
  border-radius: 10px; transition: background .14s;
}
.rank-row + .rank-row { margin-top: 2px; }
.rank-row:hover { background: var(--surface-2); }
.rank-row.me { background: var(--brand-50); }
.rank-row .no {
  width: 26px; text-align: center; font-weight: 600; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.rank-row.top .no { color: #D85A30; }
.rank-row .nm { flex: 1; min-width: 0; font-size: 14px; display: flex; align-items: center; gap: 8px; }
/* 营名较长，窄侧栏下会被压成每行一个字，必须单行截断 */
.rank-row .nm .nm-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .nm .tag, .rank-row .nm .faint { flex: none; white-space: nowrap; }
.rank-row .v { font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; }
.rank-row .medal { font-size: 15px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 999px; padding: 3px; }
.seg button {
  border: none; background: none; padding: 6px 17px; border-radius: 999px;
  font-size: 13px; color: var(--muted); transition: all .14s;
}
.seg button.on { background: var(--brand); color: #fff; font-weight: 600; }

/* 成员 / 动态 */
.member-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.member-row:last-child { border-bottom: none; }
.member-row .info { flex: 1; min-width: 0; }
.member-row .info .nm { font-size: 14px; font-weight: 500; }
.member-row .info .sub { font-size: 12px; color: var(--faint); }
.member-row.blocked { background: #FAFAFA; }

.post { display: flex; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--border-soft); }
.post:last-child { border-bottom: none; }
.post .body { flex: 1; min-width: 0; }
.post .pname { font-weight: 600; font-size: 14px; }
.post .ptime { font-size: 12px; color: var(--faint); margin-left: 8px; font-weight: 400; }
.post .ptext { font-size: 14px; margin-top: 3px; }
.post .pmeta { font-size: 12px; color: var(--faint); margin-top: 7px; display: flex; gap: 14px; flex-wrap: wrap; }
.post .pacts { margin-top: 9px; display: flex; gap: 9px; flex-wrap: wrap; }
.act-btn {
  font-size: 12.5px; border: 1px solid var(--border); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 4px 13px; transition: all .14s;
}
.act-btn:hover { border-color: var(--brand); color: var(--brand); }
.act-btn.done { background: var(--brand-50); border-color: var(--brand); color: var(--brand); font-weight: 500; }
.act-btn.fire:hover { border-color: var(--skill-s); color: var(--skill-s); }
.act-btn.fire.done { background: #FAECE7; border-color: var(--skill-s); color: var(--skill-s); }

.comment-list { margin-top: 11px; padding-left: 46px; }
.comment { display: flex; gap: 9px; padding: 8px 0; }
.comment .cb { font-size: 13px; }
.comment .cn { font-weight: 600; }
.comment .ct { color: var(--faint); font-size: 11px; margin-left: 7px; }
.comment-input { display: flex; gap: 9px; margin-top: 11px; padding-left: 46px; }
.comment-input input {
  flex: 1; border: 1px solid var(--border); border-radius: 999px; padding: 8px 15px; font-size: 13px;
}
.comment-input input:focus { outline: none; border-color: var(--brand); }

/* ============================================================
   经验分享（站长个人发布，非 UGC）
   ------------------------------------------------------------
   与 .post（营内动态）刻意解耦：那边是「动态流 + 互动按钮」，
   这边是「文章列表 + 详情阅读」。两套类名互不共享，改一边不会波及另一边。
   ============================================================ */

/* ---------- 列表卡片 ---------- */
/* 列表用 auto-fill 栅格：列数由可用宽度自动决定，不写死断点。
   窄屏 1 列、宽屏 2~3 列，卡片宽度保持在可读区间内（约 380~560px）。
   旧版是单列 + margin-bottom，宽屏下列少、页面被拉得很长且底部留白大。 */
#art-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 12px;
  align-items: start;
}
/* 窄屏（<820）退回单列：380px 的最小列宽放不下就自动变一列，
   但显式兜底一次，避免极窄视口下出现横向溢出。 */
@media (max-width: 820px) {
  #art-list { grid-template-columns: minmax(0, 1fr); }
}
.art-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s, transform .15s;
  min-width: 0;
}
.art-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.art-cover {
  width: 104px; height: 78px; flex: none; border-radius: var(--radius);
  overflow: hidden; background: var(--brand-50);
}
.art-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-cover-empty {
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.art-body { flex: 1; min-width: 0; }
.art-title {
  font-size: 15px; font-weight: 600; color: var(--brand-dark);
  margin-bottom: 6px; line-height: 1.45;
}
.art-summary {
  font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.art-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.art-meta .spacer { flex: 1; }

/* ---------- 详情 ---------- */
.art-detail-title {
  font-size: 21px; font-weight: 600; color: var(--brand-dark);
  line-height: 1.4; margin-bottom: 8px;
}
.art-detail-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.art-detail-images { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.art-detail-images img {
  max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); display: block;
}
.art-detail-body {
  margin-top: 14px; font-size: 15px; line-height: 1.85; color: var(--text);
}
.art-detail-body p { margin: 0 0 14px; }
.art-detail-body p:last-child { margin-bottom: 0; }

/* ---------- 站长管理面板 ---------- */
.adm-list { max-height: 52vh; overflow-y: auto; margin: 6px -4px 4px; }
.adm-row {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 6px; border-bottom: 1px solid var(--border-soft);
}
.adm-row:last-child { border-bottom: none; }
.adm-ord { display: flex; flex-direction: column; gap: 2px; flex: none; }
.ord-btn {
  width: 22px; height: 18px; line-height: 1; font-size: 9px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 5px; background: var(--surface);
  color: var(--muted); padding: 0;
}
.ord-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.ord-btn:disabled { opacity: .35; cursor: default; }
.adm-info { flex: 1; min-width: 0; }
.adm-title {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.adm-acts { display: flex; gap: 4px; flex-wrap: wrap; flex: none; }

/* ---------- 编辑器缩略图 ---------- */
.ed-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ed-thumb { position: relative; width: 84px; }
.ed-thumb img {
  width: 84px; height: 84px; object-fit: cover;
  border-radius: var(--radius-sm); border: 1px solid var(--border); display: block;
}
.ed-thumb button {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  border-radius: 50%; border: none; background: rgba(0,0,0,.55); color: #fff;
  cursor: pointer; font-size: 12px; line-height: 1; padding: 0;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 640px) {
  .art-card { flex-direction: column; gap: 10px; }
  .art-cover, .art-cover-empty { width: 100%; height: 150px; }
  .art-detail-title { font-size: 18px; }
  .adm-row { flex-wrap: wrap; row-gap: 6px; }
  .adm-acts { width: 100%; justify-content: flex-end; }
}

/* 日历热力图
   ------------------------------------------------------------
   7 列 × 5 行（近 35 天）的方格阵 + 右侧图例。
   方向是刻意选的：日历这块区域的主体应当是格子本身。
   原先用 5 列 × 7 行（每周一列），格子只能定格在 154px 宽，
   而 .heatmap-wrap 把剩余宽度全给了图例——实测
   1440 时 日历:图例 = 30:70，2560 时 15:85，图例反客为主。
   转置成 7 列 × 5 行后，同样 35 天，但横向天然更宽（7 格）、
   纵向更矮（5 格），正好与「左侧主体 + 右侧窄图例」相配。 */
.heatmap-wrap {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 28px; align-items: start;   /* 顶对齐：日历与图例都从顶部排起 */
}
/* 热力图：必须显式声明列宽，否则隐式栅格会把格子摊满整张卡——
   实测列宽被算成 104.6px、格子只有 22px，中间空出 80px，
   看起来就是「格子散架了」。这里由 --hm-cell 统一约束。 */
.heatmap {
  display: grid;
  grid-template-columns: repeat(7, var(--hm-cell));
  grid-auto-rows: var(--hm-cell);
  gap: var(--hm-gap);
}
.hm-cell { width: var(--hm-cell); height: var(--hm-cell); border-radius: 6px; background: var(--hm-0); }
/* 图例：宽度上限 200px。
   不给上限时它会被 1fr 吃到几百像素宽——内容只有 4 档色阶（约 180px 足够），
   撑开后整块面板全是空白，视觉重量却压过了日历本身。
   上限之内仍左对齐排在日历右侧；超出部分留在卡片末尾——
   与其把面板拉开凑宽度，不如像站内其它模块一样把空白留在末尾。 */
.hm-legend {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  max-width: 200px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: 14px 16px;
}
.hm-legend .hm-title { font-size: 12px; font-weight: 600; color: var(--brand-dark); }
.hm-legend .hm-scale {
  /* 每行「文字 + 色块」紧贴，而不是让色块对齐到最长标签之后的列。
     用 auto 1fr 时「0 分钟」后面会空出一段（色块被推到「60–119 分钟」
     之后的固定列），看起来像漏了内容。关联关系也变弱：
     离标签越远，越难一眼看出哪块对应哪档。 */
  display: grid; grid-template-columns: auto auto; gap: 4px 10px;
  align-items: center; justify-content: start;
  font-size: 12px; color: var(--muted);
}
.hm-legend .hm-sw { display: flex; align-items: center; gap: 5px; }
.hm-legend .hm-sub { font-size: 12px; color: var(--faint); line-height: 1.5; }
.hm-legend i { width: 15px; height: 15px; border-radius: 4px; display: inline-block; flex: none; }
@media (max-width: 720px) {
  .heatmap-wrap { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hm-legend { padding: 12px 14px; }
}
.hm-0 { background: var(--hm-0); }
.hm-1 { background: var(--hm-1); }
.hm-2 { background: var(--hm-2); }
.hm-3 { background: var(--hm-3); }

/* 头像尺寸统一入口，禁止再写 style="width:NNpx;height:NNpx"。
   .avatar.sm = 30（默认），.xs = 24，.md = 34 */
.avatar.xs { width: 24px; height: 24px; font-size: 11px; }
.avatar.md { width: 34px; height: 34px; font-size: 14px; }

/* 我的成就（徽章墙）
   ------------------------------------------------------------
   只展示已获得的徽章，因此**数量不固定**（1~4 枚不等）。
   网格策略：固定 4 条等宽轨道，不足 4 枚时徽章**从左往右排**，
   空位留在末尾——不用 auto-fit。
   曾用 auto-fit + minmax(96px,1fr)：它会把空轨道折叠掉，
   仅 1 枚徽章时把这一枚拉伸到整行宽（实测 543px 宽的格子套 60px 图标），
   一个徽章横跨整张卡，非常难看。
   固定轨道 + 每项自身居中，才能保证每枚徽章尺寸一致、
   且「几个徽章就占几个位置」。
   窄屏由 .content 的宽度决定轨道是否够 4 列，不够时用 ≤640 断点降为 2 列。 */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.badge-item { text-align: center; min-width: 0; }
.badge-icon {
  width: 60px; height: 60px; border-radius: 50%; background: var(--brand-50);
  display: flex; align-items: center; justify-content: center; font-size: 27px; margin: 0 auto 8px;
}
/* 徽章描述长短不一（「挑战营 21 天全勤（结算发放）」会折成两行），
   不锁高度会让后面的徽章把整行文字基线顶偏。
   给描述块固定两行高度，各枚的「名称」与「描述」因此各自对齐。 */
.badge-item .bn { font-size: 13px; font-weight: 600; }
.badge-item .bd {
  font-size: 11px; color: var(--faint);
  min-height: 2.6em; line-height: 1.3;
}
/* 「下一枚」提示：徽章墙只显示已得战绩，牵引力放在这一行。
   与徽章墙之间留出间距，避免被读成第 5 枚徽章。 */
.badge-next {
  margin-top: var(--gap-sm); padding-top: 11px;
  border-top: 1px dashed var(--border-soft);
  font-size: 12px; color: var(--muted);
}
.badge-next b { color: var(--brand-dark); }

/* 弹层 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,40,32,.5); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: fade .16s ease;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: 26px; width: 100%;
  max-width: 440px; box-shadow: var(--shadow-lg); max-height: 88vh; overflow-y: auto;
  animation: pop .18s ease;
}
.modal.wide { max-width: 620px; }
.modal h2 { font-size: 18px; color: var(--brand-dark); margin-bottom: 6px; }
.modal .mdesc { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

/* 弹窗（及卡片）底部的按钮行。此前 11 处各写一遍
   style="display:flex;gap:10px;margin-top:16px"，其中 2 处写成 18px，
   在相邻弹窗之间造成肉眼可辨的间距跳动。统一收进这里。 */
.modal-foot { display: flex; gap: 10px; margin-top: 18px; }
.modal-foot .btn { flex: 1; }
/* 弹窗内的信息块（营期/退出成本等） */
.modal-panel { background: var(--surface-2); border-radius: 12px; padding: 14px; margin: 12px 0; }

.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%);
  background: var(--brand-dark); color: #fff; border-radius: 11px;
  padding: 11px 24px; font-size: 14px; z-index: 200; box-shadow: var(--shadow-lg);
  animation: drop .2s ease; max-width: 80vw;
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -12px); } }

.empty { text-align: center; color: var(--faint); font-size: 13px; padding: 30px 0; }
.muted { color: var(--muted); font-size: 13px; }
.faint { color: var(--faint); font-size: 12px; }
.inline-note {
  font-size: 12px; color: var(--faint); background: var(--surface-2);
  border-radius: 8px; padding: 9px 13px; margin-top: 12px;
}
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13px; border-bottom: 1px dashed var(--border-soft); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); min-width: 0; }
/* .v 不再 flex-shrink:0。
   ------------------------------------------------------------
   原本设 flex-shrink:0 是为了让数值列不被压窄、右边缘对齐好看，
   但 .v 里并不只有数值：「退出后果」「冷却规则」这类整句说明也走这套
   .kv，一旦不收缩就直接把卡片顶出屏幕——375 宽实测页面横向溢出 89px
   （.main/.content/.card 三层都被撑破）。改为允许收缩 + 可断行，
   数值在空间充足时本来就不会收缩，对齐不受影响。 */
.kv .v {
  font-weight: 600; color: var(--brand-dark); font-variant-numeric: tabular-nums;
  text-align: right; min-width: 0; overflow-wrap: anywhere;
}
.kv.total { border-top: 2px solid var(--border); border-bottom: none; margin-top: 6px; padding-top: 12px; }
.kv.total .v { font-size: 19px; color: var(--brand); }
.kv.minus .v { color: var(--danger); }

/* 弹窗里的键值组
   ------------------------------------------------------------
   .kv 自带虚线下边框，直接铺在弹窗白底上会显得「表格悬空」。
   统一套一层浅底容器，弹窗里的多行说明就有了边界。 */
.kv-list {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 4px 14px;
  margin: 12px 0;
}
.kv-list .kv { font-size: 13px; }

/* 邀请链接：输入框 + 复制按钮同一行，宽度随弹窗 */
.invite-box {
  display: flex; gap: 8px; align-items: center;
  margin: 12px 0;
}
.invite-box input {
  flex: 1; min-width: 0;
  border: 1px solid var(--border); border-radius: 9px;
  padding: 9px 12px; font-size: 13px;
  background: var(--surface-2); color: var(--muted);
}
.invite-box .btn { flex: none; }

/* 通知中心：未读 / 已读的视觉区分
   ------------------------------------------------------------
   只做两件事，不引入第二套配色（配色已经承担了「消息类型」的语义）：
     · 未读：文字加粗 + 开头一个品牌色圆点
     · 已读：常规字重、常规色，无圆点
   圆点用真实元素而非 ::before：.kv 是 flex 容器，伪元素会成为
   flex item 参与排版，与文字之间会出现难以控制的间隙。 */
.kv.notice { align-items: flex-start; }
.kv.notice .k {
  display: flex; align-items: center; gap: 8px;
  /* 不设 line-height：这一行必须与其他页面的 .kv 保持同一行高，
     否则 _style_probe 会判为「同 class 跨页不一致」（实测 21.45 → 20.15px）。
     圆点的垂直居中靠 align-items 完成，不需要改行高。 */
}
.kv.notice .ntx { min-width: 0; }
/* 未读：加粗 + 深色（比已读更"重"），保持可读性 */
.kv.notice.is-unread .ntx { font-weight: 600; color: var(--text); }
/* 已读：常规字重与次要色，明显退到后景 */
.kv.notice.is-read .ntx { font-weight: 400; color: var(--muted); }
/* ok 类型（好消息）保留品牌绿，但**已读时用浅一档的绿**——
   否则已读与未读同为饱和绿，只能靠字重区分，层次不足。
   这个浅绿必须仍达 AA：候选过的 #1D9E75 只有 3.39:1（不达标，已弃用），
   最终用 #157A5F = 5.28:1（品牌绿 #0F6E56 为 6.2:1）。
   「已读」不等于「可以不可读」，降对比要止于 AA 线之上。 */
.kv.notice.is-unread .ntx.k-ok { color: var(--brand); }
.kv.notice.is-read .ntx.k-ok { color: #157A5F; }
/* 未读圆点：垂直居中于首行文字 */
.unread-dot {
  flex: none; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand); display: inline-block;
}
/* 超出展示上限时的说明 */
.notice-more {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px dashed var(--border-soft);
  font-size: 12px; color: var(--faint); text-align: center;
}

.points-break { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.pchip { font-size: 12px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 999px; padding: 3px 11px; color: var(--muted); }
.pchip b { color: var(--brand-dark); }

/* 积分明细：一天一块，14 天要能扫得动。
   原来单列四行 kv（每行 8px 上下留白 + 行高），一天 ~270px，一屏只装两天。
   现在卡片减负 + 四科排两列，同样的信息高度砍掉约四成。
   两列各自包一层 .day-col：一是让 .kv 的右边缘在各自列内对齐，
   二是窄屏可以直接把两列叠回一列。 */
/* 积分明细的每天一块。
   内边距必须是全站标准值（不写 = 继承 .card 的 20px）：
   曾写成 `16px 20px` 想压密度，结果同一个页面里两种卡内边距，
   视觉上「明细卡比统计卡紧一圈」。密度改由行距控制。 */
.day-card .card-head { margin-bottom: 10px; }
.day-card .kv { padding: 6px 0; }
.day-card .kv.total { padding-top: 10px; margin-top: 4px; }
/* 空白天：用中性底色 + 无阴影表达「这天没有数据」。
   标题也一并降到 muted —— 它只是日期，不必抢眼。
   反例（已废弃）：整块 opacity:.62，会把说明文字压到 2.7:1。 */
.day-blank { background: var(--surface-2); box-shadow: none; border-style: dashed; }
.day-blank .card-head h2 { color: var(--muted); font-weight: 500; }
/* 基础分是主体，加分项降一档：三段等权重时读者要逐字读完才知道哪段是主要贡献。
   只改内部 span，不动 .v 本身的计算样式（否则与其他页的 .kv .v 判为跨页漂移）。 */
.kv.score .v b { font-weight: 600; }
.kv.score .pbon { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 4px; }
.day-items { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; }
.day-col { min-width: 0; }
@media (max-width: 720px) {
  .day-items { grid-template-columns: minmax(0, 1fr); }
}

/* 表格（口径公示） */
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ptable th { background: var(--brand-50); color: var(--brand-dark); text-align: left; padding: 10px 12px; font-weight: 600; }
.ptable td { padding: 10px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
/* 首列固定宽度并降一档色阶：它是「项名」，不是内容主体，
   宽度不锁死会随文本长度左右跳，规则列也跟着漂。 */
.ptable td:first-child, .ptable th:first-child { width: 200px; }
.ptable td:first-child { color: var(--muted); }
.ptable tr:last-child td { border-bottom: none; }

/* ============================================================
   认证页（注册 / 登录）
   ============================================================ */
.auth-wrap { display: flex; min-height: 100vh; }

.auth-aside {
  width: 42%; max-width: 520px; flex-shrink: 0;
  background: var(--brand-dark); color: #fff; padding: 56px 48px;
  display: flex; flex-direction: column; justify-content: center;
}
.auth-aside .auth-logo {
  width: 56px; height: 56px; border-radius: 16px; background: #fff; color: var(--brand-dark);
  font-size: 30px; display: flex; align-items: center; justify-content: center; margin-bottom: 22px;
}
.auth-aside h2 { font-size: 27px; font-weight: 600; letter-spacing: 1px; }
.auth-aside .auth-slogan { font-size: 14px; color: var(--on-dark-soft); margin-top: 5px; }
.auth-points { list-style: none; margin: 30px 0 0; }
.auth-points li {
  position: relative; padding-left: 24px; margin-bottom: 13px;
  font-size: 14px; color: rgba(255,255,255,.85);
}
.auth-points li::before {
  content: ''; position: absolute; left: 2px; top: 8px;
  width: 7px; height: 7px; border-radius: 50%; background: #9FE1CB;
}
.auth-note { margin-top: 32px; font-size: 13px; color: var(--on-dark-soft); }

.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: var(--radius-lg);
  padding: 30px 32px; box-shadow: var(--shadow);
  border: 1px solid var(--border-soft);
}
.auth-seg { display: flex; margin-bottom: 22px; }
.auth-title { font-size: 21px; color: var(--brand-dark); }
.auth-desc { font-size: 13px; color: var(--muted); margin: 6px 0 20px; }
.auth-submit { margin-top: 6px; padding: 11px; font-size: 15px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.auth-foot { font-size: 12px; color: var(--faint); margin-top: 18px; text-align: center; max-width: 420px; }

/* 「账号怎么来」指引（网页端注册已关闭，2026-11-24）
   ------------------------------------------------------------
   两处会用到：登录页底部的常驻提示，以及「该登录名尚未注册」时的就地展开。
   语气是"告诉你路径"而不是"报错"，因此用中性的浅底 + 品牌色标题，
   不用报错红——用户没做错事，只是不知道账号从哪来。 */
.auth-howto {
  margin-top: 16px; padding: 13px 15px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 10px; text-align: left;
}
.auth-howto__t { font-size: 13px; font-weight: 600; color: var(--brand-dark); margin-bottom: 6px; }
.auth-howto__b { font-size: 12.5px; color: var(--muted); line-height: 1.75; }
.auth-howto__b b { color: var(--brand-dark); }

/* 就地展开版（挂在字段错误容器里，所以要把 .ferr 的红色与隐藏规则顶掉） */
.ferr--block { color: inherit !important; }
.howto {
  margin-top: 8px; padding: 13px 15px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: 10px;
}
.howto__t { font-size: 13px; font-weight: 600; color: var(--brand-dark); margin-bottom: 8px; }
.howto__steps { margin: 0 0 8px 18px; padding: 0; }
.howto__steps li { font-size: 12.5px; color: var(--muted); line-height: 1.8; margin-bottom: 2px; }
.howto__steps b { color: var(--brand-dark); }
.howto__n {
  font-size: 12px; color: var(--faint); line-height: 1.7;
  padding-top: 8px; border-top: 1px dashed var(--border-soft);
}


.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 58px !important; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: var(--brand); font-size: 12px; padding: 5px 9px;
}

.field.has-error input, .input-error { border-color: var(--danger) !important; }
.ferr { font-size: 12px; color: var(--danger); margin-top: 5px; display: none; }

.pw-meter { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.pw-bars { display: flex; gap: 4px; flex: 1; }
.pw-bars i { height: 5px; flex: 1; border-radius: 3px; background: #E4E8E4; transition: background .2s; }
.pw-label { font-size: 12px; color: var(--faint); flex-shrink: 0; }

.pw-rules { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; margin-top: 9px; }
.pw-rules li { font-size: 12px; color: var(--faint); }
.pw-rules li.ok { color: var(--brand); }
.pw-rules li.bad { color: var(--danger); }

.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 4px; }
.chk { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.chk input { margin-top: 3px; accent-color: var(--brand); }
.chk.agree { margin: 4px 0 2px; align-items: flex-start; }

.cap-row { display: flex; align-items: center; gap: 12px; }
.cap-q {
  background: var(--brand-50); color: var(--brand-dark); border-radius: 9px;
  padding: 9px 16px; font-weight: 600; font-size: 15px; letter-spacing: 1px;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.cap-row input { flex: 1; }

.lock-banner {
  background: var(--warn-50); color: #8A6A2B; border-radius: 9px;
  padding: 10px 14px; font-size: 13px; margin: 4px 0 12px;
}
.lock-banner b { color: var(--warn); font-variant-numeric: tabular-nums; }

.mini-out {
  border: none; background: rgba(255,255,255,.12); color: #fff;
  width: 28px; height: 28px; border-radius: 8px; font-size: 13px; flex-shrink: 0;
}
.mini-out:hover { background: rgba(255,255,255,.22); }

@media (max-width: 900px) {
  .auth-aside { display: none; }
  .auth-main { padding: 24px 16px; }
}

/* ============================================================
   响应式断点阶梯：1920 / 1600 / 1400 / 1240 / 1024 / 900 / 640
   ------------------------------------------------------------
   断点在有真实内容宽度需求时才引入，不为了「看起来响应式」而堆媒体查询。
   内容区宽度策略（改过一次，说明为什么这样定）：
     旧版上限 1560px，在 2560 宽的显示器上只用 61%、右侧空出 30%，
     六个页面全都如此——「换大屏反而更空」是当时最明显的问题。
     现在改为分档放宽：
       常态 ≤1560（1440 及以下用满）
       1920  起 1760
       2200  起 2000
       2560  起 2160
     上限随视口台阶式增长，而不是彻底取消：
     正文行宽超过约 100 字就会难以扫读，仪表盘型页面（统计卡、
     卡片网格）宽一点有利，因此放宽到 2160 即止，不再无限拉伸。
   ============================================================ */

/* --- ≤1240：侧栏收窄，两栏布局降为单栏 --- */
@media (max-width: 1240px) {
  :root { --sidebar-w: 208px; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-main, .layout-2-1 { grid-template-columns: minmax(0, 1fr); }
}

/* --- ≥1600：更宽的显示器上放宽内容区，减少左右留白 --- */
@media (min-width: 1600px) {
  .content { max-width: 1560px; }
}

/* --- ≥1920：1080p 及以上。两类页面分开处理：
       · 单栏流式页（积分明细等）：放宽上限即可，多出的宽度给卡片内部；
       · 多栏页（挑战营的营卡网格）：让列数保持自适应，卡片随之变宽。 */
@media (min-width: 1920px) {
  .content { max-width: 1760px; }
  /* 统计卡在宽屏下保持四列即可，但给它们更多呼吸空间 */
  .stat-row { gap: 14px; }
}

/* --- ≥2200：2K 级显示器 --- */
@media (min-width: 2200px) {
  .content { max-width: 2000px; }
  .stat-row { gap: 16px; }
}

/* --- ≥2560：2.5K/4K 级。内容上限停在 2160 —— 再宽正文行就过长了 --- */
@media (min-width: 2560px) {
  .content { max-width: 2160px; }
  .stat-row { gap: 16px; }
}

/* --- ≤1024：顶栏空间吃紧，收起「账号」胶囊只留连续天数与本周分 --- */
@media (max-width: 1024px) {
  .topbar { padding: 10px 20px; gap: 12px; }
  .topbar .tb-stat.acct { display: none; }
  .content { padding: 20px 20px 56px; }
}

/* --- ≤900：侧栏收成图标条 --- */
@media (max-width: 900px) {
  /* 注意：这里**不**强制 .badge-grid 的列数。
     它固定 4 条轨道，数量随「已获得的徽章数」变化；
     窄屏的降列在 ≤640 断点统一处理。 */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-aside { display: none; }
  .auth-main { padding: 24px 16px; }
  .sidebar { width: 68px; padding: 18px 10px; }
  .sidebar .logo .name, .sidebar .logo .slogan,
  .sidebar .user-mini .nm, .sidebar .user-mini .sub, .nav-item span:not(.ic) { display: none; }
  .nav-item { justify-content: center; }
}

/* --- ≤640：单列铺满，统计卡两列，顶栏紧凑；表格允许横向滚动而不撑破页面 --- */
@media (max-width: 640px) {
  .content { padding: 16px 14px 48px; }
  .topbar { padding: 8px 14px; gap: 8px; }
  .topbar h1 { font-size: 16px; }
  .topbar .crumb { display: none; }
  .topbar .tb-stat { padding: 5px 10px; font-size: 12px; }
  .card { padding: 16px; border-radius: var(--radius); }
  .stat-row { gap: 10px; }
  .stat { padding: 12px 13px; }
  .stat .n { font-size: 21px; }
  .stat .n.dense { font-size: 15px; }
  .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  /* 徽章墙：窄屏 4 列会把图标和文字压得太挤，降为 2 列 */
  .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  /* 口径公示表在窄屏改为「可横滑」，而不是把整页顶宽 */
  .ptable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ptable { min-width: 520px; }

  /* 行式列表：允许换行，避免徽标被挤出 */
  .member-row, .rank-row { flex-wrap: wrap; row-gap: 6px; }

  /* 榜单行在窄屏必须优先保住「名字」。
     原本 .medal 与「N 人参与」都是 flex:none + nowrap，会把 .nm-t 挤到
     min-width:0 → clientWidth 0，营名整条不可见（不是省略号，是彻底消失）。
     处理：奖牌让位给左侧已有的名次数字；参与人数允许换行。 */
  .rank-row .medal { display: none; }
  /* min-width:auto（即 min-content）让名字不再被压扁到看不见：
     空间不足时由 flexbox 把右侧分值挤到下一行，而不是把汉字变成省略号。 */
  .rank-row .nm { min-width: auto; flex-wrap: wrap; row-gap: 2px; }
  .rank-row .v { margin-left: auto; }
  .member-row .info { min-width: 6em; }

  /* 弹窗铺满可用宽度 */
  .modal { max-width: 100%; padding: 20px; border-radius: var(--radius); }
  .modal-mask { padding: 12px; }

  /* 佐证图片预览在窄屏缩小 */
  .pv-imgs img { width: 100px; height: 100px; }
}
