/* 拆赛 · 竞赛任务拆解与复盘助手
 * 第三步：总览驾驶舱 + 左侧深色导航 + 琥珀橙主题 */

:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --ink: #211b16;
  --ink2: #564c42;
  --ink3: #8d8378;
  --line: #ece4da;
  --accent: #e8710f;
  --accent-2: #f6a02c;
  --accent-deep: #b9530a;
  --accent-soft: #fff2e3;
  --ok: #12926f;
  --ok-soft: #e8f7f1;
  --doing: #b45309;
  --doing-soft: #fdf1dc;
  --warn: #b7791f;
  --warn-soft: #fdf4e3;
  --risk: #c4453d;
  --risk-soft: #fdecea;
  --nav: #1c2027;
  --nav-2: #14171d;
  --nav-ink: #a7aeb9;
  --nav-line: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(33, 27, 22, 0.04), 0 14px 32px -24px rgba(33, 27, 22, 0.45);
  --max: 1180px;
  --sidebar-w: 236px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }

/* ---------- 布局骨架 ---------- */
.app {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- 左侧导航 ---------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-2) 100%);
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  overflow-y: auto;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px 18px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--nav-line);
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 20px -12px rgba(232, 113, 15, 0.95);
}

.side-brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.side-brand-name { font-size: 16.5px; font-weight: 700; letter-spacing: 0.6px; color: #fff; }
.side-brand-sub { font-size: 11px; color: rgba(255, 255, 255, 0.42); }

.sidenav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--nav-ink);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.is-active {
  background: linear-gradient(135deg, #f18a1f, var(--accent));
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(232, 113, 15, 0.95);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-2);
}

.nav-icon { display: grid; place-items: center; width: 18px; height: 18px; flex: none; }
.nav-icon svg { width: 17px; height: 17px; }
.nav-label { flex: 1; }

.nav-no {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.5px;
}
.nav-item.is-active .nav-no,
.nav-item:hover .nav-no { color: rgba(255, 255, 255, 0.7); }

.side-foot {
  margin-top: auto;
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--nav-line);
}

.side-foot-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.side-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(246, 160, 44, 0.18);
}

.side-foot p {
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.42);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 66px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-product { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.prod-name { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: 0.2px; }
.prod-tag { font-size: 11.5px; color: var(--ink3); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

/* ---------- 页面容器 ---------- */
.view {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 28px 56px;
  flex: 1;
}

.page-head { margin-bottom: 22px; }

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.page-head h1 { font-size: 26px; letter-spacing: -0.3px; }
.page-sub { margin-top: 6px; font-size: 14px; color: var(--ink2); max-width: 760px; }

.muted { color: var(--ink3); font-size: 12.5px; }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-head h2 { font-size: 16px; }
.card-head-wrap { flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(135deg, #f0810f, #dc6508);
  color: #fff;
  box-shadow: 0 10px 20px -12px rgba(232, 113, 15, 0.95);
}
.btn-primary:hover { background: linear-gradient(135deg, #e8710f, #c2570a); }

.btn-ghost { background: #fff; color: var(--ink2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent-2); color: var(--accent-deep); }

.btn-soft { background: var(--accent-soft); color: var(--accent-deep); }
.btn-soft:hover { background: #ffe6cd; }

.btn-block { width: 100%; }

.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }

/* ---------- 徽标 / 标签 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-done { color: var(--ok); background: var(--ok-soft); }
.badge-doing { color: var(--doing); background: var(--doing-soft); }
.badge-todo { color: #7a8296; background: #f3efe9; }
.badge-p-high { color: var(--risk); background: var(--risk-soft); }
.badge-p-mid { color: var(--warn); background: var(--warn-soft); }
.badge-p-low { color: #7a8296; background: #f3efe9; }
.badge-accent { color: var(--accent-deep); background: var(--accent-soft); }
.badge-soft { color: var(--ink2); background: #f4efe8; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row-block { margin-top: 2px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fdfbf8;
  font-size: 12.5px;
  color: var(--ink2);
  white-space: nowrap;
}

.chip-soft { background: #f7f3ed; color: var(--ink3); }
.chip-deliver { background: #f1f9f6; border-color: #d6ece4; color: #16745a; }
.chip-lesson { background: var(--accent-soft); border-color: #fbdcbc; color: #a34d05; white-space: normal; text-align: left; }

/* ---------- 总览驾驶舱 ---------- */
.timeline-card { padding: 20px 24px 22px; margin-bottom: 18px; }

.timeline-scroll { overflow-x: auto; padding-bottom: 4px; }

.timeline-track {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  position: relative;
  padding-top: 4px;
  min-width: 560px;
}

.timeline-track::before {
  content: "";
  position: absolute;
  left: 9%;
  right: 9%;
  top: 21px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #cfece1 0%, #cfece1 30%, #f8d5aa 44%, #ece4da 60%, #ece4da 100%);
}

.tl-node {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 4px;
  text-align: center;
}

.tl-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink3);
  background: #fff;
  border: 2px solid #e6ddd2;
}

.tl-node.is-done .tl-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl-node.is-doing .tl-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(232, 113, 15, 0.14);
}

.tl-name { margin-top: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink2); line-height: 1.4; }
.tl-window { font-size: 11px; color: var(--ink3); }
.tl-node .badge { margin-top: 3px; }

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: stretch;
}

.ov-card {
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
}

.ov-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.ov-k { font-size: 12.5px; font-weight: 600; letter-spacing: 0.4px; color: var(--ink3); }

.big-progress {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.big-progress b {
  font-size: 54px;
  line-height: 1;
  letter-spacing: -2.5px;
  font-weight: 700;
  color: var(--accent);
}

.big-progress span { font-size: 12.5px; color: var(--ink3); }

.ov-bar { height: 12px; }

.ov-foot { margin-top: auto; padding-top: 14px; font-size: 12px; color: var(--ink3); }

.ov-next-name { font-size: 20px; line-height: 1.4; letter-spacing: -0.2px; margin: 2px 0 6px; }
.ov-next-meta { font-size: 12.5px; color: var(--ink2); }
.ov-next-note { margin-top: 8px; font-size: 12px; color: var(--ink3); line-height: 1.65; }

.ov-link {
  margin-top: auto;
  padding-top: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-deep);
  text-decoration: none;
}
.ov-link:hover { color: var(--accent); }

.risk-alert {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 22px;
  padding: 20px 22px;
  margin-bottom: 18px;
  border-color: #f5d6d2;
  background: linear-gradient(135deg, #fffdfc 0%, #fff7f5 100%);
}

.alert-count {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 20px;
  border-right: 1px dashed #f0d4d0;
}

.alert-k { font-size: 12.5px; color: var(--ink3); }

.alert-count b {
  font-size: 44px;
  line-height: 1.05;
  letter-spacing: -1.5px;
  color: var(--risk);
}

.alert-count b i { margin-left: 4px; font-size: 13px; font-style: normal; font-weight: 600; color: var(--ink3); }
.alert-s { font-size: 11.5px; color: var(--ink3); }
.alert-count .btn { margin-top: 12px; align-self: flex-start; }

.alert-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.alert-head { display: flex; align-items: flex-start; gap: 8px; }
.alert-head h3 { font-size: 15px; line-height: 1.45; }
.alert-desc { font-size: 12.5px; line-height: 1.7; color: var(--ink2); }
.alert-empty { font-size: 13px; color: var(--ink3); padding: 14px 0; }

/* ---------- 页 1：新建任务 ---------- */
.new-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 22px;
  align-items: start;
}

.form-card { padding: 24px 26px; }

.field { display: block; margin-bottom: 18px; }

.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink2);
}

.req { color: var(--risk); font-style: normal; margin-left: 2px; }

.field-help { display: block; margin-top: 6px; font-size: 12px; color: var(--ink3); }
.field-help-inline { font-size: 12px; font-weight: 400; color: var(--ink3); }

.input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fdfbf8;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.input:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(246, 160, 44, 0.18);
}

.textarea { resize: vertical; min-height: 76px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.form-tip { font-size: 12px; color: var(--ink3); }

.new-aside { display: flex; flex-direction: column; gap: 18px; }

.demo-card { padding: 20px 22px; }
.demo-card .card-head { margin-bottom: 12px; }
.demo-title { font-size: 17px; margin-bottom: 6px; }

.stat-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 16px 0 18px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.stat-list li {
  background: #fdfbf8;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}

.stat-list strong { font-size: 20px; line-height: 1.2; color: var(--accent); }
.stat-list span { font-size: 12px; color: var(--ink3); }

.flow-note { padding: 20px 22px; }

.mini-flow li {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.mini-flow li:last-child { border-bottom: none; padding-bottom: 0; }

.mini-no {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.mini-flow b { font-size: 13px; }
.mini-flow p { font-size: 12px; color: var(--ink3); line-height: 1.5; }

/* ---------- 页 2：任务拆解 ---------- */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #fff8f0 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.meta-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.task-name { font-size: 19px; letter-spacing: -0.2px; }

.meta-stats { display: flex; align-items: center; gap: 0; }

.meta-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 0 14px;
  border-left: 1px solid var(--line);
}
.meta-stats .stat:first-child { border-left: none; }

.meta-stats b { font-size: 22px; line-height: 1.2; color: var(--ink); }
.meta-stats b i { font-size: 13px; font-style: normal; color: var(--ink3); }
.meta-stats span { font-size: 11.5px; color: var(--ink3); }

.req-card { padding: 16px 22px; margin-bottom: 18px; }

.req-card summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.req-card summary::-webkit-details-marker { display: none; }
.req-card summary::before {
  content: "▸";
  color: var(--accent);
  font-size: 12px;
  transition: transform 0.15s;
}
.req-card[open] summary::before { transform: rotate(90deg); }

.req-text {
  margin: 14px 0 0;
  padding: 14px 16px;
  background: #fdfaf6;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink2);
  white-space: pre-wrap;
  word-break: break-word;
}

.req-note { margin-top: 12px; font-size: 12.5px; color: var(--ink3); }

/* 里程碑总览 */
.milestone-strip { padding: 20px 24px 18px; margin-bottom: 24px; }
.ms-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.ms-head h2 { font-size: 16px; margin-bottom: 4px; }

.ms-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  position: relative;
  padding-top: 4px;
}

.ms-track::before {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 11px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #bfe8da 0%, #bfe8da 38%, #f8d5aa 48%, #ece4da 62%, #ece4da 100%);
}

.ms-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  padding: 0 4px;
}

.ms-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #dcd3c8;
  position: relative;
  z-index: 1;
}

.ms-node.is-done .ms-dot { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.ms-node.is-doing .ms-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.ms-name { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.ms-date { font-size: 11.5px; color: var(--ink3); }

/* 阶段拆解 */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-head h2 { font-size: 17px; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }

.stage-list { display: flex; flex-direction: column; gap: 0; }

.stage {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
}

.stage-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 18px;
}

.stage-index {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink3);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(33, 27, 22, 0.04);
}

.stage.is-current .stage-index {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 6px 14px -8px rgba(232, 113, 15, 0.95);
}

.stage-line {
  flex: 1;
  width: 2px;
  margin: 8px 0 0;
  background: #eeeee6;
}

.stage-body { padding: 20px 24px; margin-bottom: 18px; }

.stage.is-current .stage-body {
  border-color: #f6d3ad;
  box-shadow: 0 10px 30px -22px rgba(232, 113, 15, 0.8), 0 0 0 1px rgba(232, 113, 15, 0.12);
}

.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.stage-head h3 { font-size: 16.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.now-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.stage-window { font-size: 12.5px; color: var(--ink3); margin-top: 2px; }

.stage-goal {
  padding: 10px 14px;
  margin-bottom: 16px;
  background: #fffaf4;
  border-left: 3px solid #f6cf9f;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: var(--ink2);
}

.tag-label {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-deep);
  background: var(--accent-soft);
  vertical-align: 1px;
}

.stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 22px;
}

.mini-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--ink3);
  margin-bottom: 10px;
}

.task-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--ink2);
}

.task-list .task-check {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  border-radius: 5px;
  border: 1px solid #dcd3c8;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: transparent;
  background: #fff;
}

.task-list li.is-done { color: var(--ink3); }
.task-list li.is-done .task-check { background: var(--ok-soft); border-color: #a9dfcd; color: var(--ok); }

.milestone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fdfbf8;
  font-size: 12.5px;
  color: var(--ink2);
}

.ms-mark { color: var(--accent); font-size: 14px; }
.ms-label { font-weight: 600; }
.ms-when { color: var(--ink3); margin-right: auto; }

.page-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ---------- 页 3：进度跟踪 ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.stat-k { font-size: 12.5px; color: var(--ink3); }
.stat-v { font-size: 26px; line-height: 1.25; letter-spacing: -0.5px; }
.stat-v i { font-size: 14px; font-style: normal; font-weight: 600; color: var(--ink3); }
.stat-v.stat-ok { color: var(--ok); }
.stat-v.stat-doing { color: var(--doing); }
.stat-v.stat-risk { color: var(--risk); }
.stat-s { font-size: 11.5px; color: var(--ink3); }

.progress-card { padding: 18px 22px; margin-bottom: 20px; }

.progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.progress-head h2 { font-size: 15px; }

.progress-bar {
  height: 10px;
  border-radius: 999px;
  background: #f1ebe3;
  overflow: hidden;
}

.progress-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.progress-bar-sm { height: 6px; margin-top: 6px; }

.progress-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink3);
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
}
.dot-done { background: var(--ok); }
.dot-doing { background: var(--doing); }
.dot-todo { background: #cfc6ba; }

.track-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: start;
}

.list-card { padding: 22px 24px; }

.todo-group { margin-bottom: 18px; }
.todo-group:last-child { margin-bottom: 0; }

.group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink2);
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px dashed #f2ece4;
}
.todo-item:last-child { border-bottom: none; padding-bottom: 4px; }

.todo-box {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  border-radius: 6px;
  border: 1px solid #dcd3c8;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: transparent;
  background: #fff;
}

.todo-item.is-done .todo-box { background: var(--ok-soft); border-color: #a9dfcd; color: var(--ok); }
.todo-item.is-doing .todo-box { border-color: #f3cf9f; background: var(--doing-soft); }

.todo-main { flex: 1; min-width: 0; }

.todo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.todo-item.is-done .todo-title { color: var(--ink3); text-decoration: line-through; text-decoration-color: #d8cec2; }

.todo-desc { margin-top: 3px; font-size: 12px; color: var(--ink3); line-height: 1.6; }
.todo-item > .badge { margin-top: 2px; }

.risk-card { padding: 22px 24px; }

.risk-list { display: flex; flex-direction: column; gap: 14px; }

.risk-item {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fdfbf8;
}

.risk-top { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.risk-top h3 { flex: 1; font-size: 13.5px; line-height: 1.5; }

.risk-no {
  flex: none;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--risk);
  background: var(--risk-soft);
  margin-top: 2px;
}

.risk-desc { font-size: 12px; color: var(--ink3); line-height: 1.65; }

.risk-action {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #fdf7f0;
}
.risk-action .tag-label { background: #fbe7cd; }
.risk-action p { font-size: 12px; color: var(--ink2); line-height: 1.65; }

/* ---------- 页 4：复盘 ---------- */
.retro-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: start;
}

.range-row { display: flex; align-items: center; gap: 14px; }

.range {
  flex: 1;
  height: 6px;
  appearance: none;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 82%, #f1ebe3 82%);
  outline: none;
}
.range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(33, 27, 22, 0.15);
  cursor: pointer;
}

.range-value {
  min-width: 52px;
  text-align: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.retro-aside { display: flex; flex-direction: column; gap: 18px; }

.summary-card { padding: 22px 24px; }

.summary-score {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff5e9, #fffaf4);
  border: 1px solid #f8e0c6;
}
.summary-score b { font-size: 30px; line-height: 1; letter-spacing: -1px; color: var(--accent); }
.summary-score > div { flex: 1; }
.summary-score span { font-size: 12px; color: var(--ink3); }

.summary-text {
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink2);
  padding: 14px 16px;
  background: #fdfaf6;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.summary-block {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fdfbf8;
  border: 1px solid var(--line);
}
.summary-block p { font-size: 12px; color: var(--ink2); line-height: 1.65; }

.archive-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.loop-card { padding: 20px 22px; }
.loop-card h2 { font-size: 15px; margin-bottom: 6px; }
.loop-card p { margin-bottom: 14px; line-height: 1.65; }

.loop-track {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--ink3);
}
.loop-track span {
  padding: 4px 10px;
  border-radius: 999px;
  background: #f4efe8;
}
.loop-track span.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.loop-track i { font-style: normal; color: #c9c0b4; }

/* ---------- 页脚 ---------- */
.footer {
  padding: 18px 28px 26px;
  text-align: center;
  font-size: 12px;
  color: var(--ink3);
  border-top: 1px solid var(--line);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(28, 32, 39, 0.94);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px -10px rgba(28, 32, 39, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 80;
  max-width: 80vw;
  text-align: center;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 可点击徽标 / 图标按钮 ---------- */
.cycle-badge {
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.12s, filter 0.15s;
}
.cycle-badge:hover { transform: translateY(-1px); filter: brightness(0.97); }
.cycle-badge:active { transform: translateY(0); }

.icon-btn {
  width: 22px;
  height: 22px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink3);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.icon-btn:hover { background: var(--risk-soft); border-color: #f0c5c2; color: var(--risk); }

/* ---------- 表单错误态 ---------- */
.input.has-error { border-color: var(--risk); background: #fff7f7; }
.input.has-error:focus { box-shadow: 0 0 0 3px rgba(196, 69, 61, 0.15); }
.field-error { display: block; margin-top: 6px; font-size: 12px; color: var(--risk); min-height: 14px; }

/* ---------- 顶栏任务切换下拉 ---------- */
.task-switch { position: relative; }

.task-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink2);
  background: #fdfbf8;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.task-pill:hover { border-color: #f2cfa8; background: #fffaf3; }
.task-switch.is-open .task-pill { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(246, 160, 44, 0.14); }

.task-pill #topbar-task-name { overflow: hidden; text-overflow: ellipsis; }

.task-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.task-due {
  flex: none;
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
  color: var(--ink3);
}

.caret { font-size: 10px; color: var(--ink3); margin-left: 2px; transition: transform 0.2s; }
.task-switch.is-open .caret { transform: rotate(180deg); }

.switcher-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px -16px rgba(33, 27, 22, 0.35);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
  z-index: 50;
}
.task-switch.is-open .switcher-panel { opacity: 1; transform: translateY(0); pointer-events: auto; }
.switcher-head { font-size: 12px; font-weight: 700; color: var(--ink3); padding: 4px 6px 10px; letter-spacing: 0.5px; }

.switcher-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.switcher-item:hover { background: #fff8f1; }
.switcher-item.is-active { background: var(--accent-soft); }
.switcher-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.switcher-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switcher-right { display: flex; align-items: center; gap: 8px; }

/* 迷你进度条（下拉 + 任务列表通用） */
.mini-prog { width: 56px; height: 5px; border-radius: 999px; background: #f1ebe3; overflow: hidden; }
.mini-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* ---------- 新建任务页：我的任务列表 ---------- */
.task-list-col { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fdfbf8;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.task-row:hover { border-color: #f2cfa8; }
.task-row.is-active { border-color: var(--accent); background: var(--accent-soft); }
.task-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.task-row-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-row-right { display: flex; align-items: center; gap: 8px; }

/* ---------- 分段控件（视图 / 筛选 / 排序） ---------- */
.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #f4efe8;
  border-radius: 9px;
}
.seg-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink3);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.seg-btn:hover { color: var(--ink2); }
.seg-btn.is-active { background: #fff; color: var(--accent-deep); box-shadow: 0 1px 3px rgba(33, 27, 22, 0.12); }
.seg-label { font-size: 12px; color: var(--ink3); padding: 0 6px; }

.todo-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.empty { padding: 30px 0; text-align: center; color: var(--ink3); font-size: 13px; }

/* 拆解页任务可点击 */
.task-list li[data-stage-task] { cursor: pointer; }
.task-list li[data-stage-task]:hover { color: var(--ink); }
.task-list li[data-stage-task]:hover .task-check { border-color: var(--accent-2); }

/* 待办方框可点击 */
.todo-box { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.todo-box:hover { border-color: var(--accent); }

/* ---------- 看板 ---------- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.kanban-col {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 12px;
  background: #faf7f2;
  border: 1px dashed #e5dcd0;
  border-radius: 13px;
  transition: background 0.15s, border-color 0.15s;
}
.kanban-col.is-over { background: var(--accent-soft); border-color: var(--accent-2); border-style: solid; }
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}
.kanban-col-title { font-size: 12.5px; font-weight: 700; color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; }
.kanban-count { font-size: 11px; font-weight: 700; color: var(--ink3); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.kanban-col-body { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.kanban-empty { font-size: 12px; color: #bdb3a6; text-align: center; padding: 30px 0; }

.kanban-card {
  padding: 11px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 1px 2px rgba(33, 27, 22, 0.04);
  cursor: grab;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -10px rgba(33, 27, 22, 0.35); border-color: #f2cfa8; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-dragging { opacity: 0.45; }
.kanban-card-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.kanban-card-title { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.kanban-card-desc { font-size: 11.5px; color: var(--ink3); line-height: 1.55; margin-top: 3px; }
.kanban-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 9px; }

/* ---------- 风险新增表单 ---------- */
.risk-form { margin-top: 14px; padding: 14px; border: 1px dashed var(--line); border-radius: 11px; background: #fdfbf8; }
.risk-form[hidden] { display: none; }

/* ---------- 复盘：经验预览 ---------- */
.lessons-preview { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .task-pill { max-width: 300px; }
}

@media (max-width: 1040px) {
  .new-layout,
  .track-layout,
  .retro-layout { grid-template-columns: minmax(0, 1fr); }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .side-brand { flex: none; padding: 0 14px 0 0; margin: 0; border-bottom: none; border-right: 1px solid var(--nav-line); }
  .side-brand-sub { display: none; }
  .sidenav { flex-direction: row; gap: 6px; }
  .nav-item { padding: 8px 12px; }
  .nav-item.is-active::before { display: none; }
  .nav-no { display: none; }
  .side-foot { display: none; }
  .topbar { height: 60px; padding: 0 18px; }
  .view { padding: 20px 18px 44px; }
  .footer { padding: 16px 18px 24px; }
}

@media (max-width: 820px) {
  .kanban-board { grid-template-columns: 1fr; }
  .kanban-col { min-height: 120px; }
  .switcher-panel { width: calc(100vw - 32px); right: -8px; }
}

@media (max-width: 760px) {
  .view { padding: 16px 14px 40px; }
  .topbar { padding: 0 14px; gap: 10px; }
  .prod-name { font-size: 12.5px; }
  .prod-tag { display: none; }
  .task-pill { max-width: 190px; padding: 6px 10px; }
  .task-due { display: none; }
  .page-head h1 { font-size: 22px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .meta-stats { flex-wrap: wrap; gap: 10px; width: 100%; }
  .meta-stats .stat { border-left: none; padding: 0 16px 0 0; min-width: 0; align-items: flex-start; }
  .stage { grid-template-columns: 40px minmax(0, 1fr); }
  .stage-index { width: 28px; height: 28px; border-radius: 9px; }
  .stage-grid { grid-template-columns: 1fr; gap: 16px; }
  .stage-body { padding: 16px; }
  .ms-name { font-size: 11px; }
  .risk-alert { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .alert-count { padding-right: 0; padding-bottom: 14px; border-right: none; border-bottom: 1px dashed #f0d4d0; }
  .summary-grid { grid-template-columns: 1fr; }
  .page-actions { flex-direction: column-reverse; }
  .page-actions .btn { width: 100%; }
  .todo-toolbar { flex-direction: column; align-items: stretch; }
  .todo-toolbar .seg { justify-content: center; }
  .big-progress b { font-size: 44px; }
}
