/* ============================================================
   工作台 · 全部样式
   ------------------------------------------------------------
   可调数值全部在 tokens.css，这个文件里不出现魔法数字。

   结构（三层，都是 <body> 的直接子元素，互不嵌套）：
     .wb-glass   一整块玻璃。backdrop-filter 在这里，**只在这里**
     .wb-notch   把左下角那块补回壁纸，做出「L 形」
     .wb-body    导航 + 内容，浮在最上面
   ============================================================ */

*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;          /* 工作台是固定一屏，不整页滚动 */
}

body {
  /* 字体栈在 tokens.css 的 --wb-font-sans 里（含回退链，说明也在那）。
     ⚠️ 字号用 --wb-font-size，**不是 --wb-text** ——
     --wb-text 是文字**颜色**（主题块里定义），曾经和字号重名导致这行整条失效。 */
  font: var(--wb-font-size) / 1.55 var(--wb-font-sans);
  color: var(--wb-text);
  -webkit-font-smoothing: antialiased;

  /* ---- 壁纸 ----
     background-attachment: fixed 是**必须**的：
     .wb-notch 里复制了一份同样的壁纸来盖住玻璃，
     只有 fixed 才能让两份壁纸都相对视口定位、像素级对齐。
     用 scroll 的话缺口那块会错位，接缝立刻现形。 */
  background-image: var(--wb-wallpaper-image);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #1b1b1f;   /* 壁纸加载出来之前的兜底色 */
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; border: 0; background: none; padding: 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--wb-text) 18%, transparent);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--wb-text) 30%, transparent); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   玻璃 —— 一整块，不是两块
   ------------------------------------------------------------
   ⚠️ 左边导航和右边内容**共用这一个元素**，这是刻意的。

   如果拆成两个元素各带 backdrop-filter：
     模糊核在每个元素的边界会被裁掉，
     接缝两侧各自采样不完整的背景 → 出现一条竖向亮边。
     两块 0.5px 的边框相邻也会得到同样的效果。

   所以：模糊只在这一层做一次，导航和内容只是浮在上面的透明内容。
   要改「左右同色」这件事，改的是这里。
   ============================================================ */
.wb-glass {
  position: fixed;
  inset: var(--wb-frame-pad-y) var(--wb-frame-pad-x);
  z-index: 1;
  border-radius: var(--wb-radius-outer);

  /* 玻璃的不透明度有三个来源，缺一不可：
       --wb-glass-alpha  用户的旋钮（设置页里那个滑块）
       --wb-glass-bias   主题结构性的加厚/减薄（深色主题 +0.2）
       --wb-wall-bias    壁纸自带的补偿（暗壁纸在浅色主题下要加厚，
                         深色主题下要减薄，见 tokens.css 的 [data-wp='desk']） */
  background: rgb(var(--wb-glass-rgb) / calc(
    var(--wb-glass-alpha) + var(--wb-glass-bias) + var(--wb-wall-bias)
  ));
  -webkit-backdrop-filter: blur(var(--wb-glass-blur)) saturate(var(--wb-wall-sat));
  backdrop-filter: blur(var(--wb-glass-blur)) saturate(var(--wb-wall-sat));
}

/* ============================================================
   缺口 —— 把左下角那块还原成壁纸，玻璃就成了 L 形
   ------------------------------------------------------------
   ⚠️ 这里原来的理由（「clip-path 与 backdrop-filter 同用时各浏览器行为不一致」）
      是我的**判断，不是实测**。2026-10-09 补测后修正：

        给 .wb-glass 加 L 形 clip-path、同时隐藏 .wb-notch，
        与现状逐像素比（Chrome 141 / 1440×900）：
          1,296,000 个像素里只有 168 个不同，且全部在缺口顶边那一行 ——
          那边 y = 590.391 是非整数，矢量裁剪产生 1px 抗锯齿；
          整数坐标的竖直边 x=224 差 0。拼接放大图看不出区别。

   → 保留本方案的理由**不是**「clip-path 不能用」，而是这三条：
     ① 纯绘制问题，不依赖 backdrop-filter 与裁剪的交互 ——
        跨浏览器、跨版本都是同一个结果，不必逐个浏览器去验；
     ② 天然是**硬边**（竖直边缘实测一刀切、无羽化），
        而矢量裁剪在非整数坐标处会留 1px 过渡；
     ③ L 形四角分凹角/凸角两类、方向相反（见下面 .wb-notch-corner），
        用补块表达比用 path 逐个描述更不容易把方向弄反。

   这是一次「拿 1 个 div 换确定性」的交易，不是唯一解。
   ============================================================ */
.wb-notch {
  position: fixed;
  left: var(--wb-frame-pad-x);
  top: calc(var(--wb-frame-pad-y) + var(--wb-nav-h-ratio) * var(--wb-frame-h));
  width: var(--wb-nav-w);
  height: calc((1 - var(--wb-nav-h-ratio)) * var(--wb-frame-h));
  z-index: 2;

  /* 缺口自己的圆角。
     ⚠️ 这里只处理**凹角** —— 也就是「缺口咬进玻璃」的那两个角。
        圆它们 = 让玻璃多出来一点。

        左上、右下两个角**不在这里**，因为它们是玻璃的**凸角**（玻璃自己的外角），
        圆它们要反过来 —— 挖掉玻璃。用 border-radius 做会得到方向相反的圆弧，
        正是上一版在左上角弄出来的那个小圆疙瘩。
        那两个角的处理见下面 .wb-notch-corner。

     四角分工：
       上右 = notchRadius   凹角，玻璃多出来一点（顺滑的凹弧）
       上左 = 0             凸角，交给 .wb-notch-corner.tl
       下左 = radius-outer  必须跟玻璃外圈圆角对齐，否则会露出一小块没盖住的玻璃边
       下右 = 0             凸角，交给 .wb-notch-corner.br

     ⚠️ 2026-10-09 起这两个旋钮默认都是 0 → 四角全是直角，
        两个角补丁的宽高也随之变成 0（自动不可见），这里不用做任何分支。 */
  border-radius: 0 var(--wb-notch-radius) 0 var(--wb-radius-outer);

  background-image: var(--wb-wallpaper-image);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ============================================================
   玻璃两个「外凸角」的圆角补丁
   ------------------------------------------------------------
   为什么要单独做，而不是给 .wb-notch 加 border-radius：

     border-radius 只能从方块里**咬掉**一块（让玻璃多出来）。
     但这两个角是玻璃自己的外角，圆它们要反过来 ——
     在角上**补一块壁纸把玻璃盖住**。
     方向正好相反，用 border-radius 会做出一个朝里的小圆疙瘩 ——
     就是上一版左上角那个。

   所以改用 mask + 径向渐变精确切出圆弧：
     补丁是一个 R×R 的壁纸小方块，
     mask 把「离角点圆心 R 以内」的部分抹掉，
     留下的就是「方块减去四分之一圆」——正是要补的形状。
   ============================================================ */
.wb-notch-corner {
  position: fixed;
  width: var(--wb-notch-radius);
  height: var(--wb-notch-radius);
  z-index: 2;

  background-image: var(--wb-wallpaper-image);
  background-attachment: fixed;     /* 和 .wb-notch 同理：必须 fixed 才能像素对齐 */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* 左栏下沿的左端 —— 玻璃的外凸角在 (22,638)。
   圆角的圆心在 (22+R, 638-R)，也就是补丁方块的**右上角** → mask 取 at 100% 0 */
.wb-notch-corner.tl {
  left: var(--wb-frame-pad-x);
  top: calc(
    var(--wb-frame-pad-y) + var(--wb-nav-h-ratio) * var(--wb-frame-h)
    - var(--wb-notch-radius)
  );
  -webkit-mask-image: radial-gradient(
    circle var(--wb-notch-radius) at 100% 0,
    transparent calc(var(--wb-notch-radius) - 0.5px), #000 var(--wb-notch-radius));
  mask-image: radial-gradient(
    circle var(--wb-notch-radius) at 100% 0,
    transparent calc(var(--wb-notch-radius) - 0.5px), #000 var(--wb-notch-radius));
}

/* 内容区下沿的左端 —— 玻璃的外凸角在 (frame+navW, frame+h)，即缺口的右下角。
   ⚠️ 补丁必须盖在**内容区那一侧**（x 从 frame+navW 起，往右一个 R），
      不是盖在缺口里 —— 因为要圆的是**内容区**的角。
      圆心在 (frame+navW+R, 底边-R)，同样是补丁方块的右上角 → 还是 at 100% 0。
      第一版把 left 写成了 frame+navW-R（盖到缺口里），方向反了。 */
.wb-notch-corner.br {
  left: calc(var(--wb-frame-pad-x) + var(--wb-nav-w));
  top: calc(var(--wb-frame-pad-y) + var(--wb-frame-h) - var(--wb-notch-radius));
  -webkit-mask-image: radial-gradient(
    circle var(--wb-notch-radius) at 100% 0,
    transparent calc(var(--wb-notch-radius) - 0.5px), #000 var(--wb-notch-radius));
  mask-image: radial-gradient(
    circle var(--wb-notch-radius) at 100% 0,
    transparent calc(var(--wb-notch-radius) - 0.5px), #000 var(--wb-notch-radius));
}

/* ============================================================
   主体：导航 + 内容
   ============================================================ */
.wb-body {
  position: fixed;
  inset: var(--wb-frame-pad-y) var(--wb-frame-pad-x);
  z-index: 3;
  display: flex;
  overflow: hidden;              /* 内容超出去要裁掉，别盖到圆角外面 */
  border-radius: var(--wb-radius-outer);
}

/* ---------- 左栏 ---------- */
.wb-nav {
  width: var(--wb-nav-w);
  height: calc(var(--wb-nav-h-ratio) * 100%);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: 14px 12px;

  /* ⚠️ 不要在这里加 background / border-right。
     导航和内容是**同一块玻璃**，任何一侧加底色或边框
     都会在接缝处形成一条线 —— 那正是要避免的东西。 */
}

.wb-nav-head {
  padding: 4px 10px 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--wb-text-faint);
  text-transform: uppercase;
}

.wb-nav-list { display: flex; flex-direction: column; gap: 2px; }

.wb-nav-foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wb-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--wb-radius-sm);
  color: var(--wb-text-dim);
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.wb-nav-item:hover { background: var(--wb-hover); color: var(--wb-text); }
.wb-nav-item[aria-current='page'] {
  background: var(--wb-active);
  color: var(--wb-text);
  font-weight: 500;
}
.wb-nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; }
.wb-nav-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 设置单独一组，视觉上弱一点 —— 像 macOS 的偏好设置 */
.wb-nav-foot .wb-nav-item { color: var(--wb-text-faint); }
.wb-nav-foot .wb-nav-item[aria-current='page'] { color: var(--wb-text); }

/* ---------- 右栏 ---------- */
.wb-main {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--wb-main-pad-y) var(--wb-main-pad-x);
  overflow: hidden;             /* 只有内部列表滚动，整块面板不动 */
}

.wb-view-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex: 0 0 auto;
}
.wb-view-title { font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }
.wb-view-sub { font-size: 12px; color: var(--wb-text-faint); }

/* 滚动区。列表长了只有这里滚，标题栏和输入框钉住。 */
.wb-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 calc(var(--wb-main-pad-x) * -1 + 4px);
  padding: 0 calc(var(--wb-main-pad-x) - 4px);
}

/* 视图的根节点。
   ⚠️ 这一条不加，.wb-scroll 就**根本不会滚** —— 实测踩过：
      视图返回的是一个普通 <div>，作为 flex 项它的高度由内容决定（flex: 0 1 auto），
      于是它长到 1626px，里面的 .wb-scroll 也跟着长到 1626px，
      scrollHeight === clientHeight，没有可滚的余地。
      内容超出面板时不会被滚动，而是被 .wb-body 的 overflow:hidden **直接切掉**。
      症状很隐蔽：只有内容超过一屏才会出现，而且看起来像「下面没内容了」。
   → 视图根节点必须是 flex 项（flex:1 + min-height:0），
     才能把高度约束传下去，让 .wb-scroll 真正获得可滚动的高度。 */
.wb-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   通用控件
   ============================================================ */
.wb-field {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--wb-radius-sm);
  border: 0.5px solid var(--wb-field-line);
  background: var(--wb-field);
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.wb-field::placeholder { color: var(--wb-text-faint); }
.wb-field:focus {
  border-color: var(--wb-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--wb-accent) 22%, transparent);
}

.wb-btn {
  padding: 7px 13px;
  border-radius: var(--wb-radius-sm);
  border: 0.5px solid var(--wb-field-line);
  background: var(--wb-field);
  color: var(--wb-text);
  transition: background 0.12s ease;
  white-space: nowrap;
}
.wb-btn:hover { background: var(--wb-hover); }
.wb-btn:disabled { opacity: 0.45; cursor: default; }
.wb-btn.primary {
  background: var(--wb-accent);
  border-color: transparent;
  color: var(--wb-accent-fg);
}
.wb-btn.primary:hover { filter: brightness(1.08); }
.wb-btn.danger { color: var(--wb-danger); }
.wb-btn.ghost { background: transparent; border-color: transparent; color: var(--wb-text-dim); }
.wb-btn.ghost:hover { background: var(--wb-hover); color: var(--wb-text); }

.wb-add-row { display: flex; gap: 8px; flex: 0 0 auto; margin-bottom: 14px; }
.wb-add-row .wb-field { flex: 1; }

/* ============================================================
   事项行
   ============================================================ */
.wb-group { margin-bottom: 22px; }
.wb-group-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--wb-text-faint);
  padding: 0 4px 7px;
}

.wb-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--wb-radius-sm);
  transition: background 0.1s ease;
}
.wb-item:hover { background: var(--wb-hover); }

/* 勾选框：自己画，好控制尺寸 */
.wb-check {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: calc(5px * var(--wb-radius-scale));
  border: 1.5px solid var(--wb-check-line);
  display: grid;
  place-items: center;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.wb-check:hover { border-color: var(--wb-accent); }
.wb-check svg { width: 11px; height: 11px; opacity: 0; color: #fff; }
.wb-item[data-done='true'] .wb-check { background: var(--wb-accent); border-color: var(--wb-accent); }
.wb-item[data-done='true'] .wb-check svg { opacity: 1; }

.wb-item-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wb-item[data-done='true'] .wb-item-title {
  text-decoration: line-through;
  color: var(--wb-text-faint);
}

.wb-item-meta {
  font-size: 12px;
  color: var(--wb-text-faint);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.wb-item-meta.overdue { color: var(--wb-danger); }

/* 优先级：只有 high 才显形，不然整页都是彩色点会很吵 */
.wb-pri {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: transparent;
}
.wb-item[data-priority='high'] .wb-pri { background: var(--wb-danger); }
.wb-item[data-priority='low'] .wb-pri { background: color-mix(in srgb, var(--wb-text) 25%, transparent); }

.wb-item-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s ease; }
.wb-item:hover .wb-item-actions { opacity: 1; }
.wb-item-actions button {
  width: 26px; height: 26px;
  border-radius: calc(7px * var(--wb-radius-scale));
  display: grid; place-items: center;
  color: var(--wb-text-faint);
}
.wb-item-actions button:hover { background: var(--wb-active); color: var(--wb-text); }
.wb-item-actions button.danger:hover { color: var(--wb-danger); }
.wb-item-actions svg { width: 14px; height: 14px; }

/* ============================================================
   空状态
   ============================================================ */
.wb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 56px 20px;
  text-align: center;
  color: var(--wb-text-faint);
}
.wb-empty svg { width: 30px; height: 30px; opacity: 0.45; }
.wb-empty strong { font-weight: 500; color: var(--wb-text-dim); font-size: 14px; }
.wb-empty p { margin: 0; font-size: 12.5px; max-width: 380px; line-height: 1.7; }

/* ============================================================
   锁屏
   ============================================================ */
.wb-lock {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
}
.wb-lock-card {
  width: 100%;
  max-width: 330px;
  padding: 30px 28px 26px;
  border-radius: var(--wb-radius-lg);
  background: rgb(var(--wb-glass-rgb) / calc(var(--wb-glass-alpha) + var(--wb-glass-bias) + var(--wb-wall-bias) + 0.2));
  -webkit-backdrop-filter: blur(26px) saturate(1.6);
  backdrop-filter: blur(26px) saturate(1.6);
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.18);
  text-align: center;
}
.wb-lock-card svg.lock-icon { width: 30px; height: 30px; opacity: 0.5; margin-bottom: 12px; }
.wb-lock-card h1 { font-size: 17px; font-weight: 500; margin: 0 0 4px; }
.wb-lock-card .sub { font-size: 12.5px; color: var(--wb-text-dim); margin: 0 0 20px; }
.wb-lock-card form { display: flex; flex-direction: column; gap: 10px; }
/* ⚠️ 登录页是「登录前」的界面 —— 2026-10-09 用户只要求登录后恢复直角，
   所以这里把输入框和按钮的圆角**显式恢复**（它们的 .wb-field / .wb-btn
   共用样式已经被降到 0 了）。卡片本身的圆角来自 --wb-radius-lg，没被动过。 */
.wb-lock-card .wb-field,
.wb-lock-card .wb-btn {
  border-radius: 8px;
}
.wb-lock-card .wb-field { text-align: center; letter-spacing: 0.14em; }
.wb-lock-msg { font-size: 12.5px; min-height: 18px; }
.wb-lock-msg.err { color: var(--wb-danger); }
.wb-lock-msg.ok { color: var(--wb-text-dim); }

/* ============================================================
   设置页
   ============================================================ */
.wb-section { margin-bottom: 26px; }
.wb-section > h3 {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--wb-text-faint);
  margin: 0 0 10px;
}
.wb-card {
  border-radius: var(--wb-radius-md);
  border: 0.5px solid var(--wb-line);
  background: color-mix(in srgb, var(--wb-field) 60%, transparent);
  padding: 4px 16px;
}
.wb-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--wb-line);
}
.wb-row:last-child { border-bottom: 0; }
.wb-row > label:first-child { flex: 0 0 auto; min-width: 96px; font-size: 12.5px; color: var(--wb-text-dim); }
.wb-row .grow { flex: 1; min-width: 0; }
.wb-hint { font-size: 12px; color: var(--wb-text-faint); margin: 8px 2px 0; line-height: 1.65; }

/* 滑块 —— 默认样式太粗笨，压细一点 */
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  outline: none;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: calc(2px * var(--wb-radius-scale));
  background: color-mix(in srgb, var(--wb-text) 16%, transparent);
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
  cursor: grab;
}
input[type='range']:active::-webkit-slider-thumb { cursor: grabbing; }
.wb-knob-val {
  flex: 0 0 54px;
  text-align: right;
  font-size: 12px;
  color: var(--wb-text-faint);
  font-variant-numeric: tabular-nums;
}

/* 壁纸选择器的小色块 —— 渐变的定义在 tokens.css 的 [data-wp='...'] 里，
   色块自己带上 data-wp 属性就直接复用同一个变量，不用在 JS 里再写一遍。 */
.wb-wallpapers { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 0; }
.wb-wp {
  width: 62px; height: 40px;
  border-radius: calc(9px * var(--wb-radius-scale));
  border: 2px solid transparent;
  background-image: var(--wb-wallpaper-image);
  background-size: cover;
  background-position: center;
  position: relative;
  transition: transform 0.14s ease;
}
.wb-wp:hover { transform: translateY(-2px); }
.wb-wp[aria-pressed='true'] { border-color: var(--wb-accent); }
.wb-wp span {
  position: absolute; left: 0; right: 0; bottom: -17px;
  font-size: 10.5px; color: var(--wb-text-faint); text-align: center;
}
.wb-wallpapers { padding-bottom: 30px; }

/* 主题切换 */
.wb-seg { display: flex; gap: 4px; padding: 3px; border-radius: calc(9px * var(--wb-radius-scale)); background: var(--wb-hover); }
.wb-seg button {
  flex: 1;
  padding: 5px 10px;
  border-radius: calc(7px * var(--wb-radius-scale));
  font-size: 12.5px;
  color: var(--wb-text-dim);
  white-space: nowrap;
}
.wb-seg button[aria-pressed='true'] {
  background: rgb(var(--wb-glass-rgb) / 0.9);
  color: var(--wb-text);
  box-shadow: var(--wb-shadow);
}

.wb-auth-form { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }
.wb-auth-form .wb-field { text-align: left; letter-spacing: normal; }
.wb-inline-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wb-msg { font-size: 12.5px; min-height: 17px; }
.wb-msg.err { color: var(--wb-danger); }
.wb-msg.ok { color: var(--wb-text-dim); }

/* ============================================================
   日历
   ============================================================ */
.wb-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex: 0 0 auto;
}
.wb-cal-month { font-size: 15px; font-weight: 500; }
.wb-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 4px;
  flex: 0 0 auto;
}
.wb-cal-weekdays div {
  text-align: center;
  font-size: 11px;
  color: var(--wb-text-faint);
  padding: 3px 0;
}
.wb-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  flex: 0 0 auto;
  margin-bottom: 18px;
}
.wb-cal-day {
  aspect-ratio: 1 / 0.82;
  border-radius: var(--wb-radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-variant-numeric: tabular-nums;
  transition: background 0.1s ease;
}
.wb-cal-day:hover { background: var(--wb-hover); }
.wb-cal-day.out { color: var(--wb-text-faint); opacity: 0.5; }
.wb-cal-day[aria-pressed='true'] { background: var(--wb-active); font-weight: 500; }
.wb-cal-day.today > span {
  color: var(--wb-accent);
  font-weight: 500;
}
.wb-cal-dots { display: flex; gap: 2px; height: 4px; }
.wb-cal-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--wb-accent); }
.wb-cal-dots i.hi { background: var(--wb-danger); }

/* ============================================================
   移动端
   ------------------------------------------------------------
   L 形的概念在手机上不成立（没有「左边一栏」），
   导航改成底部标签栏 —— 拇指好按，且不挤占内容宽度。

   ⚠️ 这里的 --wb-frame-pad-x/y / --wb-radius-outer 只有在
      用户**没在设置页调过**时才会生效。
      原因是 JS 把旋钮写成了 :root 的行内样式，行内样式优先级高于媒体查询。
      所以 store.js 里做了分支：屏幕窄的时候**不写**这几个变量，
      把布局交还给这份媒体查询。见 web/js/store.js 的 applySettings()。
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --wb-frame-pad-x: 10px;
    --wb-frame-pad-y: 10px;
    /* 这里原来有一个 --wb-radius-outer: 18px 的覆盖，
       现在根值已经是 0（直角），窄屏不再需要单独定义 —— 跟随根值即可。 */
    --wb-main-pad-x: 16px;
    --wb-main-pad-y: 14px;
  }

  .wb-notch,
  .wb-notch-corner { display: none; }

  .wb-body {
    flex-direction: column;
    /* 给底部标签栏留出安全区（iPhone 的 Home 指示条）*/
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .wb-main {
    order: 1;
    padding-bottom: 10px;
  }

  .wb-nav {
    order: 2;
    width: 100%;
    height: auto;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: stretch;
    padding: 6px 6px 8px;
  }

  .wb-nav-head { display: none; }
  .wb-nav-foot { margin-top: 0; padding-top: 0; flex-direction: row; }

  .wb-nav-list,
  .wb-nav-foot {
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    flex: 1;
  }
  .wb-nav-foot { flex: 0 0 auto; }

  .wb-nav-item {
    flex-direction: column;
    gap: 3px;
    padding: 6px 4px;
    font-size: 10.5px;
    flex: 1;
    justify-content: center;
    align-items: center;
    min-width: 0;
  }
  .wb-nav-item span { font-size: 10.5px; }
  .wb-nav-item svg { width: 20px; height: 20px; }

  /* 手机上设置和其他项一样是图标，不需要弱化 */
  .wb-nav-foot .wb-nav-item { color: var(--wb-text-dim); }

  /* 手机没有 hover，操作按钮常驻 */
  .wb-item-actions { opacity: 1; }

  .wb-view-title { font-size: 17px; }
  .wb-lock-card { padding: 26px 22px 22px; }
}
