/* =========================================================================
   个人待办 · 模块样式（复刻方案 §5 设计 token / §5.3 清单布局，网页版 k=1）
   -------------------------------------------------------------------------
   字号换算说明：桌面版字号以 pt 计（标题 10pt / 元信息 9pt），网页版按
   10pt ≈ 13px、9pt ≈ 12px 换算；尺寸类（卡缝 8 / 勾径 22 / 右栏 360 …）
   为逻辑像素，直接等于 CSS px。
   ========================================================================= */

/* ---------------- 设计 token（方案 §5.1.1） ---------------- */
:root {
  --p-page: #0D0D0D;
  --p-card: #151515;
  --p-field: #1A1A1A;
  --p-border: #262626;
  --p-border-hot: #3A3A3A;
  --p-text: #EDEDED;
  --p-muted: #8C8C8C;
  --p-faint: #595959;
  --p-primary: #3B82F6;
  --p-green: #72A57C;
  --p-orange: #D9A45B;
  --p-red: #E06C6C;
  --p-purple: #9C8AC4;
  --p-cyan: #5B9BD5;
  --p-sel: #132A45;
  --p-hover: #1E1E1E;
  --p-on-primary: #0D0D0D;
  /* 待办颜色库（8 色 · 深色套） */
  --tc-blue: #4C9AFF;
  --tc-green: #3FB950;
  --tc-orange: #D29922;
  --tc-red: #F85149;
  --tc-purple: #A371F7;
  --tc-cyan: #39C5CF;
  --tc-pink: #F778BA;
  --tc-gray: #8B949E;
  /* 语义徽标（前景/底色，方案 §5.1.1） */
  --sem-danger-fg: #FF8A85;  --sem-danger-bg: #3A1D20;
  --sem-warning-fg: #E3B341; --sem-warning-bg: #3A2E15;
  --sem-muted-fg: #9BA6B2;   --sem-muted-bg: #20262E;
  --sem-primary-fg: #79C0FF; --sem-primary-bg: #152A44;
}
[data-theme="light"] {
  --p-page: #F4F5F7;
  --p-card: #FFFFFF;
  --p-field: #FFFFFF;
  --p-border: #E2E4E9;
  --p-border-hot: #CDD1DA;
  --p-text: #1A1A1A;
  --p-muted: #737373;
  --p-faint: #9AA0A6;
  --p-primary: #2563EB;
  --p-green: #5C8A66;
  --p-orange: #B4762A;
  --p-red: #C4544F;
  --p-purple: #8250DF;
  --p-cyan: #0E7490;
  --p-sel: #E8EFFC;
  --p-hover: #F1F3F5;
  --p-on-primary: #FFFFFF;
  --tc-blue: #1F6FEB;
  --tc-green: #1A7F37;
  --tc-orange: #9A6700;
  --tc-red: #CF222E;
  --tc-purple: #8250DF;
  --tc-cyan: #0E7490;
  --tc-pink: #BF3989;
  --tc-gray: #57606A;
  --sem-danger-fg: #B42318;  --sem-danger-bg: #FDE4E1;
  --sem-warning-fg: #9A6700; --sem-warning-bg: #FFF3D6;
  --sem-muted-fg: #57606A;   --sem-muted-bg: #EAECF0;
  --sem-primary-fg: #1D4ED8; --sem-primary-bg: #E3ECFD;
}

/* ============================ 一、模块骨架 ============================ */

.pt-module {
  display: flex; flex-direction: column;
  height: calc(100vh - 150px); min-height: 540px;
  color: var(--p-text);
}

/* ---- 顶栏（44px，方案 §5.2） ---- */
.pt-topbar {
  flex: none; height: 44px; display: flex; align-items: center; gap: 12px;
}
.pt-pills { display: flex; gap: 4px; flex: none; }
.pt-pill {
  height: 28px; padding: 0 9px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--p-border);
  color: var(--p-muted); font-size: 12.5px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.pt-pill .ic { width: 14px; height: 14px; }
.pt-pill:hover { background: color-mix(in srgb, var(--p-primary) 10%, var(--p-page)); border-color: var(--p-border-hot); color: var(--p-text); }
.pt-pill.on { background: color-mix(in srgb, var(--p-primary) 24%, var(--p-page)); border-color: color-mix(in srgb, var(--p-primary) 24%, var(--p-page)); color: var(--p-primary); font-weight: 600; }

/* 搜索胶囊 */
.pt-search {
  position: relative; flex: 0 1 220px; width: 220px; min-width: 130px;
  height: 32px; display: flex; align-items: center; gap: 7px;
  background: var(--p-field); border: 1px solid var(--p-border); border-radius: 16px;
  padding: 0 10px 0 12px; transition: border-color .15s;
}
.pt-search:focus-within { border-color: var(--p-primary); }
.pt-search .ic { flex: none; color: var(--p-muted); width: 14px; height: 14px; }
.pt-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--p-text); font-size: 12.5px; padding: 0;
}
.pt-search input::placeholder { color: var(--p-faint); }
.pt-search .pt-search-x {
  flex: none; width: 18px; height: 18px; border: 0; border-radius: 50%;
  display: none; place-items: center; background: var(--p-border);
  color: var(--p-muted); cursor: pointer; padding: 0;
}
.pt-search.has-value .pt-search-x { display: grid; }
.pt-search .pt-search-x:hover { color: var(--p-text); }

/* 动作按钮组 */
.pt-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
.pt-btn {
  height: 30px; padding: 0 12px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--p-field); border: 1px solid var(--p-border);
  color: var(--p-text); font-size: 12.5px; cursor: pointer;
  transition: border-color .12s, filter .12s, background .12s;
}
.pt-btn .ic { width: 15px; height: 15px; color: var(--p-muted); }
.pt-btn:hover { border-color: var(--p-border-hot); }
.pt-btn.primary { background: var(--p-primary); border-color: var(--p-primary); color: var(--p-on-primary); font-weight: 600; }
.pt-btn.primary .ic { color: var(--p-on-primary); }
.pt-btn.primary:hover { filter: brightness(1.08); }
.pt-btn.ghost { background: transparent; border-color: transparent; color: var(--p-primary); }
.pt-btn.ghost:hover { background: color-mix(in srgb, var(--p-primary) 10%, transparent); }
.pt-btn[hidden] { display: none; }

/* ---- 视图容器 ---- */
.pt-views { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 2px; }
.pt-view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.pt-view.on { display: flex; }

/* ---- 状态栏（26px，方案 §FR-G3） ---- */
.pt-statusbar {
  flex: none; height: 26px; display: flex; align-items: center;
  color: var(--p-faint); font-size: 11.5px; padding: 0 2px; gap: 6px;
  white-space: nowrap; overflow: hidden;
}

/* ============================ 二、待办清单视图 ============================ */

/* ---- 统计条（44px） ---- */
body.is-phone .pt-stats, body.is-tablet .pt-stats, body.is-touch .pt-stats {
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
body.is-phone .pt-stats::-webkit-scrollbar,
body.is-tablet .pt-stats::-webkit-scrollbar,
body.is-touch .pt-stats::-webkit-scrollbar { display: none; }

.pt-stats {
  flex: none; height: 44px; display: flex; align-items: center; gap: 6px;
  background: var(--p-card); border: 1px solid var(--p-border); border-radius: 8px;
  padding: 0 12px;
}
.pt-stat {
  height: 26px; padding: 0 9px; border: 0; border-radius: 7px; white-space: nowrap; flex: none;
  background: transparent; color: var(--p-muted); font-size: 12px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: background .12s, color .12s;
}
.pt-stat b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-stat:hover { background: color-mix(in srgb, var(--c, var(--p-muted)) 9%, var(--p-card)); }
.pt-stat.has-n, .pt-stat.on { color: var(--c, var(--p-muted)); }
.pt-stat.on { background: color-mix(in srgb, var(--c, var(--p-muted)) 16%, var(--p-card)); font-weight: 700; }
.pt-stats .sp { flex: 1; }
.pt-rtoggle {
  width: 30px; height: 30px; border: 0; border-radius: 7px; cursor: pointer;
  background: transparent; color: var(--p-muted); display: grid; place-items: center;
  transition: background .12s, color .12s;
}
.pt-rtoggle .ic { width: 17px; height: 17px; }
.pt-rtoggle:hover { background: var(--p-hover); color: var(--p-text); }
.pt-rtoggle.on { background: var(--p-sel); color: var(--p-primary); }

/* ---- 双栏工作台 ---- */
.pt-work { flex: 1; min-height: 0; display: flex; margin-top: 8px; }
.pt-listcol { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 0 8px 8px 2px; }
.pt-listcol::-webkit-scrollbar { width: 8px; }
.pt-listcol::-webkit-scrollbar-thumb { background: var(--p-border-hot); border-radius: 4px; border: 2px solid transparent; background-clip: content-box; }
.pt-split {
  flex: none; width: 5px; cursor: col-resize; position: relative;
  margin: 0 3px;
}
.pt-split::before {
  content: ''; position: absolute; left: 2px; top: 0; bottom: 0; width: 1px;
  background: var(--p-border); transition: background .12s, width .12s, left .12s;
}
.pt-split:hover::before, .pt-split.dragging::before { background: var(--p-primary); width: 2px; left: 1.5px; }
.pt-right {
  flex: none; width: 360px; min-width: 240px; max-width: 620px;
  background: var(--p-card); border: 1px solid var(--p-border); border-radius: 8px;
  display: flex; flex-direction: column; overflow: hidden;
}

/* ---- 待办卡片（方案 FR-T5，序号即解剖顺序） ---- */
.pt-card {
  position: relative; display: flex; align-items: flex-start;
  background: var(--p-card); border: 1px solid var(--p-border); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.pt-card:hover { background: var(--p-hover); border-color: color-mix(in srgb, var(--cc, var(--p-border)) 25%, var(--p-border)); }
.pt-card.sel { background: var(--p-sel); border-color: color-mix(in srgb, var(--cc, var(--p-border)) 50%, var(--p-border)); }
.pt-card.flash { animation: ptFlash 1.8s ease; }
@keyframes ptFlash {
  0%, 40% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--p-primary) 60%, transparent); }
  100% { box-shadow: none; }
}
.pt-card-bar {
  position: absolute; left: 3px; top: 7px; bottom: 7px; width: 3px;
  border-radius: 2px; background: var(--cc, var(--tc-blue));
}
/* ② 复选框 22px */
.pt-checkbox {
  position: relative;
  flex: none; width: 22px; height: 22px; margin-left: 11px; margin-top: 0;
  border-radius: 5px; border: 1.4px solid var(--cc, var(--tc-blue));
  background: transparent; padding: 0; cursor: pointer;
  display: grid; place-items: center; color: transparent;
  transition: background .12s, border-color .12s, color .12s;
}
.pt-checkbox:hover { background: color-mix(in srgb, var(--cc, var(--tc-blue)) 18%, transparent); }
.pt-checkbox.done { background: var(--p-green); border-color: var(--p-green); color: #FFFFFF; }
.pt-checkbox .ic { width: 13px; height: 13px; }
/* 触屏上 22px 太难戳：热区扩到 40×40，视觉尺寸不变 */
.pt-checkbox::after { content: ''; position: absolute; inset: -9px; border-radius: 10px; }
.pt-card-body { flex: 1; min-width: 0; margin-left: 10px; margin-right: 96px; }
/* ③ 标题（3 行截断） */
.pt-card-title {
  font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--p-text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.pt-card.done .pt-card-title { color: var(--p-faint); text-decoration: line-through; }
/* ④ chips 行 */
.pt-chips { display: flex; gap: 5px; margin-top: 6px; overflow: hidden; white-space: nowrap; }
.pt-chip {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  height: 21px; padding: 0 8px; border-radius: 11px; font-size: 12px;
  line-height: 1; white-space: nowrap;
}
.pt-chip .ic { width: 12px; height: 12px; }
/* ⑤ 详情行 */
.pt-card-detail {
  margin-top: 6px; font-size: 11.5px; color: var(--p-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* ⑥ 附件缩略图行 */
.pt-files { display: flex; gap: 5px; margin-top: 7px; align-items: center; }
.pt-thumb {
  flex: none; width: 26px; height: 26px; border-radius: 5px; overflow: hidden;
  border: 1px solid var(--p-border); background: var(--p-field);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  font-size: 8px; font-weight: 700; color: #FFF;
}
.pt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pt-thumb.more { color: var(--p-muted); font-size: 9px; font-weight: 600; background: var(--p-field); }
/* ⑦ 右上角 3 圆钮（26px，仅整卡悬停显底） */
.pt-card-ops {
  position: absolute; right: 14px; top: 10px; display: flex; gap: 4px;
}
.pt-op {
  position: relative;
  width: 26px; height: 26px; border: 0; border-radius: 7px; padding: 0;
  background: transparent; color: var(--p-muted); cursor: pointer;
  display: grid; place-items: center; transition: background .12s, color .12s;
}
.pt-op .ic { width: 16px; height: 16px; }
.pt-op::after { content: ''; position: absolute; inset: -6px; border-radius: 9px; }
.pt-card:hover .pt-op { background: color-mix(in srgb, var(--p-text) 7%, transparent); }
.pt-op:hover { background: var(--p-border) !important; color: var(--p-text); }

/* 空态（方案 §6.2 文案照抄） */
.pt-empty {
  padding: 56px 20px; text-align: center; color: var(--p-faint);
  font-size: 12.5px; line-height: 1.9; white-space: pre-line;
}

/* ============================ 三、右栏 · 矩阵 ============================ */

.pt-mx { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pt-mx-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px 6px; flex: none;
}
.pt-mx-head .t { font-size: 12.5px; font-weight: 700; }
.pt-mx-head .h { font-size: 11.5px; color: var(--p-faint); }
.pt-mx-grid {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  gap: 3px; padding: 0 14px 10px;
}
.pt-mx-cell {
  border: 1px solid var(--p-border); border-radius: 6px;
  display: flex; flex-direction: column; overflow: hidden; min-height: 0;
  transition: background .12s;
}
.pt-mx-cell.droptarget { background: color-mix(in srgb, var(--p-primary) 10%, var(--p-card)); }
.pt-mx-ch {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 6px;
}
.pt-mx-ch .bar { width: 3px; height: 12px; border-radius: 2px; flex: none; }
.pt-mx-ch .nm { font-size: 11.5px; font-weight: 700; }
.pt-mx-ch .n { margin-left: auto; font-size: 11.5px; color: var(--p-faint); font-variant-numeric: tabular-nums; }
.pt-mx-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 5px 5px; }
.pt-mx-body::-webkit-scrollbar { width: 6px; }
.pt-mx-body::-webkit-scrollbar-thumb { background: var(--p-border-hot); border-radius: 3px; }
.pt-mx-empty { text-align: center; color: var(--p-faint); font-size: 11.5px; padding: 10px 0; }
.pt-mx-item {
  display: flex; align-items: stretch; background: var(--p-field);
  border-radius: 5px; margin: 3px 0; cursor: pointer;
  transition: background .12s; user-select: none;
}
.pt-mx-item:hover { background: var(--p-hover); }
.pt-mx-item.sel { background: var(--p-sel); }
.pt-mx-item.dragging { opacity: .45; }
.pt-mx-item .bar { width: 3px; border-radius: 5px 0 0 5px; flex: none; background: var(--cc, var(--tc-blue)); }
.pt-mx-item .in { flex: 1; min-width: 0; padding: 4px 7px 4px 6px; }
.pt-mx-item .t { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-mx-item .d { font-size: 11.5px; margin-top: 1px; }
.pt-mx-un { flex: none; padding: 0 14px 8px; }
.pt-mx-un .lb { font-size: 11.5px; font-weight: 700; color: var(--p-muted); margin-bottom: 5px; }
.pt-mx-un .chips { display: flex; gap: 4px; overflow: hidden; align-items: center; }
.pt-un-chip {
  flex: none; height: 22px; padding: 0 9px; border-radius: 11px; border: 0;
  font-size: 11.5px; cursor: pointer; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pt-mx-un .more { color: var(--p-faint); font-size: 11.5px; flex: none; }
/* ---- 触屏：清单卡片左滑（查看 / 编辑 / 删除） ---- */
.pt-swipe { position: relative; margin-bottom: 8px; border-radius: 8px; overflow: hidden; }
.pt-swipe .pt-card { margin-bottom: 0; }
.pt-swipe-acts { position: absolute; top: 0; right: 0; bottom: 0; display: none; }
body.is-phone .pt-swipe-acts, body.is-tablet .pt-swipe-acts, body.is-touch .pt-swipe-acts { display: flex; }
.pt-swipe-acts .pt-sw {
  width: 64px; border: 0; padding: 0; color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; letter-spacing: .3px;
}
.pt-swipe-acts .pt-sw { transition: filter .12s, transform .08s; }
.pt-swipe-acts .pt-sw:active { filter: brightness(1.25); transform: scale(.96); }
.pt-sw.v { background: var(--p-primary); }
.pt-sw.e { background: #5A6270; }
.pt-sw.d { background: var(--p-red); }
.pt-swipe .pt-card {
  position: relative; z-index: 1;
  touch-action: pan-y;                     /* 竖向滚动交给浏览器，横向留给左滑 */
}
/* 操作区从右侧滑进来盖在卡片上（卡片本身不动，避免内容被裁掉左边） */
.pt-swipe-acts { transform: translateX(100%); transition: transform .22s cubic-bezier(.22, .8, .24, 1); z-index: 2; }
body.is-phone .pt-swipe.open .pt-swipe-acts,
body.is-tablet .pt-swipe.open .pt-swipe-acts,
body.is-touch .pt-swipe.open .pt-swipe-acts { transform: none; }
body.is-phone .pt-swipe.dragging .pt-swipe-acts,
body.is-tablet .pt-swipe.dragging .pt-swipe-acts,
body.is-touch .pt-swipe.dragging .pt-swipe-acts { transition: none; }
/* 平板 / 触屏宽屏：展开后卡片右侧留出按钮位置，正文重新排版（手机留位置会把字挤成竖排，故用覆盖式） */
body.is-tablet .pt-swipe.open .pt-card { padding-right: 204px; }
body.is-phone .pt-swipe.open .pt-card-ops,
body.is-tablet .pt-swipe.open .pt-card-ops,
body.is-touch .pt-swipe.open .pt-card-ops { opacity: 0; pointer-events: none; transition: opacity .12s; }
.pt-swipe-acts::before {
  content: ''; position: absolute; left: -10px; top: 0; bottom: 0; width: 10px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.28));
}

/* ---- 矩阵拖拽：锁选区 + 落点提示 ---- */
.pt-mx-item, .pt-un-chip { touch-action: none; -webkit-user-select: none; user-select: none; }
body.pt-grabbing, body.pt-grabbing * {
  -webkit-user-select: none !important; user-select: none !important;
}
body.pt-grabbing { cursor: grabbing; }
.pt-mx-cell { transition: background .12s, box-shadow .12s; }
.pt-mx-cell.droptarget {
  background: color-mix(in srgb, var(--p-primary) 14%, transparent);
  box-shadow: inset 0 0 0 2px var(--p-primary);
}

/* ---- 待办详情（查看） ---- */
.pt-dl-title { font-size: 15.5px; font-weight: 700; line-height: 1.45; }
.pt-dl-k { margin-top: 12px; font-size: 11.5px; color: var(--p-muted); }
.pt-dl-v { margin-top: 4px; font-size: 13px; line-height: 1.7; color: var(--p-text); }

.pt-drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none; will-change: transform;
  background: var(--p-card); border: 1px solid var(--p-primary); border-radius: 6px;
  padding: 4px 10px; font-size: 11.5px; color: var(--p-text);
  box-shadow: 0 6px 18px rgba(0,0,0,.45); max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============================ 四、右栏 · 日历 ============================ */

.pt-cal { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pt-cal-head {
  flex: none; display: flex; align-items: center; padding: 10px 14px 6px;
}
.pt-cal-head .t { font-size: 12.5px; font-weight: 700; }
.pt-cal-nav { margin-left: auto; display: flex; gap: 3px; }
.pt-cal-btn {
  width: 24px; height: 24px; border: 0; border-radius: 6px; padding: 0;
  background: transparent; color: var(--p-muted); cursor: pointer;
  display: grid; place-items: center; transition: background .12s, color .12s;
}
.pt-cal-btn .ic { width: 15px; height: 15px; }
.pt-cal-btn:hover { background: var(--p-field); color: var(--p-text); }
.pt-cal-grid {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(40px, 1fr);
  padding: 0 14px 10px; gap: 2px;
}
.pt-cal-w {
  text-align: center; font-size: 11.5px; color: var(--p-muted);
  align-self: center; height: 22px; line-height: 22px;
}
.pt-cal-w.we { color: var(--p-red); }
.pt-cal-cell {
  position: relative; border: 1px solid var(--p-border); border-radius: 6px;
  background: var(--p-card); cursor: pointer; overflow: hidden;
  transition: background .12s, border-color .12s; min-height: 40px;
}
.pt-cal-cell:hover { background: var(--p-hover); }
.pt-cal-cell.blank { background: transparent; border-color: color-mix(in srgb, var(--p-border) 50%, transparent); cursor: default; }
.pt-cal-cell.blank:hover { background: transparent; }
.pt-cal-cell.sel { background: var(--p-sel); }
.pt-cal-cell.today { background: var(--p-field); border-color: var(--p-primary); }
.pt-cal-cell.today.sel { background: var(--p-sel); }
.pt-cal-cell .num {
  position: absolute; left: 6px; top: 3px; font-size: 11.5px;
  color: var(--p-muted); font-variant-numeric: tabular-nums;
}
.pt-cal-cell.has .num { color: var(--p-text); }
.pt-cal-cell.today .num { color: var(--p-primary); font-weight: 700; }
.pt-cal-dots {
  position: absolute; left: 4px; right: 4px; bottom: 5px;
  display: flex; justify-content: center; align-items: center; gap: 2.4px;
  overflow: hidden; height: 7px;
}
.pt-dot {
  flex: none; width: var(--d, 6.4px); height: var(--d, 6.4px);
  border-radius: 50%; background: var(--cc, var(--tc-blue));
}

/* ============================ 五、右栏切换等 ============================ */

.pt-placeholder {
  flex: 1; display: flex; align-items: center; justify-content: center;
}
.pt-placeholder .box {
  text-align: center; color: var(--p-muted); font-size: 13px;
  background: var(--p-card); border: 1px dashed var(--p-border-hot);
  border-radius: 12px; padding: 40px 56px; line-height: 2;
}
.pt-placeholder .box .big { font-size: 15px; font-weight: 600; color: var(--p-text); }
.pt-placeholder .box .sm { font-size: 12px; color: var(--p-faint); }

/* ============================ 六、弹窗（方案 §5.7） ============================ */

#modal-box.pt-wide { width: min(720px, 100%); }
#modal-box.pt-mid { width: min(520px, 100%); }
#modal-box.pt-small { width: min(430px, 100%); }

.pt-dialog { }
.pt-dialog-head {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--p-border);
}
.pt-dialog-head .badge {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: color-mix(in srgb, var(--p-primary) 15%, transparent);
  color: var(--p-primary); display: grid; place-items: center; margin-top: 1px;
}
.pt-dialog-head .badge .ic { width: 16px; height: 16px; }
.pt-dialog-head .tt { font-size: 15px; font-weight: 650; color: var(--text); }
.pt-dialog-head .st { font-size: 11.5px; color: var(--text3); margin-top: 2px; white-space: pre-line; }
.pt-dialog-head .modal-x { margin-left: auto; }
.pt-dialog-body { padding: 16px 20px 4px; max-height: calc(84vh - 190px); overflow-y: auto; }
.pt-dialog-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 14px 20px 18px;
}

/* 分组小标题 */
.pt-group {
  font-size: 12px; font-weight: 700; color: var(--p-muted);
  margin: 6px 0 10px; letter-spacing: .5px;
}
.pt-group:not(:first-child) { margin-top: 18px; border-top: 1px solid var(--p-border); padding-top: 16px; }

/* 表单两列 */
.pt-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.pt-form .full { grid-column: 1 / -1; }
.pt-fld { display: grid; grid-template-columns: 88px 1fr; align-items: start; gap: 8px; }
.pt-fld > label {
  font-size: 12px; color: var(--p-muted); text-align: right;
  padding-top: 9px; line-height: 1.3;
}
.pt-fld > label b { color: var(--p-red); font-weight: 600; }
.pt-fld input[type="text"], .pt-fld input[type="number"], .pt-fld select, .pt-fld textarea {
  width: 100%; background: var(--p-field); border: 1px solid var(--p-border);
  border-radius: 7px; color: var(--p-text); padding: 8px 10px; font-size: 13px;
  outline: none; transition: border-color .15s;
}
.pt-fld textarea { resize: vertical; min-height: 56px; line-height: 1.5; }
.pt-fld input:focus, .pt-fld select:focus, .pt-fld textarea:focus { border-color: var(--p-primary); }
.pt-fld .tip { font-size: 11px; color: var(--p-faint); margin-top: 4px; }
.pt-inline { display: flex; gap: 6px; align-items: center; }
.pt-inline .grow { flex: 1; min-width: 0; }

/* 快速片（日期 / 时间） */
.pt-quickrow { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.pt-quick {
  height: 24px; padding: 0 9px; border-radius: 6px; cursor: pointer;
  background: var(--p-field); border: 1px solid var(--p-border);
  color: var(--p-muted); font-size: 11.5px; transition: border-color .12s, color .12s;
}
.pt-quick:hover { border-color: var(--p-border-hot); color: var(--p-text); }

/* bool 开关（全天） */
.pt-bool { display: inline-flex; align-items: center; gap: 8px; padding-top: 7px; cursor: pointer; }
.pt-bool input { display: none; }
.pt-bool .sw {
  width: 34px; height: 19px; border-radius: 10px; background: var(--p-border);
  position: relative; transition: background .15s;
}
.pt-bool .sw::after {
  content: ''; position: absolute; top: 2.5px; left: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: #FFF; transition: left .15s;
}
.pt-bool input:checked + .sw { background: var(--p-green); }
.pt-bool input:checked + .sw::after { left: 17px; }
.pt-bool .lb { font-size: 12.5px; color: var(--p-text); }

/* dialog 按钮（方案 §5.7：取消红实底 / 保存主色实底） */
.pt-dbtn {
  height: 32px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: filter .12s;
}
.pt-dbtn.primary { background: var(--p-primary); border-color: var(--p-primary); color: var(--p-on-primary); font-weight: 600; }
.pt-dbtn.primary:hover { filter: brightness(1.08); }
.pt-dbtn.cancel { background: var(--p-red); border-color: var(--p-red); color: var(--p-on-primary); }
[data-theme="dark"] .pt-dbtn.cancel { color: #1A0E0E; }
.pt-dbtn.cancel:hover { filter: brightness(1.08); }
.pt-dbtn.ghost { background: var(--p-field); border-color: var(--p-border); color: var(--p-text); }
.pt-dbtn.ghost:hover { border-color: var(--p-border-hot); }

/* 附件区（编辑弹窗内） */
.pt-attach { display: flex; flex-direction: column; gap: 8px; }
.pt-attach-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-attach-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  background: var(--p-field); border: 1px solid var(--p-border); border-radius: 8px;
  max-width: 100%;
}
.pt-attach-item .pv {
  width: 34px; height: 34px; border-radius: 6px; overflow: hidden; flex: none;
  display: grid; place-items: center; font-size: 9px; font-weight: 700; color: #FFF;
  border: 1px solid var(--p-border); background: var(--p-card);
}
.pt-attach-item .pv img { width: 100%; height: 100%; object-fit: cover; }
.pt-attach-item .nm {
  font-size: 12px; max-width: 220px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.pt-attach-item .sz { font-size: 11px; color: var(--p-faint); }
.pt-attach-item .rm {
  width: 22px; height: 22px; border: 0; border-radius: 6px; background: transparent;
  color: var(--p-muted); cursor: pointer; display: grid; place-items: center; padding: 0;
}
.pt-attach-item .rm:hover { color: var(--p-red); background: color-mix(in srgb, var(--p-red) 12%, transparent); }
.pt-attach-add {
  height: 32px; padding: 0 12px; border-radius: 7px; cursor: pointer;
  border: 1px dashed var(--p-border-hot); background: transparent; color: var(--p-muted);
  font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; width: fit-content;
}
.pt-attach-add:hover { color: var(--p-text); border-color: var(--p-primary); }

/* 检查项弹窗 */
.pt-ck-add { display: flex; gap: 8px; margin-bottom: 12px; }
.pt-ck-add input {
  flex: 1; background: var(--p-field); border: 1px solid var(--p-border);
  border-radius: 7px; color: var(--p-text); padding: 8px 10px; font-size: 13px; outline: none;
}
.pt-ck-add input:focus { border-color: var(--p-primary); }
.pt-ck-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.pt-ck-row {
  display: flex; align-items: center; gap: 9px; background: var(--p-card);
  border: 1px solid var(--p-border); border-radius: 8px; padding: 7px 10px;
}
.pt-ck-check {
  width: 18px; height: 18px; flex: none; border-radius: 5px; padding: 0; cursor: pointer;
  border: 1.4px solid var(--p-muted); background: transparent; color: transparent;
  display: grid; place-items: center;
}
.pt-ck-check .ic { width: 11px; height: 11px; }
.pt-ck-check:hover { border-color: var(--p-green); }
.pt-ck-check.done { background: var(--p-green); border-color: var(--p-green); color: #FFF; }
.pt-ck-row .tx { flex: 1; min-width: 0; font-size: 13px; word-break: break-word; }
.pt-ck-row.done .tx { color: var(--p-faint); text-decoration: line-through; }
.pt-ck-row .rm {
  width: 22px; height: 22px; flex: none; border: 0; border-radius: 6px;
  background: transparent; color: var(--p-muted); cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.pt-ck-row .rm:hover { color: var(--p-red); background: color-mix(in srgb, var(--p-red) 12%, transparent); }
.pt-ck-progress { margin-top: 12px; font-size: 12px; color: var(--p-muted); }
.pt-ck-empty { text-align: center; color: var(--p-faint); font-size: 12.5px; padding: 18px 0; }

/* 消息框 / 确认框正文 */
.pt-msg { font-size: 13px; line-height: 1.8; color: var(--p-text); white-space: pre-line; }

/* ============================ 七、右键菜单 / 提示气泡 ============================ */

.pt-menu {
  position: fixed; z-index: 110; min-width: 172px;
  background: var(--p-card); border: 1px solid var(--p-border-hot);
  border-radius: 9px; padding: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  animation: ptMenuIn .12s ease;
}
@keyframes ptMenuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pt-menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 10px; border: 0; border-radius: 6px; background: transparent;
  color: var(--p-text); font-size: 12.5px; cursor: pointer; text-align: left;
  white-space: nowrap;
}
.pt-menu-item .ic { width: 14px; height: 14px; color: var(--p-muted); flex: none; }
.pt-menu-item:hover { background: var(--p-field); }
.pt-menu-item.danger { color: var(--p-red); }
.pt-menu-item.danger .ic { color: var(--p-red); }
.pt-menu-sep { height: 1px; background: var(--p-border); margin: 4px 8px; }
.pt-menu-label {
  padding: 6px 10px 3px; font-size: 11px; color: var(--p-faint);
  letter-spacing: .5px; cursor: default;
}

.pt-tip {
  position: fixed; z-index: 130; pointer-events: none;
  background: #262626; color: #EDEDED; border: 1px solid #3A3A3A;
  border-radius: 7px; padding: 6px 10px; font-size: 11.5px;
  max-width: 380px; line-height: 1.6; box-shadow: 0 8px 22px rgba(0,0,0,.4);
  white-space: pre-line; display: none;
}
[data-theme="light"] .pt-tip { background: #303030; }

/* 图片大图预览（深色查看器，方案 FR-K14 的清单版） */
.pt-lightbox {
  position: fixed; inset: 0; z-index: 140; background: rgba(0,0,0,.86);
  display: none; align-items: center; justify-content: center; cursor: zoom-out;
}
.pt-lightbox.open { display: flex; }
.pt-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.pt-lightbox .cap {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: #CFCFCF; font-size: 12.5px; background: rgba(0,0,0,.5);
  padding: 6px 14px; border-radius: 8px;
}

/* 文件列表弹窗（+N 展开） */
.pt-fl-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--p-border); border-radius: 8px; margin-bottom: 6px; }
.pt-fl-row .pv { width: 30px; height: 30px; border-radius: 6px; overflow: hidden; flex: none; display: grid; place-items: center; font-size: 8.5px; font-weight: 700; color: #FFF; border: 1px solid var(--p-border); }
.pt-fl-row .pv img { width: 100%; height: 100%; object-fit: cover; }
.pt-fl-row .nm { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-fl-row .sz { font-size: 11px; color: var(--p-faint); flex: none; }
.pt-fl-row .op { flex: none; }

/* 响应式：窄屏右栏收窄 */
@media (max-width: 1100px) {
  .pt-right { width: 300px !important; }
}
@media (max-width: 860px) {
  .pt-module { height: auto; min-height: 0; }
  .pt-work { flex-direction: column; }
  .pt-right { width: 100% !important; max-width: none; margin-top: 10px; }
  .pt-split { display: none; }
}

/* ============================ 八、M3 首页（§5.4） ============================ */

.pt-home { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---- 问候条（92px） ---- */
.pt-hg {
  flex: none; height: 92px; background: var(--p-card);
  border: 1px solid var(--p-border); border-radius: 10px;
  display: flex; align-items: center; gap: 13px; padding: 0 16px;
}
.pt-mood {
  width: 50px; height: 50px; border-radius: 50%; border: 0; padding: 0;
  cursor: pointer; overflow: hidden; flex: none; background: transparent;
  transition: box-shadow .15s;
}
.pt-mood img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.pt-mood:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--p-primary) 55%, transparent); }
.pt-hg-main { flex: 1; min-width: 0; }
.pt-hg-row { display: flex; align-items: center; gap: 12px; }
.pt-hg-hello { font-size: 21px; font-weight: 700; }
.pt-hg-pills { margin-left: auto; display: flex; gap: 8px; }
.pt-hg-pill {
  height: 30px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--p-field); border-radius: 8px; font-size: 13px; color: var(--p-text);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pt-hg-pill .ic { color: var(--p-primary); width: 15px; height: 15px; }
.pt-hg-sub {
  margin-top: 7px; font-size: 12px; color: var(--p-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- 四指标卡（84px / 圆角 16） ---- */
.pt-hm { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.pt-mcard {
  height: 84px; background: var(--p-card); border: 1px solid var(--p-border);
  border-radius: 16px; display: flex; align-items: center; gap: 12px;
  padding: 0 14px; cursor: pointer; text-align: left;
  transition: background .15s, border-color .15s;
}
.pt-mcard:hover { background: color-mix(in srgb, var(--p-primary) 10%, var(--p-card)); border-color: var(--p-border-hot); }
.pt-mcard .ic {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: var(--mc, var(--p-primary));
  background: color-mix(in srgb, var(--mc, var(--p-primary)) 22%, var(--p-card));
}
.pt-mcard .tx { min-width: 0; display: flex; flex-direction: column; }
.pt-mcard .v { font-size: 20px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.pt-mcard .n { font-size: 12px; font-weight: 700; color: var(--p-muted); }
.pt-mcard .s { font-size: 11px; color: var(--p-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- 三栏工作区 ---- */
.pt-hw { flex: 1; min-height: 0; display: flex; margin-top: 10px; }
.pt-hcol { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pt-hcol.drop { background: color-mix(in srgb, var(--p-primary) 8%, transparent); border-radius: 12px; }
.pt-hsplit { flex: none; width: 6px; cursor: col-resize; position: relative; margin: 0 2px; }
.pt-hsplit::before {
  content: ''; position: absolute; left: 2.5px; top: 0; bottom: 0; width: 1px;
  background: var(--p-border); transition: background .12s, width .12s, left .12s;
}
.pt-hsplit:hover::before, .pt-hsplit.dragging::before { background: var(--p-primary); width: 2px; left: 2px; }

/* ---- 面板卡（圆角 10 / 内边 12） ---- */
.pt-hp {
  background: var(--p-card); border: 1px solid var(--p-border); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; min-width: 0;
  flex: 0 0 auto;
}
.pt-hcol .pt-hp:last-child { flex: 1 1 auto; min-height: 110px; }
.pt-hp-head { display: flex; align-items: center; gap: 6px; flex: none; }
.pt-hp-grip {
  color: var(--p-faint); font-size: 11px; cursor: grab; letter-spacing: -1px;
  padding: 0 2px; user-select: none;
}
.pt-hp-grip:hover { color: var(--p-text); }
.pt-hp-ic { display: inline-flex; color: var(--p-primary); margin-left: 8px; }
.pt-hp-nm { font-size: 13px; font-weight: 700; }
.pt-hp-ops { margin-left: auto; display: flex; gap: 3px; }
.pt-hp-btn {
  width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent;
  color: var(--p-muted); display: grid; place-items: center; cursor: pointer;
  transition: background .12s, color .12s; padding: 0;
}
.pt-hp-btn:hover { background: color-mix(in srgb, var(--p-primary) 16%, transparent); color: var(--p-primary); }
.pt-hp-btn.primary { color: var(--p-primary); }
.pt-hp-body { flex: 1; min-height: 0; overflow-y: auto; margin-top: 8px; padding-right: 2px; }
.pt-hp-body::-webkit-scrollbar { width: 6px; }
.pt-hp-body::-webkit-scrollbar-thumb { background: var(--p-border-hot); border-radius: 3px; }
/* 非末位面板的正文本体限高（末位面板撑满整栏，见 §FR-H8） */
.pt-hp:not(:last-child) .pt-hp-body { max-height: 38vh; }
.pt-hp[data-pk="habit"] .pt-hp-body { max-height: 104px; }
.pt-hp-empty { text-align: center; color: var(--p-faint); font-size: 12px; padding: 26px 8px; }
.pt-hp-more { color: var(--p-faint); font-size: 11.5px; padding-top: 4px; }
.pt-hp-x {
  width: 22px; height: 22px; flex: none; border: 0; border-radius: 6px;
  background: transparent; color: transparent; display: grid; place-items: center;
  cursor: pointer; padding: 0; transition: color .12s, background .12s;
}
.pt-tl:hover .pt-hp-x, .pt-tlr:hover .pt-hp-x, .pt-hb:hover .pt-hp-x,
.pt-rc:hover .pt-hp-x, .pt-lt:hover .pt-hp-x { color: var(--p-faint); }
.pt-hp-x.always { color: var(--p-faint); }
.pt-hp-x:hover { color: var(--p-red) !important; background: color-mix(in srgb, var(--p-red) 12%, transparent); }
.pt-hpfiles { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }

/* ---- 待办时间线行（今日） ---- */
.pt-tl { display: flex; margin-bottom: 10px; }
.pt-tl-rail { position: relative; width: 44px; flex: none; }
.pt-tl-rail::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: -10px; width: 1.5px;
  background: color-mix(in srgb, var(--cc, var(--tc-blue)) 30%, var(--p-card));
}
.pt-tl-rail .dot {
  position: absolute; left: 4.5px; top: 13px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--cc, var(--tc-blue));
}
.pt-tl-rail .time { position: absolute; left: 17px; top: 9px; font-size: 11.5px; color: var(--p-muted); }
.pt-tl-card {
  flex: 1; min-width: 0; display: flex; gap: 7px; align-items: flex-start;
  background: var(--p-field); border: 1px solid var(--p-border); border-radius: 6px;
  padding: 8px 10px; cursor: pointer;
}
.pt-tl-card:hover { border-color: var(--p-border-hot); }
.pt-tl-main { flex: 1; min-width: 0; }
.pt-tl-title {
  font-size: 13px; line-height: 1.45; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
.pt-tl.done .pt-tl-title { color: var(--p-faint); text-decoration: line-through; }
.pt-tl-meta { font-size: 11.5px; color: var(--p-muted); margin-top: 3px; }

/* ---- 待办紧凑清单行（全部） ---- */
.pt-tlr {
  display: flex; align-items: flex-start; gap: 7px; background: var(--p-field);
  border-radius: 6px; margin-bottom: 8px; padding: 6px 8px 6px 0; cursor: pointer;
  position: relative;
}
.pt-tlr .bar {
  width: 3px; align-self: stretch; border-radius: 0 3px 3px 0;
  background: var(--cc, var(--tc-blue)); flex: none; margin-right: 4px;
}
.pt-tlr-mid { flex: 1; min-width: 0; }
.pt-tlr-title { font-size: 13px; line-height: 1.45; }
.pt-tlr.done .pt-tlr-title { color: var(--p-faint); text-decoration: line-through; }
.pt-tlr-due { font-size: 11.5px; flex: none; padding-top: 2px; }

/* ---- mini 复选框（16px） ---- */
.pt-mini-ck {
  width: 16px; height: 16px; flex: none; margin-top: 2px; border-radius: 5px;
  border: 1.3px solid var(--cc, var(--p-muted)); background: transparent;
  color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: background .12s, border-color .12s, color .12s;
}
.pt-mini-ck .ic { width: 11px; height: 11px; }
.pt-mini-ck:hover { border-color: var(--p-green); }
.pt-mini-ck.on { background: var(--p-green); border-color: var(--p-green); color: #FFF; }

/* ---- 长期任务卡 ---- */
.pt-lt {
  background: var(--p-field); border: 1px solid var(--p-border); border-radius: 8px;
  padding: 8px 9px; margin-bottom: 6px; cursor: pointer;
}
.pt-lt:hover { border-color: var(--p-border-hot); }
.pt-lt-head { display: flex; align-items: baseline; gap: 1px; }
.pt-lt-head .pct { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pt-lt-head .pctu { font-size: 11px; color: var(--p-muted); margin-right: 8px; }
.pt-lt-title {
  flex: 1; min-width: 0; font-size: 13px; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical; word-break: break-word;
}
.pt-lt-bar { height: 6px; border-radius: 3px; margin: 6px 0 4px; overflow: hidden; }
.pt-lt-bar > i { display: block; height: 100%; border-radius: 3px; transition: width .3s; }
.pt-lt-meta { font-size: 11.5px; color: var(--p-muted); }

/* ---- 习惯打卡 ---- */
.pt-hb-head { display: flex; align-items: center; gap: 6px; padding: 2px 0 3px; flex: none; }
.pt-hb-who { flex: 1; min-width: 0; }
.pt-hb-cells { display: flex; gap: 2px; flex: none; }
.pt-hd { width: 20px; text-align: center; font-size: 11px; color: var(--p-faint); display: inline-block; }
.pt-hd.we { color: var(--p-red); }
.pt-hd.today { color: var(--p-primary); font-weight: 700; }
.pt-hb { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.pt-hb .n { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-hb .s { font-size: 11px; color: var(--p-faint); }
.pt-hc {
  width: 20px; height: 20px; border-radius: 5px; border: 1px solid var(--p-border);
  background: transparent; color: transparent; display: grid; place-items: center;
  cursor: pointer; padding: 0; transition: background .12s, border-color .12s, color .12s;
}
.pt-hc .ic { width: 11px; height: 11px; }
.pt-hc.today { border-color: var(--p-primary); border-width: 1.4px; }
.pt-hc:hover { border-color: var(--p-border-hot); }
.pt-hc.on { background: var(--c, var(--p-primary)); border-color: var(--c, var(--p-primary)); color: #FFF; }
.pt-hp-xw { width: 22px; flex: none; }

/* ---- 生活记录行 ---- */
.pt-rc { display: flex; gap: 7px; align-items: flex-start; margin-bottom: 3px; padding: 3px 0; }
.pt-rc-mid { flex: 1; min-width: 0; }
.pt-rc-title { font-size: 13px; line-height: 1.5; word-break: break-word; }
.pt-rc.done .pt-rc-title { color: var(--p-faint); text-decoration: line-through; }

/* ---- 心情选择弹窗 ---- */
.pt-mood-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px 0 10px; }
.pt-mood-pick {
  border: 1.5px solid var(--p-border); border-radius: 10px; background: var(--p-field);
  padding: 10px 4px 7px; display: flex; flex-direction: column; align-items: center;
  gap: 6px; cursor: pointer; color: var(--p-muted); font-size: 12px;
}
.pt-mood-pick img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.pt-mood-pick:hover { border-color: var(--p-border-hot); color: var(--p-text); }
.pt-mood-pick.on { border-color: var(--p-primary); color: var(--p-primary); }

/* ---- 搜索结果行 / 全部列表行 ---- */
.pt-sr, .pt-alrow {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  background: var(--p-card); border: 1px solid var(--p-border); border-radius: 8px;
  padding: 8px 10px; margin-bottom: 5px; cursor: pointer; color: var(--p-text);
}
.pt-sr:hover, .pt-alrow:hover { border-color: var(--p-border-hot); }
.pt-sr .ic, .pt-alrow .ic { color: var(--p-primary); flex: none; display: inline-flex; }
.pt-sr .mid, .pt-alrow .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pt-sr .t, .pt-alrow .t { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-sr .s, .pt-alrow .s { font-size: 11px; color: var(--p-muted); }
.pt-alrow .pt-hp-x { color: var(--p-faint); }

/* ---- 首页响应式（方案 §5.9） ---- */
@media (max-width: 1024px) {
  .pt-hw { flex-direction: column; }
  .pt-hsplit { display: none; }
  .pt-hcol { width: 100%; }
  .pt-hm { grid-template-columns: repeat(2, 1fr); }
}

/* ============================ 九、补充：分类筛选 / 菜单配色 / 弹层 ============================ */

/* 分类筛选下拉（统计条内） */
.pt-catsel {
  height: 28px; max-width: 160px; background: var(--p-field);
  border: 1px solid var(--p-border); border-radius: 8px; color: var(--p-text);
  font-size: 12px; padding: 0 6px; outline: none; cursor: pointer;
}
.pt-catsel:hover { border-color: var(--p-border-hot); }
.pt-catsel option { background: var(--p-card); color: var(--p-text); }

/* 右键菜单里带颜色的项：图标跟随文字色 */
.pt-menu-item.c .ic { color: inherit; }

/* 未归类：换行铺开（不再被裁掉），超高可滚动 */
.pt-mx-un .chips {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-start;
  max-height: 80px; overflow-y: auto; overflow-x: hidden;
}
.pt-mx-un .chips::-webkit-scrollbar { width: 6px; }
.pt-mx-un .chips::-webkit-scrollbar-thumb { background: var(--p-border-hot); border-radius: 3px; }
.pt-un-chip { max-width: 152px; }

/* ---- 弹出层：日历选择器 / 快捷时间 ---- */
.pt-pop {
  position: fixed; z-index: 125; background: var(--p-card);
  border: 1px solid var(--p-border-hot); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .5); padding: 12px;
  animation: ptMenuIn .12s ease;
}
.pt-pop-cal { width: 268px; }
.pt-dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pt-dp-head .tt { font-size: 13px; font-weight: 700; }
.pt-dp-nav {
  width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent;
  color: var(--p-muted); cursor: pointer; display: grid; place-items: center;
}
.pt-dp-nav:hover { background: var(--p-field); color: var(--p-text); }
.pt-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.pt-dp-w { text-align: center; font-size: 11px; color: var(--p-faint); padding: 2px 0 4px; }
.pt-dp-w.we { color: var(--p-red); }
.pt-dp-cell {
  height: 30px; border: 0; background: transparent; border-radius: 6px;
  color: var(--p-text); font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.pt-dp-cell:hover { background: var(--p-field); }
.pt-dp-cell.today { color: var(--p-primary); font-weight: 700; }
.pt-dp-cell.sel { background: var(--p-primary); color: var(--p-on-primary); font-weight: 700; }
.pt-dp-foot { display: flex; gap: 6px; margin-top: 8px; }

.pt-pop-time { width: 306px; }
.pt-tp-hd { font-size: 13.5px; font-weight: 700; }
.pt-tp-sub { font-size: 11.5px; color: var(--p-faint); margin-top: 2px; }
.pt-tp-row { display: flex; align-items: center; gap: 8px; margin: 10px 0 4px; }
.pt-tp-now {
  height: 24px; padding: 0 10px; border: 1px solid var(--p-primary); background: var(--p-primary);
  color: var(--p-on-primary); border-radius: 6px; font-size: 11.5px; cursor: pointer; font-weight: 600;
}
.pt-tp-now:hover { filter: brightness(1.08); }
.pt-tp-row .cur { margin-left: auto; font-size: 11px; color: var(--p-faint); }
.pt-tp-sec { font-size: 11.5px; color: var(--p-muted); margin: 8px 0 5px; }
.pt-tp-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; max-height: 128px; overflow-y: auto; }
.pt-tp-grid::-webkit-scrollbar { width: 6px; }
.pt-tp-grid::-webkit-scrollbar-thumb { background: var(--p-border-hot); border-radius: 3px; }
.pt-tp-slot {
  height: 26px; border-radius: 6px; background: var(--p-field); border: 1px solid var(--p-border);
  color: var(--p-text); font-size: 11.5px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.pt-tp-slot:hover { border-color: var(--p-primary); color: var(--p-primary); }
.pt-tp-slot.on { background: color-mix(in srgb, var(--p-primary) 18%, transparent); border-color: var(--p-primary); color: var(--p-primary); }

/* ============================ 十、M4 生活记录整页（§5.5） ============================ */

.pt-life { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pt-lstats { margin-top: 0; }
.pt-lcard { cursor: default; }
.pt-lcard:hover { background: var(--p-card); border-color: var(--p-border); }
.pt-lcols { flex: 1; min-height: 0; display: flex; gap: 14px; margin-top: 14px; }
.pt-lcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pt-lcol1 { flex: 0 0 25%; }
.pt-lcol2 { flex: 1 1 50%; }
.pt-lcol3 { flex: 0 0 25%; }
.pt-lpanel { padding: 12px 14px; }
.pt-lcol .pt-lpanel:last-child { flex: 1 1 auto; min-height: 120px; }
.pt-lsub { font-size: 11.5px; color: var(--p-faint); margin-left: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-hp-btn.sq { background: var(--p-primary); color: var(--p-on-primary); border-radius: 7px; }
.pt-hp-btn.sq:hover { background: var(--p-primary); color: var(--p-on-primary); filter: brightness(1.08); }

/* 月历 */
.pt-lc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 6px; }
.pt-lc-w { text-align: center; font-size: 11px; color: var(--p-faint); }
.pt-lc-w.we { color: var(--p-red); }
.pt-lc-cell {
  position: relative; height: 30px; border: 0; background: transparent; border-radius: 6px;
  color: var(--p-text); font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.pt-lc-cell:hover { background: var(--p-field); }
.pt-lc-cell.blank { cursor: default; }
.pt-lc-cell.blank:hover { background: transparent; }
.pt-lc-cell.sel { background: var(--p-sel); color: var(--p-primary); font-weight: 700; }
.pt-lc-cell.today { color: var(--p-green); font-weight: 700; }
.pt-lc-cell .dots { position: absolute; bottom: 1px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; height: 5px; }
.pt-lc-cell .dots i { width: 4px; height: 4px; border-radius: 50%; display: inline-block; }
.pt-lc-cell .dots i.g { background: var(--p-green); }
.pt-lc-cell .dots i.m { background: var(--p-faint); }
.pt-lc-legend { display: flex; gap: 12px; font-size: 11px; color: var(--p-faint); margin-top: 6px; }
.pt-lc-legend i { display: inline-block; width: 5px; height: 5px; border-radius: 50%; margin-right: 4px; }
.pt-lc-legend i.g { background: var(--p-green); }
.pt-lc-legend i.m { background: var(--p-faint); }

/* 生活记录列表 */
.pt-lr { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }
.pt-lr .pt-mini-ck { width: 18px; height: 18px; }
.pt-lr .pt-mini-ck .ic { width: 12px; height: 12px; }
.pt-lr-mid { flex: 1; min-width: 0; }
.pt-lr-title { font-size: 13px; line-height: 1.5; word-break: break-word; }
.pt-lr.done .pt-lr-title { color: var(--p-faint); text-decoration: line-through; }

/* 这一天 · 时间轴 */
.pt-tllist { padding-right: 4px; }
.pt-tlrow { display: flex; align-items: flex-start; min-height: 30px; margin-bottom: 2px; }
.pt-tlrow .t {
  width: 44px; flex: none; text-align: right; padding-right: 8px;
  font-size: 11.5px; color: var(--p-faint); line-height: 30px; font-variant-numeric: tabular-nums;
}
.pt-tlrow .line { width: 2px; flex: none; align-self: stretch; margin: 5px 8px 5px 0; border-radius: 1px; background: var(--lc, var(--p-border)); opacity: .6; }
.pt-tlrow .val {
  flex: 1; min-width: 0; font-size: 12.5px; line-height: 20px; padding: 5px 8px;
  border: 1px solid transparent; border-radius: 6px; cursor: text; color: var(--p-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pt-tlrow .val:hover { background: var(--p-field); }
.pt-tlrow .val.empty { color: var(--p-faint); }
.pt-tl-edit {
  flex: 1; min-width: 0; font: inherit; font-size: 12.5px; line-height: 1.55; resize: none;
  overflow: hidden; background: var(--p-field); border: 1px solid var(--p-primary);
  border-radius: 6px; color: var(--p-text); padding: 5px 8px; outline: none;
}

/* 今日心情 */
.pt-lmood { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 10px 0 2px; }
.pt-mood-nav {
  width: 28px; height: 28px; flex: none; border: 0; border-radius: 50%; cursor: pointer;
  background: color-mix(in srgb, var(--p-primary) 12%, transparent);
  color: var(--p-text); font-size: 16px; line-height: 1; display: grid; place-items: center;
  transition: background .12s;
}
.pt-mood-nav:hover { background: color-mix(in srgb, var(--p-primary) 22%, transparent); }
.pt-mood-big { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; padding: 0; }
.pt-mood-big img { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; display: block; }
.pt-mood-big .nm { font-size: 12.5px; color: var(--p-muted); }
.pt-lmood-hint { text-align: center; font-size: 11px; color: var(--p-faint); min-height: 15px; }

/* 小习惯 */
.pt-lhb-head, .pt-lhb { display: flex; align-items: center; gap: 6px; }
.pt-lhb-head { padding: 2px 0 3px; }
.pt-lhb { margin-bottom: 6px; }
.pt-lhb .who { flex: 1; min-width: 0; }
.pt-lhb .n { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-lhb .s { font-size: 11px; color: var(--p-faint); }
.pt-lhb .cells { display: flex; gap: 2px; flex: none; }
.pt-lhb .xw { width: 0; }

/* 生活记录整页响应式 */
@media (max-width: 1280px) {
  .pt-lcol1, .pt-lcol3 { flex: 0 0 27%; }
}
@media (max-width: 1024px) {
  .pt-lcols { flex-direction: column; }
  .pt-lcol1, .pt-lcol2, .pt-lcol3 { flex: 1 1 auto; }
}

/* ============================ 十一、M6：分类组合框 / 附件总线 / 细节 ============================ */

/* ---- 分类组合框（智能下拉：选中 / 重命名 / 删除 / 新增） ---- */
.pt-combo { position: relative; display: flex; align-items: center; }
.pt-combo input { flex: 1; min-width: 0; padding-right: 30px !important; cursor: pointer; }
.pt-combo-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: 0; border-radius: 5px; background: transparent;
  color: var(--p-muted); cursor: pointer; display: grid; place-items: center;
}
.pt-combo-btn:hover { background: var(--p-border); color: var(--p-text); }
.pt-pop-combo { width: 236px; padding: 8px; }
.pt-cb-tip { font-size: 10.5px; color: var(--p-faint); padding: 2px 6px 8px; }
.pt-cb-list { max-height: 240px; overflow-y: auto; }
.pt-cb-list::-webkit-scrollbar { width: 6px; }
.pt-cb-list::-webkit-scrollbar-thumb { background: var(--p-border-hot); border-radius: 3px; }
.pt-cb-item { display: flex; align-items: center; gap: 4px; border-radius: 6px; }
.pt-cb-item:hover { background: var(--p-field); }
.pt-cb-item.on { background: color-mix(in srgb, var(--p-primary) 14%, transparent); }
.pt-cb-pick {
  flex: 1; min-width: 0; text-align: left; border: 0; background: transparent;
  color: var(--p-text); font-size: 12.5px; padding: 7px 8px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pt-cb-pick .n { color: var(--p-faint); font-size: 11px; }
.pt-cb-ops { display: flex; gap: 2px; padding-right: 4px; opacity: 0; transition: opacity .12s; }
.pt-cb-item:hover .pt-cb-ops { opacity: 1; }
.pt-cb-op {
  width: 22px; height: 22px; border: 0; border-radius: 5px; background: transparent;
  color: var(--p-muted); cursor: pointer; display: grid; place-items: center;
}
.pt-cb-op:hover { background: var(--p-border); color: var(--p-text); }
.pt-cb-op.danger:hover { color: var(--p-red); background: color-mix(in srgb, var(--p-red) 12%, transparent); }
.pt-cb-add {
  width: 100%; margin-top: 6px; height: 28px; border: 1px dashed var(--p-border-hot);
  border-radius: 6px; background: transparent; color: var(--p-muted); cursor: pointer;
  font-size: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.pt-cb-add:hover { color: var(--p-primary); border-color: var(--p-primary); }
/* 行内改名 / 行内确认删除 */
.pt-cb-item.editing, .pt-cb-item.confirming { background: var(--p-field); }
.pt-cb-item.editing .pt-cb-edit, .pt-cb-item.confirming .pt-cb-edit {
  flex: 1; min-width: 0; margin: 4px 4px 4px 6px; padding: 5px 7px;
  background: var(--p-card); border: 1px solid var(--p-primary); border-radius: 5px;
  color: var(--p-text); font-size: 12.5px; outline: none;
}
.pt-cb-item.confirming .pt-cb-warn { flex: 1; min-width: 0; padding: 7px 6px 7px 10px; font-size: 11.5px; color: var(--p-red); line-height: 1.45; }
.pt-cb-op.ok { color: var(--p-green); }
.pt-cb-op.ok:hover { background: color-mix(in srgb, var(--p-green) 14%, transparent); color: var(--p-green); }

/* ---- 附件：缺失红框「缺」（FR-A4）/ 拖放高亮 ---- */
.pt-thumb.missing, .pv.missing {
  border: 1.4px solid var(--p-red) !important; color: var(--p-red) !important;
  background: transparent !important; font-weight: 700;
}
.pt-attach.drop { outline: 1.5px dashed var(--p-primary); outline-offset: 4px; border-radius: 8px; }
/* 表单内附件缩略图 56px（FR-A7） */
.pt-attach-item .pv { width: 56px; height: 56px; font-size: 10px; }

/* ---- 心情图读取失败兜底 ---- */
.pt-mood.imgfail::after, .pt-mood-big.imgfail::after, .pt-mood-pick.imgfail::after {
  content: '图片读不出来'; font-size: 11px; color: var(--p-faint);
}
.pt-mood.imgfail img, .pt-mood-big.imgfail img, .pt-mood-pick.imgfail img { display: none; }
.pt-mood-big.imgfail { width: 150px; height: 150px; border-radius: 50%; background: var(--p-field); display: grid; place-items: center; }

/* ---- 侧栏底按钮一行 5 枚 ---- */
.foot-actions { flex-wrap: wrap; }
.foot-actions button { flex: 1 1 40px; font-size: 10.5px; }

/* ---- 焦点可见（键盘导航） ---- */
.pt-module button:focus-visible, .pt-module input:focus-visible, .pt-module select:focus-visible,
.pt-dialog button:focus-visible, .pt-dialog input:focus-visible, .pt-dialog select:focus-visible,
.pt-dialog textarea:focus-visible, .pt-pop button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--p-primary) 70%, transparent);
  outline-offset: 1px;
}

/* ---- 窄屏（1024~1280）微调：打卡格缩小一档，给习惯名留出位置 ---- */
@media (max-width: 1280px) {
  .pt-hb .pt-hc, .pt-lhb .pt-hc { width: 16px; height: 16px; }
  .pt-hb .pt-hc .ic, .pt-lhb .pt-hc .ic { width: 9px; height: 9px; }
  .pt-hd { width: 16px; font-size: 10px; }
  .pt-lc-cell { height: 26px; }
  .pt-tl-rail { width: 48px; }
}
