/* 工作台积分页扩展样式
 *
 * rw-console.css 是从本机控制台（tools/dashboard.py 的 CSS）1:1 生成的门面，
 * 不改它，免得下次重新生成时被覆盖。这里只放工作台额外需要的东西：
 * 电脑/手机来源标签、可折叠分组（一次性任务池）、印章点阵。
 */

/* ---- 来源标签：电脑 / 手机 ---- */
#view-rewards .src {
  font-size: 10.6px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 5px;
  flex: none;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: .3px;
}
#view-rewards .src.pc { background: #eef2f8; color: #46536a; }
#view-rewards .src.phone { background: var(--accent-soft); color: #0a58d0; }

/* 标题行：标签 + 任务名，名字过长时省略 */
#view-rewards .task .trow {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
#view-rewards .task .trow .t { flex: 1; min-width: 0; }

/* ---- 可折叠分组（一次性任务池 / 限时活动）---- */
#view-rewards details.rgroup {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfdff;
  overflow: hidden;
}
#view-rewards details.rgroup:last-child { margin-bottom: 0; }
#view-rewards details.rgroup > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 12.6px;
  color: var(--sub);
  user-select: none;
}
#view-rewards details.rgroup > summary::-webkit-details-marker { display: none; }
#view-rewards details.rgroup > summary b { font-size: 13px; color: var(--text); font-weight: 650; }
#view-rewards details.rgroup > summary .sum { margin-left: auto; font-variant-numeric: tabular-nums; }
#view-rewards details.rgroup > summary:hover { background: #f6f9fe; }
#view-rewards details.rgroup > summary .caret {
  color: var(--faint);
  font-size: 9px;
  transition: transform .18s ease;
  flex: none;
}
#view-rewards details.rgroup[open] > summary .caret { transform: rotate(90deg); }
#view-rewards details.rgroup[open] > summary { border-bottom: 1px solid var(--line-soft); }
#view-rewards details.rgroup .ritems { padding: 10px 10px 11px; }
#view-rewards details.rgroup .ritems .task { background: #fff; }

/* ---- 印章点阵 ---- */
#view-rewards .stamps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
#view-rewards .stamps i {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px dashed #cfd8e5;
  display: block;
  flex: none;
}
#view-rewards .stamps i.on { background: var(--accent); border: 1.5px solid var(--accent); }

/* ---- 执行日志：批次行 ---- */
#view-rewards td.sess,
#view-rewards tr td[colspan="6"] {
  background: #f6f8fc;
  border-top: 1px solid #e7ecf4;
  padding-top: 11px;
  font-size: 12.2px;
}
#view-rewards td.sess .mono { font-variant-numeric: tabular-nums; }

/* ---- 暗色 ---- */
[data-theme="dark"] #view-rewards .src.pc { background: #232936; color: #aab4c6; }
[data-theme="dark"] #view-rewards .src.phone { background: #1b2f4d; color: #7fb2ff; }
[data-theme="dark"] #view-rewards details.rgroup { background: #171b22; }
[data-theme="dark"] #view-rewards details.rgroup > summary:hover { background: #1d222b; }
[data-theme="dark"] #view-rewards details.rgroup .ritems .task { background: #1a1e26; }
[data-theme="dark"] #view-rewards td.sess,
[data-theme="dark"] #view-rewards tr td[colspan="6"] { background: #161a21; border-top-color: #262c39; }
[data-theme="dark"] #view-rewards .stamps i { border-color: #39414f; }

/* ================= 当日积分明细（v1.25） =================
   独立前缀 pd-*，避免撞 .app / .row / .chip 这些全局类。
   行内只用 flex + gap，不依赖父容器高度。 */
#view-rewards .pd-seg {
  display: flex; height: 8px; border-radius: 999px; overflow: hidden;
  background: #eef2f7; margin: 2px 0 7px;
}
#view-rewards .pd-seg i { display: block; height: 100%; }
#view-rewards .pd-seg i.pc { background: #0b6cff; }
#view-rewards .pd-seg i.ph { background: #7b3fe4; }
#view-rewards .pd-seg i.ot { background: #cfd8e5; }

#view-rewards .pd-leg {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  font-size: 11.5px; color: var(--sub); margin-bottom: 9px;
  font-variant-numeric: tabular-nums;
}
#view-rewards .pd-leg span { display: inline-flex; align-items: center; }
#view-rewards .pd-leg i {
  width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 4px;
}
#view-rewards .pd-leg i.pc { background: #0b6cff; }
#view-rewards .pd-leg i.ph { background: #7b3fe4; }
#view-rewards .pd-leg i.ot { background: #cfd8e5; }

#view-rewards .pd-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 12.4px;
  border-bottom: 1px dashed var(--line-soft);
}
#view-rewards .pd-row:last-child { border-bottom: none; padding-bottom: 2px; }
#view-rewards .pd-row .nm {
  /* width:0 + flex-grow：光写 min-width:0 在 grid 里仍会被长文案撑破（380px 窄屏实测溢出 62px） */
  flex: 1 1 0; width: 0; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
}
#view-rewards .pd-row .pg { font-size: 11.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
#view-rewards .pd-row .pt {
  min-width: 46px; text-align: right; font-weight: 680; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
#view-rewards .pd-row.off .pt { color: var(--faint); font-weight: 600; }
#view-rewards .pd-row .pd-gap { width: 34px; flex: none; }

#view-rewards .pd-foot {
  margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line);
  font-size: 12.2px; color: var(--sub); line-height: 1.8;
}
#view-rewards .pd-foot b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
#view-rewards .pd-foot .ok { color: #0a7a44; font-weight: 600; }
#view-rewards .pd-foot .bad { color: #c2740a; font-weight: 600; }

[data-theme="dark"] #view-rewards .pd-seg { background: #232936; }
[data-theme="dark"] #view-rewards .pd-seg i.ot,
[data-theme="dark"] #view-rewards .pd-leg i.ot { background: #39414f; }
#view-rewards .pd-foot .muted-x { color: var(--faint); }

/* ---- 四账号总览卡 ---- */
.rw-accounts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 14px;
}
@media (max-width: 1100px) { .rw-accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px)  { .rw-accounts { grid-template-columns: 1fr; } }

.rw-acc {
  position: relative;
  background: #fff;
  border: 1px solid #e8ecf2;
  border-radius: 12px;
  padding: 12px 13px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.rw-acc:hover { border-color: #c9d6ea; box-shadow: 0 3px 10px rgba(20, 25, 34, .06); }
.rw-acc.on { border-color: #0b6cff; box-shadow: 0 0 0 2px rgba(11, 108, 255, .13); }
.rw-acc.off { background: #f7f8fa; }

.rw-acc .h { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.rw-acc .nm { font-weight: 700; font-size: 14px; color: #141922; }
.rw-acc .bd {
  font-size: 10px; padding: 2px 6px; border-radius: 5px;
  background: #eef2f8; color: #46536a; font-weight: 600; letter-spacing: .2px;
}
.rw-acc .st {
  margin-left: auto; font-size: 11px; color: #0f9d58;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.rw-acc .st i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.rw-acc .st.off { color: #9aa5b5; }

.rw-acc .em {
  font-size: 11.5px; color: #6b7688; margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rw-acc .pt { font-size: 26px; font-weight: 800; line-height: 1; color: #141922; letter-spacing: -.5px; }
.rw-acc .pt small { font-size: 11px; font-weight: 600; color: #6b7688; margin-left: 3px; }
.rw-acc .dl { font-size: 12px; font-weight: 700; color: #0f9d58; margin-top: 6px; }
.rw-acc.off .pt, .rw-acc.off .dl { color: #9aa5b5; }
.rw-acc .kv {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 9px; padding-top: 9px;
  border-top: 1px dashed #eef1f6;
  font-size: 11.5px; color: #6b7688;
}
.rw-acc .kv b { color: #141922; font-weight: 700; }

/* ---- 今日运行计划：一卡一号，电脑 / 手机两条泳道 ---- */
#view-rewards .rw-plan {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  /* 两行卡片：不加这两条，grid 会把自动行拉满父容器高度，卡片被抻成一整屏 */
  align-content: start;
  align-items: start;
}
@media (max-width: 900px) { #view-rewards .rw-plan { grid-template-columns: 1fr; } }

#view-rewards .rw-pc {
  background: #fff;
  border: 1px solid #e8ecf2;
  border-left: 3px solid #d7dee9;
  border-radius: 10px;
  padding: 11px 13px 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
#view-rewards .rw-pc:hover { box-shadow: 0 3px 10px rgba(20, 25, 34, .06); }
#view-rewards .rw-pc.on { border-color: #0b6cff; box-shadow: 0 0 0 2px rgba(11, 108, 255, .12); }
#view-rewards .rw-pc.ok { border-left-color: #0f9d58; }
#view-rewards .rw-pc.wait { border-left-color: #e0a400; background: #fffdf7; }
#view-rewards .rw-pc.bad { border-left-color: #d93025; background: #fff8f7; }
#view-rewards .rw-pc.off { border-left-color: #d7dee9; background: #f7f8fa; }

#view-rewards .rw-pc .h { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
#view-rewards .rw-pc .nm { font-weight: 700; font-size: 13.5px; color: #141922; }
#view-rewards .rw-pc .bd {
  font-size: 10px; padding: 2px 6px; border-radius: 5px;
  background: #eef2f8; color: #46536a; font-weight: 600;
}
#view-rewards .rw-pc .st {
  margin-left: auto; font-size: 11px; color: #0f9d58;
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
#view-rewards .rw-pc .st i {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block;
}
#view-rewards .rw-pc.wait .st { color: #b8860b; }
#view-rewards .rw-pc.bad .st { color: #c5221f; }
#view-rewards .rw-pc.off .st { color: #9aa5b5; }
#view-rewards .rw-pc .tm {
  font-size: 22px; font-weight: 800; color: #141922;
  letter-spacing: -.4px; margin: 8px 0 4px; font-variant-numeric: tabular-nums;
}
#view-rewards .rw-pc.off .tm, #view-rewards .rw-pc.off .sc { color: #9aa5b5; }
#view-rewards .rw-pc .sc { font-size: 12px; color: #6b7688; }
#view-rewards .rw-pc .sc b { font-weight: 700; }
#view-rewards .rw-pc .sc .why { color: #c5221f; font-weight: 600; }

/* 两条泳道：电脑（蓝）/ 手机（紫） */
#view-rewards .rw-lane { display: flex; align-items: flex-start; gap: 7px; padding: 3px 0; }
#view-rewards .rw-lane + .rw-lane {
  border-top: 1px dashed #f0f3f8; margin-top: 3px; padding-top: 7px;
}
#view-rewards .rw-lane .lb {
  flex: 0 0 58px; font-size: 11px; font-weight: 700; color: #46536a;
  padding-top: 4px; white-space: nowrap;
}
#view-rewards .rw-lane .lb em {
  font-style: normal; font-weight: 600; color: #8a94a6; margin-left: 3px;
  font-variant-numeric: tabular-nums;
}
#view-rewards .rw-lane .lb.l-pc { color: #1a63c9; }
#view-rewards .rw-lane .lb.l-app { color: #7b3fe4; }
#view-rewards .rw-lane .chips { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }

#view-rewards .chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 6px;
  border: 1px solid #dfe5ee; background: #fff; color: #46536a;
  font-variant-numeric: tabular-nums; cursor: default; white-space: nowrap;
  box-shadow: none;   /* styles.css 的全局 .chip 带阴影，这里显式清掉 */
}
#view-rewards .chip b { font-weight: 700; font-size: 11.5px; }
#view-rewards .chip i { font-style: normal; font-size: 10.5px; color: #8a94a6; }
#view-rewards .chip.done { background: #eaf7ef; border-color: #bfe3cb; color: #0b7a43; }
#view-rewards .chip.done i { color: #0b7a43; }
#view-rewards .chip.failed { background: #fdeceb; border-color: #f3c2be; color: #c5221f; }
#view-rewards .chip.failed i { color: #c5221f; }
#view-rewards .chip.missed { background: #f6f7f9; border-style: dashed; color: #9aa5b5; }
#view-rewards .chip.missed i { color: #9aa5b5; }
#view-rewards .chip.running { background: #e8f1ff; border-color: #b6d3ff; color: #0b5ecf; }
#view-rewards .chip.next { border-color: #0b6cff; box-shadow: 0 0 0 2px rgba(11, 108, 255, .16); }
#view-rewards .chip.retry { background: #f4efff; border-color: #d8c8f7; color: #6b3fc4; }
#view-rewards .chip.extra { border-style: dashed; }
#view-rewards .chip.manual { background: #f7f4ff; border-color: #e0d7f7; color: #6b3fc4; }
#view-rewards .chip.none { color: #9aa5b5; border-style: dashed; background: #fbfcfd; }

#view-rewards .rw-foot {
  margin-top: 8px; padding-top: 7px; border-top: 1px dashed #eef1f6;
  font-size: 11.5px; color: #6b7688; line-height: 1.6;
}
#view-rewards .rw-foot b { color: #141922; font-weight: 700; }

/* ================= 运行日志卡片（v1.22） =================
   注意：这张卡片的行、标签、得分、明细全部由 app.js 走【内联样式】生成，
   这里只放外框和折叠用的少量样式。
   原因：工作台 styles.css 里有通用 .row{display:flex}、rw-console.css 里有
   .row / .lb 等规则，跟日志卡片撞过好几次，表现为某一行被撑到几百像素高。
   内联样式不受这些规则影响，改起来也更局部。 */
#view-rewards .rw-log .badn { color: #c5221f; font-weight: 700; }
#view-rewards .rw-log .lgempty {
  font-size: 12.6px; color: #8a94a6; padding: 8px 0 2px; line-height: 1.7;
}
#view-rewards .rw-log .badsec {
  border: 1px solid #f3c9c6; background: #fff8f7;
  border-radius: 10px; padding: 2px 10px; margin-bottom: 10px;
}
#view-rewards .rw-log .lgmore > summary {
  cursor: pointer; list-style: none; padding: 9px 0 5px;
  font-size: 12.2px; color: #0a58d0; font-weight: 600;
}
#view-rewards .rw-log .lgmore > summary::-webkit-details-marker { display: none; }
#view-rewards .rw-log .lgmore > summary:before { content: "▸  "; color: #9aa5b5; }
#view-rewards .rw-log .lgmore[open] > summary:before { content: "▾  "; }
#view-rewards .rw-log .lgfoot {
  margin-top: 9px; padding-top: 8px; border-top: 1px solid #eef1f6;
  font-size: 11.8px; color: #8a94a6; line-height: 1.7;
}
