:root {
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1f2329;
  --muted: #7a8699;
  --border: #e5e7eb;
  --green: #58CC02;
  --green-dark: #46a302;
  --red: #FF4B4B;
  --orange: #FF9600;
  --blue: #1CB0F6;
  --purple: #CE82FF;
  --yellow: #FFC800;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* 顶部导航 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar .tab {
  flex: 1; text-align: center; padding: 13px 0;
  color: var(--muted); text-decoration: none; font-size: 14px;
  border-bottom: 3px solid transparent; font-weight: 500;
}
.topbar .tab.active { color: var(--text); font-weight: 700; border-bottom-color: var(--green); }

main { padding: 16px; max-width: 680px; margin: 0 auto; }
h1.page-title { font-size: 20px; font-weight: 700; margin-bottom: 14px; }
h2.sec-title { font-size: 15px; font-weight: 700; margin: 18px 0 10px; color: var(--text); }
.loading { text-align: center; color: var(--muted); padding: 40px 0; }
.card { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }

/* ===== 决策指标卡（顶部4卡） ===== */
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.metric-card {
  border-radius: 16px; padding: 16px; color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 3px 0 rgba(0,0,0,0.15);
}
.metric-card .num { font-size: 30px; font-weight: 800; line-height: 1; }
.metric-card .label { font-size: 13px; opacity: 0.9; margin-top: 6px; }
.metric-card.blue { background: var(--blue); }
.metric-card.red { background: linear-gradient(135deg, #FF4B4B, #e63b3b); }
.metric-card.green { background: var(--green); }
.metric-card.purple { background: var(--purple); }

/* ===== 九宫格 ===== */
.ninebox { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ninebox .axis-label { font-size: 12px; color: var(--muted); text-align: center; padding: 4px; }
.nine-cell {
  border-radius: 12px; min-height: 72px; padding: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; border: 2px solid transparent;
}
.nine-cell .cell-name { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.nine-cell .cell-people { font-size: 11px; line-height: 1.4; }
.nine-cell.star { background: #e8f8d8; border-color: var(--green); }
.nine-cell.star .cell-name { color: var(--green-dark); }
.nine-cell.backbone { background: #e3f3fd; border-color: var(--blue); }
.nine-cell.backbone .cell-name { color: #0b8ac9; }
.nine-cell.potential { background: #fff3e0; border-color: var(--orange); }
.nine-cell.potential .cell-name { color: #d97e00; }
.nine-cell.weak { background: #fdeaea; border-color: var(--red); }
.nine-cell.weak .cell-name { color: #c0392b; }

/* ===== 预警中心 ===== */
.alert-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; border-radius: 12px; margin-bottom: 8px; font-size: 14px;
}
.alert-item.alert { background: #fdeaea; border-left: 4px solid var(--red); }
.alert-item.warn { background: #fff3e0; border-left: 4px solid var(--orange); }
.alert-item.info { background: #e3f3fd; border-left: 4px solid var(--blue); }
.alert-item .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.alert-item.alert .dot { background: var(--red); animation: pulse 1.2s infinite; }
.alert-item.warn .dot { background: var(--orange); }
.alert-item.info .dot { background: var(--blue); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ===== 晋升卡 ===== */
.promo-card .promo-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.promo-level {
  padding: 6px 14px; border-radius: 10px; font-weight: 700; font-size: 15px;
  background: #f0f2f5; color: var(--muted);
}
.promo-arrow { font-size: 20px; color: var(--muted); }
.promo-level.next { background: var(--green); color: #fff; }
.promo-done { background: #e8f8d8; color: var(--green-dark); padding: 10px; border-radius: 10px; font-weight: 600; text-align: center; }
.promo-check {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid #f3f4f6; font-size: 14px;
}
.promo-check:last-child { border-bottom: none; }
.promo-check .val { font-weight: 600; }
.promo-check.met .val { color: var(--green); }
.promo-check.notmet .val { color: var(--red); }
.promo-check.unknown .val { color: var(--orange); }
.promo-check .badge {
  font-size: 12px; padding: 2px 8px; border-radius: 20px;
}
.promo-check.met .badge { background: #e8f8d8; color: var(--green-dark); }
.promo-check.notmet .badge { background: #fdeaea; color: var(--red); }
.promo-check.unknown .badge { background: #fff3e0; color: var(--orange); }

/* ===== 今日事务 ===== */
.task-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; }
.task-item:last-child { border-bottom: none; }
.task-item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--green); flex-shrink: 0; }
.task-item .task-text { flex: 1; font-size: 14px; }
.task-item.done .task-text { text-decoration: line-through; color: var(--muted); }
.task-add { display: flex; gap: 8px; margin-top: 10px; }
.task-add input {
  flex: 1; padding: 10px 12px; border: 2px solid var(--border); border-radius: 10px; font-size: 14px;
}
.task-add input:focus { outline: none; border-color: var(--green); }
.task-add button {
  padding: 10px 16px; border: none; border-radius: 10px; background: var(--green); color: #fff;
  font-weight: 700; cursor: pointer; box-shadow: 0 3px 0 var(--green-dark);
}
.task-add button:active { transform: translateY(3px); box-shadow: none; }

/* ===== 周小结 ===== */
.report-textarea {
  width: 100%; min-height: 90px; padding: 12px; border: 2px solid var(--border);
  border-radius: 10px; font-size: 14px; font-family: inherit; resize: vertical;
}
.report-textarea:focus { outline: none; border-color: var(--green); }
.report-save {
  margin-top: 10px; padding: 10px 18px; border: none; border-radius: 10px;
  background: var(--green); color: #fff; font-weight: 700; cursor: pointer;
  box-shadow: 0 3px 0 var(--green-dark);
}
.report-save:active { transform: translateY(3px); box-shadow: none; }

/* ===== 状态墙 ===== */
.dept-block { margin-bottom: 8px; }
.dept-title { font-size: 13px; color: var(--muted); margin: 12px 0 8px; padding-left: 4px; border-left: 3px solid var(--green); }
.user-card {
  background: var(--card); border-radius: 12px; padding: 12px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #8ee04a); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 15px; font-weight: 600; }
.user-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.progress-bar { width: 100%; height: 6px; background: var(--border); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 3px; }

.badge { font-size: 12px; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.badge.工作中 { background: #e8f5e9; color: #2e7d32; }
.badge.学习中 { background: #fff8e1; color: #f57f17; }
.badge.休假 { background: #fce4ec; color: #c2185b; }

/* ===== 身份卡 ===== */
.identity { display: flex; align-items: center; gap: 14px; }
.identity .avatar { width: 54px; height: 54px; font-size: 22px; }
.identity .name { font-size: 19px; font-weight: 700; }
.identity .pos { font-size: 13px; color: var(--muted); margin-top: 3px; }
.identity .tags { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== 学习路线图 ===== */
.sequence {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
}
.seq-node {
  padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 700;
  background: #f0f2f5; color: var(--muted); border: 2px solid var(--border);
}
.seq-node.current { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 3px 0 var(--green-dark); }
.seq-node.target { background: #fff; color: var(--text); border-color: var(--orange); border-style: dashed; }
.seq-arrow { color: var(--muted); font-size: 16px; }

.category-block { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.category-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.skill-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f5f6f8; }
.skill-row:last-child { border-bottom: none; }
.skill-name { font-size: 14px; }
.skill-note { font-size: 11px; color: var(--muted); margin-top: 2px; }
.star-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border);
  background: transparent; cursor: pointer; font-size: 13px; color: transparent; margin-left: 3px;
  transition: all 0.15s;
}
.star-btn.filled { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ===== 下一步推荐 ===== */
.recommend-item {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px;
  background: #fff9e6; border: 1px solid #ffe08a; margin-bottom: 8px; font-size: 14px;
}
.recommend-item .num { width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

.user-switch { background: var(--card); border-radius: 10px; padding: 12px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.user-switch select { flex: 1; padding: 9px; border: 2px solid var(--border); border-radius: 8px; font-size: 14px; }
