/* ========== 首页 v4（对齐 docs/proto/proto_home_v4.html） ==========
   原则：浅灰白底降噪、留白即分组、主紫只用于 CTA/选中/下一步。
   分区：统计细带 → 正在聚焦 → 进行中（2列/10条）→ 分组速览（四区一行摘要卡） */

/* ---------- ① 统计细带：左对齐紧凑（图标+数字+标签）+ 右侧今日信息 ---------- */
.stat-band {
  display: flex; align-items: center; gap: 26px; min-height: 50px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow);
  margin-bottom: 20px; padding: 0 18px;
}
.stat-item { display: flex; align-items: center; gap: 7px; min-width: 0; }
.stat-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: var(--pri-soft); color: var(--pri-h);
  display: flex; align-items: center; justify-content: center;
}
.stat-band .stat-num { font-size: 17px; font-weight: 800; line-height: 1; color: var(--t1); }
.stat-band .stat-label { font-size: 12.5px; color: var(--t3); white-space: nowrap; }
.stat-sep { width: 1px; height: 14px; background: var(--line2); flex-shrink: 0; }
.stat-right { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--t3); white-space: nowrap; }
.stat-right b { color: var(--t1); font-weight: 800; font-size: 14px; }

/* ---------- 区块与标题 ---------- */
.section { margin-bottom: 28px; }
.sec-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 700; color: var(--t1); margin-bottom: 14px;
}
.sec-head .count { font-size: 12px; font-weight: 600; background: #eceef3; color: var(--t3); padding: 2px 9px; border-radius: 10px; }
.sec-head::after { content: ''; flex: 1; height: 1px; background: var(--line2); }
/* 区块右上角「查看更多 →」（跳二级页） */
.sec-more {
  order: 3; margin-left: auto; flex-shrink: 0;
  font-size: 12.5px; font-weight: 600; color: var(--pri); cursor: pointer;
  padding: 3px 8px; border-radius: 7px; text-decoration: none;
}
.sec-more:hover { background: var(--pri-soft2); }

/* ---------- ☆ 聚焦按钮（限定作用域，避免污染 base 的评分星） ---------- */
.lc-top .star, .fh-row .star, .fm-row .star {
  flex-shrink: 0; width: 26px; height: 26px; border: none; background: transparent; color: #c9cdd6;
  display: flex; align-items: center; justify-content: center; border-radius: 6px;
  transition: .15s; font-size: 15px; line-height: 1; cursor: pointer;
}
.lc-top .star:hover, .fh-row .star:hover, .fm-row .star:hover { background: #f3f4f6; color: var(--amber); }
.lc-top .star.on, .fh-row .star.on, .fm-row .star.on { color: var(--pri); }
.lc-top .star.on:hover, .fh-row .star.on:hover, .fm-row .star.on:hover { color: var(--pri-h); }
.fm-row .star { width: 22px; height: 22px; font-size: 13px; }
.focus-tag { font-size: 11px; font-weight: 700; color: var(--pri); background: var(--pri-soft); padding: 2px 8px; border-radius: 8px; flex-shrink: 0; }

/* ---------- ② 正在聚焦：Hero 大卡 + 小环卡 ---------- */
.focus-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr); gap: 16px; align-items: stretch; }
.focus-layout.solo { grid-template-columns: 1fr; }

.focus-hero {
  background: var(--card); border-radius: 16px; padding: 22px 26px;
  box-shadow: var(--shadow); border: 1.5px solid var(--pri-soft);
  display: flex; gap: 24px; align-items: center; cursor: pointer;
  transition: box-shadow .15s, transform .15s; min-width: 0;
}
.focus-hero:hover { box-shadow: var(--shadow-h); transform: translateY(-1px); }
.fh-ring { width: 104px; height: 104px; border-radius: 50%; flex-shrink: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.fh-ring::after { content: ''; position: absolute; inset: 9px; background: #fff; border-radius: 50%; }
.fh-ring .pct { position: relative; z-index: 1; font-size: 21px; font-weight: 800; color: var(--pri); }
.fh-body { flex: 1; min-width: 0; }
.fh-row { display: flex; align-items: center; margin-bottom: 8px; }
.fh-tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 10px; }
.fh-tag.high { background: #fef2f2; color: #b91c1c; }
.fh-tag.mid { background: #f3f4f6; color: var(--t3); }
.fh-row .star { margin-left: auto; }
.fh-title { font-size: 21px; font-weight: 800; margin-bottom: 10px; color: var(--t1); }
.fh-next {
  font-size: 13px; color: var(--t2); background: var(--pri-soft2); padding: 8px 12px; border-radius: 8px;
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top;
}
.fh-next b { color: var(--pri); font-weight: 600; }

.focus-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.focus-mini {
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--shadow); border: 1.5px solid var(--pri-soft);
  display: flex; gap: 14px; align-items: center; cursor: pointer;
  transition: box-shadow .15s, transform .15s; flex: 1; min-width: 0;
}
.focus-mini:hover { box-shadow: var(--shadow-h); transform: translateY(-1px); }
.fm-ring { width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.fm-ring::after { content: ''; position: absolute; inset: 5px; background: #fff; border-radius: 50%; }
.fm-ring .pct { position: relative; z-index: 1; font-size: 12.5px; font-weight: 800; color: var(--pri); }
.fm-body { flex: 1; min-width: 0; }
.fm-row { display: flex; align-items: center; margin-bottom: 5px; }
.fm-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; }
.fm-tag.high { background: #fef2f2; color: #b91c1c; }
.fm-tag.mid { background: #f3f4f6; color: var(--t3); }
.fm-row .star { margin-left: auto; }
.fm-title { font-size: 14.5px; font-weight: 800; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--t1); }
.fm-next { font-size: 12px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fm-next b { color: var(--pri); font-weight: 600; }

/* ---------- ③ 进行中：2 列精简卡（4 元素） ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-content: start; }
.line-card {
  background: var(--card); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow); cursor: pointer; position: relative;
  transition: box-shadow .15s, transform .15s;
  border-left: 4px solid transparent;
}
.line-card:hover { box-shadow: var(--shadow-h); transform: translateY(-1px); }
.line-card.pri-high { border-left-color: var(--red); }
.lc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.lc-title { font-size: 15.5px; font-weight: 700; flex: 1; min-width: 0; color: var(--t1); }
.lc-arrow {
  flex-shrink: 0; width: 22px; height: 22px; border: none; background: transparent; color: var(--t4);
  display: flex; align-items: center; justify-content: center; transition: transform .2s; border-radius: 6px; cursor: pointer;
}
.lc-arrow:hover { background: #f3f4f6; color: var(--t2); }
.lc-arrow.open { transform: rotate(180deg); }
/* 右上角「进入详情」图标（替代卡内"进入详情 →"按钮） */
.lc-open {
  flex-shrink: 0; width: 22px; height: 22px; border: none; background: transparent; color: #c9cdd6;
  display: flex; align-items: center; justify-content: center; border-radius: 6px; cursor: pointer; transition: .15s;
}
.lc-open:hover { background: var(--pri-soft2); color: var(--pri); }
.lc-next {
  font-size: 12.5px; color: var(--t2); margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px; min-height: 18px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lc-next b { color: var(--pri); font-weight: 600; }
.prog-row { display: flex; align-items: center; gap: 10px; }
.prog-bar { flex: 1; height: 6px; background: #eceef3; border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; background: var(--pri); border-radius: 3px; transition: width .3s; }
.prog-pct { font-size: 12px; font-weight: 700; color: var(--t3); min-width: 36px; text-align: right; }

/* ---------- 主线卡展开：执行步骤预览（0fr→1fr，200ms） ---------- */
.steps-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.steps-body.open { grid-template-rows: 1fr; }
.steps-body-inner { overflow: hidden; min-height: 0; }
.step-list { margin: 2px -4px 12px; border-top: 1px dashed var(--line2); padding-top: 8px; }
.step-item { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; font-size: 13px; color: var(--t2); }
.step-item:hover { background: #f8f9fb; }
.st-dot {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; position: relative;
}
.st-dot.done { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.st-dot.doing { background: var(--pri-soft); border: 1px solid #ddd6fe; }
.st-dot.doing::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--pri); }
.st-dot.todo { border: 1.5px solid #d3d7e0; background: #fff; }
.st-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-item.done .st-title { color: var(--t3); }
.step-item.doing .st-title { color: var(--t1); font-weight: 600; }
.st-pct { font-size: 11.5px; font-weight: 700; color: var(--pri); flex-shrink: 0; }
.step-empty { margin: 2px -4px 0; border-top: 1px dashed var(--line2); padding: 12px 6px; font-size: 12.5px; color: var(--t4); }

/* ---------- ④ 分组速览：一行 4 张卡，卡内直接列前 2 条（关键信息不用点开） ---------- */
.quad-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.quad-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 14px 16px 11px; cursor: pointer;
  display: flex; flex-direction: column; gap: 9px; min-width: 0;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.quad-card:hover { box-shadow: var(--shadow-h); transform: translateY(-1px); border-color: #d8dce3; }
.quad-card.on { border-color: var(--pri); }
.qc-top { display: flex; align-items: center; gap: 8px; }
.qc-ico { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qc-ico.amber { background: var(--amber-bg); color: var(--amber); }
.qc-ico.brown { background: #fff7ed; color: #ea580c; }
.qc-ico.orange { background: #fff7ed; color: #ea580c; }
.qc-ico.green { background: #ecfdf5; color: var(--green-d); }
.qc-name { font-size: 13.5px; font-weight: 700; color: var(--t1); white-space: nowrap; }
.qc-count { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--t3); background: #eceef3; padding: 2px 8px; border-radius: 9px; flex-shrink: 0; }

/* 卡内迷你条目（默认可见，不用点击） */
.qc-list { display: flex; flex-direction: column; gap: 5px; min-height: 36px; }
.qc-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--t2); line-height: 1.5; }
.qc-dot { width: 5px; height: 5px; border-radius: 50%; background: #cfd4de; flex-shrink: 0; }
.qc-it { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-im { font-size: 11px; color: var(--t4); flex-shrink: 0; }
/* 四组全空时的一行提示 */
.qd-empty {
  background: var(--card); border: 1px dashed var(--line2); border-radius: 12px;
  padding: 18px 20px; font-size: 12.5px; color: var(--t4); text-align: center;
}

.qc-foot {
  margin-top: auto; border-top: 1px dashed var(--line2); padding-top: 8px;
  display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--t4);
}
.qc-foot .qc-exp { color: var(--pri); font-weight: 600; }

/* 展开详情面板（原位展开，不跳页） */
.quad-detail { display: none; margin-top: 14px; }
.quad-detail.open { display: block; animation: qdIn .18s ease-out; }
@keyframes qdIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.qd-head { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 700; color: var(--t1); margin-bottom: 10px; }
.qd-head .qd-n { font-size: 12px; font-weight: 600; background: #eceef3; color: var(--t3); padding: 2px 9px; border-radius: 10px; }
.qd-close {
  margin-left: auto; border: none; background: transparent; font-size: 12px; color: var(--t4);
  font-weight: 600; display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 6px; cursor: pointer;
}
.qd-close:hover { color: var(--t2); background: #f3f4f6; }

/* ---------- 展开面板：暂不推进（wait-card 视觉） ---------- */
.wait-card {
  background: var(--card); border-radius: var(--radius); padding: 14px 18px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
  cursor: pointer; transition: .15s; margin-bottom: 10px;
}
.wait-card:hover { box-shadow: var(--shadow-h); }
.wait-ico {
  width: 38px; height: 38px; border-radius: 10px; background: var(--amber-bg);
  display: flex; align-items: center; justify-content: center; color: var(--amber); flex-shrink: 0;
}
.wait-body { flex: 1; min-width: 0; }
.wait-title { font-weight: 700; font-size: 14.5px; margin-bottom: 3px; color: var(--t1); }
.wait-hint { font-size: 12.5px; color: var(--amber-d); }
.wait-go { font-size: 13px; color: var(--t4); font-weight: 600; flex-shrink: 0; }
.wait-card:hover .wait-go { color: var(--t3); }

/* ---------- 展开面板：草稿箱（橙虚线卡） ---------- */
.draft-card {
  background: #fffdf8; border: 1px dashed #fb923c; border-radius: var(--radius);
  padding: 16px 20px; display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow); margin-bottom: 10px;
}
.draft-body { flex: 1; min-width: 0; }
.draft-title { font-weight: 700; font-size: 14px; color: #9a3412; margin-bottom: 3px; }
.draft-miss { font-size: 12px; color: #9a3412; background: var(--amber-bg); padding: 5px 10px; border-radius: 6px; display: inline-block; margin-top: 4px; }
.btn-backfill {
  background: #f97316; color: #fff; border: none; padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; flex-shrink: 0; cursor: pointer;
}
.btn-backfill:hover { background: #ea580c; }

/* ---------- 展开面板：已完成 ---------- */
.done-list {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.done-item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.done-item:last-child { border-bottom: none; }
.done-item:hover { background: #fafbfd; }
.done-check {
  width: 22px; height: 22px; border-radius: 50%; background: var(--green);
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.done-title { font-size: 14px; color: var(--t2); flex: 1; min-width: 0; }
.done-time { font-size: 12px; color: var(--t4); }

/* ---------- 展开面板：今日日常记录 ---------- */
.daily-list {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.daily-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line); cursor: pointer; }
.daily-item:last-child { border-bottom: none; }
.daily-item:hover { background: #fafbfd; }
.dt-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; flex-shrink: 0; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dt-text { font-size: 13px; color: var(--t2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-time { font-size: 12px; color: var(--t4); flex-shrink: 0; }

/* ---------- 超限额提示（去二级页看） ---------- */
.more-dim { font-size: 12.5px; color: var(--t4); padding: 4px 2px 0; }
.more-dim a { color: var(--pri); font-weight: 600; cursor: pointer; }
.more-dim a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- AI 参谋提醒弹窗（顶栏铃铛） ---------- */
.r-modal-title { font-size: 17px; font-weight: 800; color: var(--t1); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.r-modal-title .count { font-size: 12px; font-weight: 600; background: #eceef3; color: var(--t3); padding: 2px 9px; border-radius: 10px; }
.reminder-list { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; }
.reminder-item { border-left: 3px solid var(--pri-soft); background: #fafbfd; border-radius: 8px; padding: 10px 12px; }
.reminder-item.warn { border-left-color: var(--amber-line); background: #fffbeb; }
.reminder-item .ri-title { font-size: 13.5px; font-weight: 700; color: var(--t1); margin-bottom: 4px; }
.reminder-item .ri-desc { font-size: 12.5px; color: var(--t3); line-height: 1.6; }

/* ---------- 空状态 ---------- */
.empty-state {
  background: var(--card); border-radius: 18px; padding: 44px 32px; text-align: center;
  box-shadow: var(--shadow); max-width: 760px; margin: 24px auto;
}
.empty-state .es-title { font-size: 24px; font-weight: 800; color: var(--t1); margin-bottom: 8px; }
.empty-state .es-sub { font-size: 14px; color: var(--t3); line-height: 1.7; margin-bottom: 20px; }
.empty-state .es-steps { text-align: left; background: #faf9ff; border: 1px dashed var(--line2); border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; }

/* ---------- 新建"新"徽章（24h 内创建的主线置顶标识） ---------- */
.new-badge {
  display:inline-flex; align-items:center; justify-content:center;
  width:18px; height:18px; margin-right:6px; vertical-align:middle;
  font-size:11px; font-weight:800; color:#fff;
  background:linear-gradient(135deg,#f97316,#ef4444);
  border-radius:5px; line-height:1; flex-shrink:0;
  box-shadow:0 1px 3px rgba(239,68,68,.35);
}
.empty-state .es-steps .es-step { font-size: 13.5px; color: var(--t2); line-height: 1.9; }
.empty-state .es-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .quad-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
  .focus-layout { grid-template-columns: 1fr; }
  .focus-side { flex-direction: row; }
  .stat-band { min-height: 0; padding: 12px 14px; flex-wrap: wrap; gap: 10px 20px; }
  .stat-right { margin-left: 0; width: 100%; padding-top: 8px; border-top: 1px dashed var(--line2); }
}
@media (max-width: 560px) {
  .quad-row { grid-template-columns: 1fr; }
  .focus-side { flex-direction: column; }
}

/* 空态垂直居中（JS 置 flex 时生效，有主线时恢复 none 不影响） */
#emptyState { min-height: calc(100vh - 320px); align-items: center; justify-content: center; }
