/* v0.8 作战台专用样式 · 紫色主题 #5b5bd6 */

:root {
  --wr-primary: #5b5bd6;
  --wr-primary-dark: #4747b7;
  --wr-primary-soft: #eeeeff;
  --wr-bg: #f4f5f9;
  --wr-card-bg: #ffffff;
  --wr-text: #252638;
  --wr-text-muted: #74778d;
  --wr-danger: #da5a61;
  --wr-warn: #efa834;
  --wr-success: #27ae60;
  --wr-border: #e8e9ef;
}

body {
  margin: 0;
  background: var(--wr-bg);
  font-family: 'DM Sans', 'Noto Sans SC', -apple-system, sans-serif;
  color: var(--wr-text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--wr-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === 顶层布局 === */
.warroom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

/* === Topbar === */
.war-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--wr-card-bg);
  padding: 12px 18px;
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.war-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.war-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.war-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--wr-text);
}
.war-version {
  font-size: 10px;
  color: var(--wr-text-muted);
  font-weight: 500;
  padding: 2px 6px;
  background: var(--wr-primary-soft);
  border-radius: 6px;
  margin-left: 4px;
}
.war-date {
  font-size: 11px;
  color: var(--wr-text-muted);
  margin-top: 2px;
}
.war-topbar-right {
  display: flex;
  gap: 8px;
}
.war-fab-quickadd, .war-fab-refresh, .war-fab-exit {
  background: var(--wr-primary-soft);
  color: var(--wr-primary);
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.war-fab-quickadd {
  background: var(--wr-primary);
  color: #fff;
}
.war-fab-quickadd:hover {
  background: var(--wr-primary-dark);
}
.war-fab-refresh:hover, .war-fab-exit:hover {
  background: var(--wr-primary);
  color: #fff;
}

/* === 通用卡片 === */
.war-card {
  background: var(--wr-card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.war-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.war-card-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--wr-text);
}
.war-card-link {
  font-size: 11px;
  color: var(--wr-text-muted);
  font-weight: normal;
}
.war-card-link:hover {
  color: var(--wr-primary);
}

/* === 核心区（焦点+风险） === */
.war-grid-core {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.war-grid-core > .war-card { margin-bottom: 0; }

/* === 焦点卡 === */
.war-focus { position: relative; }
.war-focus-energy {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}
.war-focus-ring {
  position: absolute;
  top: 14px;
  right: 100px;
  width: 60px;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, var(--wr-primary-soft) 60%, transparent 70%);
  border-radius: 50%;
}
.war-focus-ring-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--wr-primary);
}
.war-focus-ring-cap {
  font-size: 8px;
  color: var(--wr-text-muted);
}

/* === 焦点项 === */
.war-focus-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.war-focus-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--wr-bg);
  border-left: 4px solid var(--wr-text-muted);
  border-radius: 8px;
  transition: all 0.15s;
}
.war-focus-item.priority-P0 { border-left-color: var(--wr-danger); }
.war-focus-item.priority-P1 { border-left-color: var(--wr-warn); }
.war-focus-item.priority-P2 { border-left-color: var(--wr-primary); }
.war-focus-item.priority-P3 { border-left-color: #b5b5b5; }
.war-focus-item:hover {
  background: var(--wr-primary-soft);
  transform: translateX(3px);
}
.war-focus-item.completing {
  opacity: 0.5;
}
.war-focus-item-content {
  flex: 1;
  min-width: 0;
}
.war-focus-item-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 3px;
  word-break: break-word;
}
.war-focus-item-meta {
  font-size: 10.5px;
  color: var(--wr-text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.war-focus-item-prio {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  background: var(--wr-text-muted);
  flex-shrink: 0;
}
.war-focus-item.priority-P0 .war-focus-item-prio { background: var(--wr-danger); }
.war-focus-item.priority-P1 .war-focus-item-prio { background: var(--wr-warn); }
.war-focus-item.priority-P2 .war-focus-item-prio { background: var(--wr-primary); }

/* 完成按钮 */
.war-btn-done {
  background: var(--wr-success);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.war-btn-done:hover { background: #229954; }

/* === 风险卡 === */
.war-risks-summary {
  font-size: 11px;
  color: var(--wr-text-muted);
}
.war-risk-group {
  margin-bottom: 10px;
}
.war-risk-group:last-child { margin-bottom: 0; }
.war-risk-group-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--wr-text-muted);
  margin-bottom: 4px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.war-risk-group-head .num {
  background: var(--wr-danger);
  color: #fff;
  border-radius: 8px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
}
.war-risk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--wr-bg);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}
.war-risk-item.overdue {
  background: linear-gradient(90deg, #fde7e9 0%, transparent 100%);
  border-left: 3px solid var(--wr-danger);
}
.war-risk-item.upcoming {
  background: linear-gradient(90deg, #fef3e0 0%, transparent 100%);
  border-left: 3px solid var(--wr-warn);
}
.war-risk-item-title {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.war-risk-empty {
  text-align: center;
  color: var(--wr-text-muted);
  padding: 16px;
  background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
  border-radius: 8px;
  font-weight: 600;
  color: #2c3e50;
}

/* === 项目驾驶舱 === */
.war-projects-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(120px, auto);
  gap: 12px;
}
.war-project-card {
  background: var(--wr-bg);
  padding: 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 4px solid var(--wr-primary);
  overflow: hidden;
  position: relative;
}
.war-project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.war-project-card-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  word-break: break-word;
}
.war-project-next-step {
  font-size: 11.5px;
  color: var(--wr-text-muted);
  margin-bottom: 8px;
  padding: 4px 0;
  min-height: 24px;
  line-height: 1.4;
  word-break: break-word;
}
.war-project-next-step.empty {
  color: var(--wr-danger);
  font-style: italic;
  background: rgba(218, 90, 97, 0.08);
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px dashed rgba(218, 90, 97, 0.4);
  display: block;
}
.war-project-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.war-project-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.war-project-progress-fill {
  height: 100%;
  background: var(--wr-primary);
  border-radius: 3px;
}
.war-project-progress-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--wr-primary);
  min-width: 30px;
  text-align: right;
}
.war-project-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 10.5px;
}
.war-project-stat {
  background: var(--wr-primary-soft);
  color: var(--wr-primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* === 4 列行动区（看板） === */
.war-kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.war-kanban-col {
  background: var(--wr-bg);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}
.war-col-head {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--wr-border);
  display: flex;
  align-items: center;
  gap: 4px;
}
.war-col-count {
  background: rgba(0,0,0,0.06);
  border-radius: 8px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
}
.war-col-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.war-task-card {
  background: var(--wr-card-bg);
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--wr-text-muted);
  font-size: 12px;
  transition: all 0.15s;
  cursor: pointer;
}
.war-task-card:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.war-task-card.P0 { border-left-color: var(--wr-danger); }
.war-task-card.P1 { border-left-color: var(--wr-warn); }
.war-task-card.P2 { border-left-color: var(--wr-primary); }
.war-task-card.P3 { border-left-color: #b5b5b5; }
.war-task-card-title {
  font-weight: 600;
  word-break: break-word;
  font-size: 12px;
  margin-bottom: 3px;
}
.war-task-card-meta {
  font-size: 10px;
  color: var(--wr-text-muted);
  display: flex;
  gap: 4px;
}
.war-task-card-meta-item {
  background: rgba(0,0,0,0.04);
  padding: 1px 4px;
  border-radius: 3px;
}

/* === 闪念 + 中长期 === */
.war-grid-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.war-grid-info > .war-card { margin-bottom: 0; }

.war-flash-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--wr-bg);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12.5px;
}
.war-flash-pin {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wr-warn);
  color: #fff;
  font-size: 11px;
}
.war-flash-content {
  flex: 1;
  word-break: break-word;
}
.war-flash-actions {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.war-flash-btn {
  font-size: 10px;
  padding: 3px 7px;
  border: none;
  border-radius: 4px;
  background: var(--wr-primary-soft);
  color: var(--wr-primary);
  cursor: pointer;
  font-weight: 600;
}
.war-flash-btn:hover { background: var(--wr-primary); color: #fff; }

/* 中长期 */
.war-midlong-item {
  background: var(--wr-bg);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.war-midlong-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.war-midlong-meta {
  font-size: 11px;
  color: var(--wr-text-muted);
  display: flex;
  gap: 8px;
}

/* === 本周复盘建议 === */
.war-advice-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.war-advice-item {
  background: var(--wr-bg);
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 4px solid var(--wr-primary);
  font-size: 13px;
  font-weight: 500;
}

/* === 抽屉 === */
.war-drawer-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1000;
  display: none;
  justify-content: flex-end;
}
.war-drawer-bg.open { display: flex; }
.war-drawer {
  background: #fff;
  width: 398px;
  max-width: 100vw;
  height: 100vh;
  overflow-y: auto;
  padding: 18px 20px;
  box-shadow: -2px 0 12px rgba(0,0,0,0.1);
}
.war-drawer-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}
.war-drawer-title {
  font-weight: 700;
  font-size: 16px;
}
.war-drawer-close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--wr-text-muted);
}

/* === empty 状态 === */
.war-empty-clean {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #2c3e50;
  padding: 32px 16px;
  background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
  border-radius: 10px;
  font-weight: 600;
  min-height: 120px;
  gap: 8px;
}
.war-empty-clean > span {
  font-weight: normal;
  font-size: 11px;
  opacity: 0.7;
}
.war-col-body .empty {
  padding: 14px 8px !important;
  font-size: 11px !important;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wr-text-muted);
  background: var(--wr-bg);
  border-radius: 6px;
  border: 1px dashed var(--wr-border);
}

/* === Footer === */
.war-footer {
  text-align: center;
  font-size: 11px;
  color: var(--wr-text-muted);
  padding: 16px 0;
}

/* === 响应式 === */
@media (max-width: 1024px) {
  .war-kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .war-projects-body { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .warroom { padding: 10px; }
  .war-grid-core { grid-template-columns: 1fr; }
  .war-grid-info { grid-template-columns: 1fr; }
  .war-kanban { grid-template-columns: 1fr; }
  .war-focus-ring { right: 14px; top: 12px; width: 50px; height: 50px; }
  .war-focus-ring-num { font-size: 14px; }
  .war-topbar { padding: 10px 12px; }
  .war-fab-quickadd, .war-fab-refresh, .war-fab-exit { padding: 6px 10px; font-size: 12px; }
  .war-drawer { width: 100vw; }
}
