/* =========================================================
   山海计划 · 涉外培训项目 Agent — Aether Clay 设计系统
   柔润拟物 / 冰霜蓝环境 / 药丸几何 / 无 Emoji
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  /* Canvas & Surfaces */
  --canvas: #ebf1f6;
  --bg: #eaf0f6;
  --bg-elev: #f4f8fc;
  --bg-sub: #e2eaf2;
  --surface: #f4f8fa;
  --surface-bright: #ffffff;

  /* Accents */
  --primary: #3b82f6;
  --primary-ink: #1d3fb0;
  --primary-soft: #d8e2ff;
  --primary-container: #2170e4;
  --navy: #0f172a;
  --navy-light: #1e2b3e;
  --navy-dark: #121b2b;

  /* Semantics */
  --ok: #2f9e6b;
  --ok-soft: #e7f5ee;
  --warn: #d9822b;
  --warn-soft: #fdf1e3;
  --danger: #d6453d;
  --danger-soft: #fbeae9;
  --info: #2b5cf0;

  /* Text */
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --text-muted: #94a3b8;

  /* Lines */
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --outline: #727785;

  /* Shadows — Clay dual-source */
  --shadow-sm: 3px 3px 10px rgba(170, 185, 205, 0.28), -3px -3px 10px rgba(255, 255, 255, 0.95);
  --shadow-md: 6px 6px 18px rgba(166, 182, 204, 0.32), -6px -6px 18px rgba(255, 255, 255, 0.95);
  --shadow-lg: 8px 10px 24px rgba(160, 178, 202, 0.28), -8px -8px 24px rgba(255, 255, 255, 0.98);
  --shadow-float: 0 14px 34px -4px rgba(22, 34, 56, 0.08), 0 4px 12px -2px rgba(22, 34, 56, 0.04);
  --shadow-inset: inset 2px 2px 6px rgba(165, 182, 205, 0.38), inset -2px -2px 6px rgba(255, 255, 255, 0.95);
  --shadow-inset-sm: inset 1.5px 1.5px 4px rgba(165, 182, 205, 0.30), inset -1.5px -1.5px 4px rgba(255, 255, 255, 0.95);
  --shadow-dock: 3px 4px 10px rgba(22, 34, 56, 0.35), -2px -2px 6px rgba(255, 255, 255, 0.9);

  /* Radius */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Layout */
  --header-h: 56px;
  --dock-w: 224px;
  --planner-w: 260px;
  --agent-w: 320px;
  --ic: 18px;

  /* Typography */
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', sans-serif;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hirino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: linear-gradient(135deg, #e4eff7 0%, #edf4f9 40%, #e2ecf5 75%, #ebf2f8 100%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(180, 195, 215, 0.6); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(145, 165, 190, 0.8); }

@keyframes pulseGlow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Ambient glow */
.ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.ambient > div {
  position: absolute; border-radius: 9999px; filter: blur(80px);
  animation: pulseGlow 6s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.ambient .g1 { top: -10%; left: -8%; width: 30rem; height: 30rem; background: linear-gradient(135deg, rgba(191, 219, 254, .55), rgba(224, 242, 254, .35)); }
.ambient .g2 { top: 18%; right: -10%; width: 36rem; height: 36rem; background: linear-gradient(135deg, rgba(204, 251, 241, .40), rgba(224, 242, 254, .40)); animation-delay: 2s; }
.ambient .g3 { bottom: -12%; left: 28%; width: 40rem; height: 40rem; background: linear-gradient(135deg, rgba(199, 210, 254, .40), rgba(224, 242, 254, .30)); animation-delay: 1s; }

/* App shell */
#app { display: flex; flex-direction: column; height: 100vh; position: relative; z-index: 1; }
.app-body {
  flex: 1;
  display: flex;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: linear-gradient(90deg, rgba(244, 248, 252, .95) 0%, rgba(255, 255, 255, .88) 50%, rgba(241, 246, 251, .95) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 2px 12px rgba(170, 186, 208, .22);
  backdrop-filter: blur(14px);
  position: relative; z-index: 30;
  flex-shrink: 0;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 14px;
  background: linear-gradient(135deg, var(--navy-light), var(--navy-dark));
  box-shadow: var(--shadow-dock);
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.brand-title { font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: -.01em; }
.project-tag {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--radius-full);
  background: linear-gradient(180deg, #fff 0%, #f2f7fb 100%);
  border: 1px solid #fff;
  box-shadow: var(--shadow-sm);
  font-size: 12px; color: var(--text-2); cursor: pointer;
  white-space: nowrap; max-width: 260px;
}
.project-tag #activeProjectName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.project-tag .dot { width: 8px; height: 8px; border-radius: 9999px; background: var(--ok); box-shadow: 0 0 0 4px rgba(47, 158, 107, .12); }
.project-tag .tminus { font-family: var(--font-display); font-size: 11px; color: var(--text-3); background: #f1f5f9; padding: 2px 8px; border-radius: 9999px; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: var(--radius-full);
  background: rgba(246, 250, 253, .9); border: 1px solid rgba(255, 255, 255, .95);
  box-shadow: var(--shadow-inset-sm);
  width: 260px;
}
.topbar-search input { border: 0; outline: 0; background: transparent; flex: 1; color: var(--text); font-size: 12.5px; }
.topbar-search input::placeholder { color: var(--text-muted); }
.search-icon { width: 16px; height: 16px; color: var(--text-muted); display: inline-flex; }
.topbar-kbd {
  font-family: var(--font-display); font-size: 10px; color: var(--text-3);
  background: #eaf0f6; border: 1px solid #fff; padding: 2px 7px; border-radius: 9999px;
  white-space: nowrap;
}
.user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; border-radius: var(--radius-full);
  background: linear-gradient(180deg, #fff 0%, #f2f7fb 100%);
  border: 1px solid #fff; box-shadow: var(--shadow-sm);
}
.user-ava {
  width: 28px; height: 28px; border-radius: 9999px;
  background: linear-gradient(135deg, #fff, #eaf0f6);
  border: 1px solid #fff; box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--text-2);
}
.user-role { font-size: 11px; font-weight: 600; color: var(--text); }

/* ---------- 左侧 Dock（分组 + 标签） ---------- */
.dock {
  width: var(--dock-w); min-width: var(--dock-w);
  display: flex; flex-direction: column; align-items: stretch;
  padding: 14px 12px; gap: 4px;
  background: linear-gradient(180deg, rgba(247, 250, 253, .95) 0%, rgba(241, 246, 251, .95) 50%, rgba(235, 242, 248, .95) 100%);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow-y: auto; z-index: 20;
  transition: width .18s ease, min-width .18s ease;
}
.dock.dock-collapsed { width: 76px; min-width: 76px; padding: 14px 10px; }
.dock-group { width: 100%; margin-bottom: 10px; }
.dock-group-title {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 6px; border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-display); font-size: 10.5px; font-weight: 600;
  letter-spacing: .06em; color: var(--text-3); text-transform: none;
}
.dock-group-title.static { cursor: default; }
.dock-group-title.static .dock-group-caret { display: none; }
.dock-group-caret { display: inline-flex; transition: transform .18s ease; color: var(--text-muted); }
.dock-group--collapsed .dock-group-list { display: none; }
.dock-group--collapsed.open .dock-group-list { display: flex; }
.dock-group--collapsed.open .dock-group-caret { transform: rotate(180deg); }
.dock-group-list { display: flex; flex-direction: column; gap: 2px; }
.dock-btn {
  width: 100%; height: auto; border-radius: 14px;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px;
  color: var(--text-2); background: transparent;
  font-size: 13px; font-weight: 500; text-align: left;
  transition: all .15s ease;
}
.dock-btn:hover { background: rgba(255, 255, 255, .8); box-shadow: var(--shadow-sm); color: var(--text); }
.dock-btn.active {
  background: linear-gradient(135deg, var(--navy-light), var(--navy-dark));
  color: #fff; box-shadow: var(--shadow-dock);
}
.dock-btn .dock-ico { width: 20px; height: 20px; display: inline-flex; flex-shrink: 0; }
.dock-btn .dock-ico svg { width: 20px; height: 20px; }
.dock-btn .dock-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock.dock-collapsed .dock-group-title, .dock.dock-collapsed .dock-label { display: none; }
.dock.dock-collapsed .dock-group { margin-bottom: 6px; }
.dock.dock-collapsed .dock-btn { justify-content: center; padding: 10px 0; }

/* ---------- Planner 侧栏 ---------- */
.planner {
  width: var(--planner-w); min-width: var(--planner-w);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px 14px;
  background: linear-gradient(180deg, rgba(246, 249, 253, .95) 0%, rgba(239, 245, 250, .9) 50%, rgba(233, 241, 247, .95) 100%);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow-y: auto; z-index: 20;
  transition: width .22s ease, min-width .22s ease, opacity .22s ease, padding .22s ease;
}
.planner.collapsed {
  width: 0 !important; min-width: 0 !important;
  padding-left: 0; padding-right: 0; opacity: 0;
  overflow: hidden; pointer-events: none;
  border-color: transparent; box-shadow: none;
}
.planner-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; margin-left: 6px; flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(203, 213, 225, .6); background: rgba(255, 255, 255, .75);
  color: var(--text-2); cursor: pointer;
  transition: background .15s ease, color .15s ease, transform .2s ease;
}
.planner-toggle-btn:hover { background: #fff; color: var(--text); }
.planner-toggle-btn.collapsed { transform: rotate(180deg); }
.planner-toggle-btn.hide { display: none !important; }
#menuBtn { display: none; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(203,213,225,.6); background: rgba(255,255,255,.75); color: var(--text-2); cursor: pointer; }
#menuBtn:hover { background: #fff; color: var(--text); }
.planner-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; }
.planner-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.planner-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); font-family: var(--font-display); }
.planner-section { display: flex; flex-direction: column; gap: 8px; }
.planner-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: var(--radius);
  font-size: 12.5px; color: var(--text-2);
  transition: all .15s ease; cursor: pointer;
}
.planner-item:hover { background: rgba(255, 255, 255, .7); }
.planner-item.active {
  background: linear-gradient(145deg, #fff 0%, #eef5fa 100%);
  border: 1px solid #fff; box-shadow: var(--shadow-sm);
  color: var(--text);
  font-weight: 500;
}
.planner-item .count {
  min-width: 22px; height: 22px; border-radius: 9999px;
  background: #f1f5f9; color: var(--text-2); font-size: 11px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; padding: 0 6px;
}
.planner-status { padding-top: 10px; border-top: 1px solid rgba(203, 213, 225, .4); display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--text-3); }

/* ---------- 中央舞台 ---------- */
.stage {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 14px;
  overflow-y: auto; padding-right: 4px;
}

/* ---------- 右侧 Agent 面板 ---------- */
.agent-panel {
  width: var(--agent-w); min-width: var(--agent-w);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(247, 250, 253, .95) 0%, rgba(239, 245, 250, .9) 50%, rgba(233, 241, 247, .95) 100%);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden; z-index: 20;
}
.agent-panel.collapsed { display: none; }
.agent-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid rgba(203, 213, 225, .4);
  background: linear-gradient(90deg, rgba(255, 255, 255, .9) 0%, rgba(247, 250, 253, .8) 50%, rgba(255, 255, 255, .7) 100%);
}
.agent-title-wrap { display: flex; align-items: center; gap: 10px; }
.agent-title { font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: -.01em; }
.agent-status {
  font-size: 10px; font-family: var(--font-display); color: var(--text-3);
  background: #fff; padding: 4px 10px; border-radius: 9999px;
  border: 1px solid #fff; box-shadow: var(--shadow-sm);
}
.agent-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.agent-input-dock {
  padding: 14px; border-top: 1px solid rgba(203, 213, 225, .4);
  background: linear-gradient(180deg, rgba(249, 251, 254, .9) 0%, rgba(237, 244, 249, .9) 100%);
  display: flex; flex-direction: column; gap: 10px;
}
.agent-quick-actions { display: flex; gap: 8px; overflow-x: auto; }
.agent-quick-actions button {
  white-space: nowrap; padding: 6px 12px; border-radius: var(--radius-full);
  background: linear-gradient(180deg, #fff 0%, #f4f8fc 100%);
  border: 1px solid #fff; box-shadow: var(--shadow-sm);
  font-size: 11px; color: var(--text-2); font-weight: 500;
}
.agent-quick-actions button:hover { color: var(--text); box-shadow: var(--shadow-md); }
.agent-input-wrap { position: relative; }
.agent-input-wrap textarea {
  width: 100%; border: 1px solid #fff; border-radius: var(--radius);
  padding: 12px 42px 12px 14px; resize: none; outline: none;
  background: #f4f9fd; box-shadow: var(--shadow-inset-sm);
  font-size: 12.5px; color: var(--text);
}
.agent-input-wrap textarea:focus { background: #fff; box-shadow: var(--shadow-inset); }
.agent-send {
  position: absolute; right: 8px; bottom: 8px;
  width: 32px; height: 32px; border-radius: 14px;
  background: linear-gradient(135deg, var(--navy-light), var(--navy-dark));
  color: #fff; box-shadow: var(--shadow-dock);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- 消息气泡 ---------- */
.msg { display: flex; gap: 8px; max-width: 94%; }
.msg .m-ava { width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .m-ava { background: var(--navy); color: #fff; }
.msg.agent .m-ava { background: var(--primary-soft); color: var(--primary-ink); }
.msg .m-body {
  background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%);
  border: 1px solid #fff; box-shadow: var(--shadow-sm);
  border-radius: 14px; padding: 10px 12px; font-size: 12.5px; color: var(--text-2);
}
.msg.user .m-body { background: linear-gradient(135deg, var(--navy-light), var(--navy-dark)); color: #fff; border-color: transparent; }
.msg .m-body .m-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }
.msg.user .m-body .m-time { color: rgba(255, 255, 255, .7); }
.msg .m-body .m-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.msg .m-body button.mini { font-size: 11px; padding: 5px 10px; border-radius: 12px; border: 1px solid #fff; background: #f4f8fc; color: var(--text); box-shadow: var(--shadow-sm); }
.msg .m-body button.mini.primary { background: var(--navy); color: #fff; border-color: transparent; }
.msg .m-body ul { margin: 6px 0 2px; padding-left: 18px; }
.msg .m-body li { margin: 2px 0; }
.msg .m-body code { background: #eef1f5; padding: 1px 5px; border-radius: 4px; font-size: 11px; }

/* ---------- 整页 AI 对话 ---------- */
.chat-page { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-stream { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }
.chat-stream .msg { max-width: 78%; }
.insight-panel { margin: 12px 22px 0; padding: 10px 14px; border: 1px solid rgba(15,23,42,.10); border-left: 3px solid var(--navy, #2B6CB0); background: #fafbfc; border-radius: 8px; }
.insight-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.insight-title { font-weight: 600; color: #1f2a37; font-size: 14px; }
.insight-score { font-weight: 600; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.insight-score.good { color: #1a7f37; background: #e8f5ec; }
.insight-score.warn { color: #9a6700; background: #fdf3e0; }
.insight-score.bad { color: #b12029; background: #fcebeb; }
.insight-meta { color: #6b7280; font-size: 12px; margin-bottom: 5px; }
.insight-list { margin: 2px 0; }
.insight-item { color: #374151; line-height: 1.7; font-size: 13px; }
.insight-ok { color: #1a7f37; font-size: 13px; }
.insight-tip { margin-top: 6px; color: #2B6CB0; background: #f3f7fb; padding: 5px 10px; border-radius: 6px; font-size: 13px; }
.insight-loading, .insight-empty { color: #9ca3af; font-size: 12px; }
.chat-compose { border-top: 1px solid rgba(15, 23, 42, .10); padding: 12px 22px 18px; background: var(--surface); }
.chat-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(15, 23, 42, .12); background: #eef4fa; color: var(--text-2); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chat-input-row { display: flex; gap: 10px; align-items: flex-end; }
.chat-input { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(15, 23, 42, .12); background: #fff; color: var(--text); font-size: 14px; line-height: 1.5; font-family: inherit; }
.chat-input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--primary-soft); }
.chat-input-row .primary-btn, .chat-input-row .ghost-btn { height: 44px; white-space: nowrap; }

/* ---------- 按钮 ---------- */
.primary-btn, .ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 18px; border-radius: var(--radius-full);
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: all .15s ease;
}
.primary-btn {
  background: linear-gradient(135deg, var(--navy-light), var(--navy-dark));
  color: #fff; box-shadow: var(--shadow-dock);
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(15, 23, 42, .28); }
.ghost-btn {
  background: linear-gradient(180deg, #fff 0%, #f2f7fb 100%);
  border: 1px solid #fff; color: var(--text-2); box-shadow: var(--shadow-sm);
}
.ghost-btn:hover { background: #fff; box-shadow: var(--shadow-md); color: var(--text); }
.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; color: var(--text-2);
  background: linear-gradient(180deg, #fff 0%, #f2f7fb 100%);
  border: 1px solid #fff; box-shadow: var(--shadow-sm);
}
.icon-btn:hover { box-shadow: var(--shadow-md); color: var(--text); }
.btn-label { line-height: 1; }

/* ---------- 卡片 / 模块 ---------- */
.card {
  background: linear-gradient(175deg, #e8f2f8 0%, #eff5fb 18%, #f7fafd 55%, #fff 100%);
  border: 1px solid rgba(255, 255, 255, .95); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 22px;
  transition: box-shadow .25s ease;
}
.card:hover { box-shadow: var(--shadow-float); }
.card-title { font-family: var(--font-display); font-size: 14px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.card-title .ct-icon { width: 18px; height: 18px; color: var(--text-3); display: inline-flex; }
.metric {
  background: linear-gradient(145deg, #fff 0%, #f8fbfe 50%, #edf4f9 100%);
  border: 1px solid #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 18px;
  transition: box-shadow .2s ease;
}
.metric:hover { box-shadow: var(--shadow-md); }
.metric .m-val { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.metric .m-label { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.metric .m-ico { width: 18px; height: 18px; color: var(--primary); display: inline-flex; }

/* ---------- 任务行 / Todo ---------- */
.task-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border: 1px solid #fff; box-shadow: var(--shadow-sm);
  cursor: pointer; transition: all .15s ease;
}
.task-row:hover { box-shadow: var(--shadow-md); }
.task-row.active { background: repeating-linear-gradient(-45deg, rgba(215, 228, 240, .42) 0, rgba(215, 228, 240, .42) 6px, rgba(235, 243, 250, .55) 6px, rgba(235, 243, 250, .55) 12px); border-color: rgba(255, 255, 255, .9); }
.task-row-main { display: flex; align-items: center; gap: 12px; }
.task-handle { color: var(--text-muted); cursor: grab; }
.task-handle svg { width: 16px; height: 16px; }
.task-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #f4f8fc 100%);
  border: 1px solid #fff; box-shadow: var(--shadow-sm);
  font-size: 11px; font-family: var(--font-display); font-weight: 600; color: var(--text-2);
  white-space: nowrap;
}
.task-pill .status-dot { width: 18px; height: 18px; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; }
.task-pill .status-dot.done { background: var(--ok); color: #fff; }
.task-pill .status-dot.scheduled { border: 2px dashed var(--warn); }
.task-pill .status-dot.pending { border: 2px dashed var(--text-muted); }
.task-pill .status-dot svg { width: 11px; height: 11px; }
.task-name { font-size: 13px; font-weight: 600; color: var(--text); }
.task-meta { font-size: 11px; font-family: var(--font-display); color: var(--text-3); background: rgba(255, 255, 255, .7); padding: 3px 9px; border-radius: 9999px; border: 1px solid #fff; white-space: nowrap; }
.task-arrow { color: var(--text-muted); transition: color .15s; }
.task-row:hover .task-arrow { color: var(--text); }

/* ---------- 状态 ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 9999px; border: 1px solid #fff; background: linear-gradient(180deg, #fff 0%, #f2f7fb 100%); box-shadow: var(--shadow-sm); white-space: nowrap; }
.status.todo { color: var(--text-2); }
.status.doing { color: var(--primary-ink); background: var(--primary-soft); border-color: #cfe0ff; }
.status.done { color: var(--ok); background: var(--ok-soft); border-color: #bfe6d2; }
.status.risk { color: var(--danger); background: var(--danger-soft); border-color: #f3c9c6; }
.status.frozen { color: var(--text-2); background: #f1f5f9; border-color: #e2e8f0; }
.status.wait { color: var(--warn); background: var(--warn-soft); border-color: #f4d9b6; }

/* ---------- 标签 ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 4px 10px; border-radius: 9999px; background: linear-gradient(180deg, #fff 0%, #f2f7fb 100%); color: var(--text-2); border: 1px solid #fff; box-shadow: var(--shadow-sm); white-space: nowrap; max-width: 100%; }
.tag.blue { background: var(--primary-soft); color: var(--primary-ink); border-color: #cfe0ff; }
.tag.green { background: var(--ok-soft); color: var(--ok); border-color: #bfe6d2; }
.tag.amber { background: var(--warn-soft); color: var(--warn); border-color: #f4d9b6; }
.tag.red { background: var(--danger-soft); color: var(--danger); border-color: #f3c9c6; }
.tag .t-ico { width: 13px; height: 13px; display: inline-flex; }

/* ---------- 列表/表格 ---------- */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid #fff; border-radius: var(--radius);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow: var(--shadow-sm);
}
.list-row + .list-row { margin-top: 8px; }
.list-row:hover { box-shadow: var(--shadow-md); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 13px; }
table.tbl th { text-align: left; color: var(--text-3); font-weight: 600; font-size: 11px; padding: 8px 12px; }
table.tbl td { padding: 11px 12px; background: linear-gradient(180deg, #fff 0%, #f8fafc 100%); border-top: 1px solid #fff; border-bottom: 1px solid #fff; }
table.tbl td:first-child { border-left: 1px solid #fff; border-radius: var(--radius) 0 0 var(--radius); }
table.tbl td:last-child { border-right: 1px solid #fff; border-radius: 0 var(--radius) var(--radius) 0; }
table.tbl tr:hover td { background: #fff; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid #fff; border-radius: var(--radius);
  padding: 10px 14px; outline: none;
  background: linear-gradient(180deg, #f2f7fb 0%, #ecf3f9 100%);
  box-shadow: var(--shadow-inset-sm); color: var(--text);
}
.field input:focus, .field textarea:focus, .field select:focus { background: #fff; box-shadow: var(--shadow-inset); }
.field textarea { resize: vertical; min-height: 72px; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { padding: 6px 14px; border: 1px solid #fff; border-radius: 9999px; font-size: 12px; color: var(--text-2); background: linear-gradient(180deg, #fff 0%, #f4f8fc 100%); box-shadow: var(--shadow-sm); cursor: pointer; white-space: nowrap; }
.choice.sel { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }

/* ---------- 页面标题区 ---------- */
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; }
.page-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.page-sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }

/* ---------- 进度条 ---------- */
.progress { height: 8px; border-radius: 9999px; background: #eaf0f6; border: 1px solid #fff; box-shadow: var(--shadow-inset-sm); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok) 0%, #4ade80 100%); border-radius: 9999px; }

/* ---------- 风险/异常块 ---------- */
.notice { border: 1px solid #fff; border-left: 3px solid var(--primary); border-radius: var(--radius); padding: 12px 14px; background: linear-gradient(180deg, #fff 0%, #f8fbfe 100%); box-shadow: var(--shadow-sm); }
.notice.risk { border-left-color: var(--danger); background: var(--danger-soft); }
.notice.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.notice.ok { border-left-color: var(--ok); background: var(--ok-soft); }
.notice .n-title { font-family: var(--font-display); font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 7px; }
.notice .n-title .n-ico { width: 16px; height: 16px; display: inline-flex; }

/* ---------- 甘特 ---------- */
.gantt { border: 1px solid #fff; border-radius: var(--radius-lg); background: #fff; overflow: hidden; box-shadow: var(--shadow-sm); }
.gantt-head { display: grid; grid-template-columns: 260px 1fr; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #f4f8fc 0%, #eaf0f6 100%); }
.gantt-head .gh-label { padding: 10px 14px; font-weight: 600; font-size: 12px; }
.gantt-axis { display: flex; }
.gantt-axis .ga-cell { flex: 1; text-align: center; font-size: 11px; color: var(--text-3); padding: 7px 0; border-left: 1px solid var(--border); }
.gantt-axis .ga-cell.weekend { background: #f8fafc; }
.gantt-axis .ga-cell.today { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.gantt-row { display: grid; grid-template-columns: 260px 1fr; border-bottom: 1px solid var(--border); align-items: center; }
.gantt-row:hover { background: #f8fafc; }
.gantt-row .gr-label { padding: 8px 14px; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--border); }
.gantt-row .gr-label .mod { color: var(--text-3); font-size: 11px; }
.gantt-track { position: relative; height: 36px; }
.gantt-bar { position: absolute; top: 7px; height: 22px; border-radius: 9999px; background: var(--primary); color: #fff; font-size: 11px; display: flex; align-items: center; padding: 0 10px; white-space: nowrap; overflow: hidden; box-shadow: var(--shadow-sm); }
.gantt-bar.crit { background: var(--primary-ink); }
.gantt-bar.done { background: var(--ok); }
.gantt-bar.risk { background: var(--danger); }
.gantt-bar.frozen { background: repeating-linear-gradient(45deg, #94a3b8, #94a3b8 4px, #a3adb9 4px, #a3adb9 8px); }
.gantt-bar.wait { background: var(--warn); }
.gantt-freeze { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); }

/* ---------- 筛选条 ---------- */
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filt { font-size: 12px; padding: 5px 13px; border-radius: 9999px; border: 1px solid #fff; background: linear-gradient(180deg, #fff 0%, #f4f8fc 100%); color: var(--text-2); box-shadow: var(--shadow-sm); cursor: pointer; white-space: nowrap; }
.filt.sel { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }

/* ---------- 模态/抽屉/确认 ---------- */
.modal-root, .drawer-root, .confirm-root { position: fixed; inset: 0; z-index: 50; display: none; }
.modal-root.show, .drawer-root.show, .confirm-root.show { display: block; }
.modal-mask, .drawer-mask, .confirm-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .35); backdrop-filter: blur(3px); }
.modal-box { position: relative; max-width: 720px; margin: 5vh auto; background: linear-gradient(175deg, #f4f8fc 0%, #fff 100%); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); max-height: 90vh; display: flex; flex-direction: column; border: 1px solid #fff; }
.modal-head { padding: 16px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 15px; font-family: var(--font-display); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.drawer-box { position: absolute; top: 0; right: 0; width: 560px; max-width: 92vw; height: 100%; background: linear-gradient(175deg, #f4f8fc 0%, #fff 100%); box-shadow: var(--shadow-float); display: flex; flex-direction: column; border-left: 1px solid #fff; }
.drawer-box.left { right: auto; left: 0; border-left: none; border-right: 1px solid #fff; }
.confirm-box { position: relative; max-width: 560px; margin: 14vh auto; background: linear-gradient(175deg, #f4f8fc 0%, #fff 100%); border-radius: var(--radius-lg); box-shadow: var(--shadow-float); border: 1px solid #fff; }

/* ---------- Toast ---------- */
.toast-root { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--navy); color: #fff; padding: 10px 18px; border-radius: var(--radius-full); font-size: 13px; box-shadow: var(--shadow-float); animation: toastIn .2s ease; }
.toast.ok { background: var(--ok); }
.toast.warn { background: var(--warn); }
.toast.err { background: var(--danger); }

/* ---------- 旧抽屉兼容（收起态） ---------- */
.agent-drawer { display: none; }
.agent-reopen { display: none; }
.agent-reopen.show {
  display: inline-flex; align-items: center; gap: 8px;
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  padding: 11px 18px; border-radius: 9999px;
  background: linear-gradient(135deg, var(--navy-light), var(--navy-dark));
  color: #fff; box-shadow: var(--shadow-dock); font-size: 13px; font-weight: 600;
}
.agent-reopen.show:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(15, 23, 42, .28); }
/* 折叠卡片标题交互 */
.card-head:hover { background: rgba(255, 255, 255, .55); border-radius: var(--radius); margin-left: -6px; margin-right: -6px; padding-left: 6px; padding-right: 6px; }
.card-chevron { cursor: pointer; }

/* ---------- 通用工具类 ---------- */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--text-muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.hide { display: none !important; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.empty { text-align: center; color: var(--text-muted); padding: 40px 20px; }
.empty .e-ico { width: 40px; height: 40px; color: var(--border-strong); margin: 0 auto 10px; display: inline-flex; }
.link { color: var(--primary); cursor: pointer; }
.link:hover { text-decoration: underline; }
.kbd { font-family: var(--font-display); background: #f1f5f9; border: 1px solid #fff; border-radius: 9999px; padding: 2px 8px; font-size: 10px; color: var(--text-2); box-shadow: var(--shadow-sm); }

/* ---------- 项目树 ---------- */
.ptree { list-style: none; margin: 0; padding: 0; }
.ptree ul { list-style: none; margin: 0; padding-left: 16px; border-left: 1px dashed var(--border); }
.ptree li { padding: 4px 0; }
.ptree .pt-node { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius); cursor: pointer; }
.ptree .pt-node:hover { background: rgba(255, 255, 255, .7); }
.ptree .pt-ico { width: 16px; height: 16px; color: var(--text-3); display: inline-flex; }
.ptree .pt-name { font-size: 13px; }
.ptree .pt-count { margin-left: auto; color: var(--text-3); font-size: 11.5px; }
.ptree .pt-node.proj { font-weight: 650; }
.ptree .pt-node.module { font-weight: 600; color: var(--text); }

/* ---------- 富文本编辑器适配 ---------- */
.rte { border: 1px solid #fff; border-radius: var(--radius); overflow: hidden; background: #fff; position: relative; box-shadow: var(--shadow-inset-sm); }
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 12px; background: linear-gradient(180deg, #f4f8fc 0%, #eaf0f6 100%); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.rte-btn { min-width: 32px; height: 30px; padding: 0 9px; font-size: 13px; border: 1px solid #fff; border-radius: 10px; background: linear-gradient(180deg, #fff 0%, #f4f8fc 100%); color: var(--text-2); cursor: pointer; box-shadow: var(--shadow-sm); transition: all .12s; }
.rte-btn:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }
.rte-body { min-height: 320px; max-height: 56vh; overflow: auto; padding: 16px 18px; line-height: 1.75; font-size: 14px; outline: none; }
.rte-body:focus { box-shadow: inset 0 0 0 2px var(--primary-soft); }
.rte-body h2 { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin: 16px 0 10px; }
.rte-body h3 { font-family: var(--font-display); font-size: 16px; font-weight: 600; margin: 14px 0 8px; }
.rte-body blockquote { margin: 12px 0; padding: 8px 16px; border-left: 3px solid var(--primary); background: var(--primary-soft); color: var(--text-2); border-radius: 0 10px 10px 0; }
.rte-body ul, .rte-body ol { padding-left: 24px; margin: 10px 0; }
.rte-body hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.rte-ph { position: absolute; top: 52px; left: 18px; color: var(--text-muted); font-size: 14px; pointer-events: none; }

/* ---------- 工作台（首页）精简布局 ---------- */
.home-banner-top { align-items: flex-start; gap: 16px; }
.home-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.home-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; color: var(--text-3); font-size: 12px; }
.home-meta span { display: inline-flex; align-items: center; gap: 5px; }
.home-meta svg { width: 14px; height: 14px; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.stat { padding: 2px 16px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: none; padding-left: 0; }
.stat-val { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.stat-label { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.home-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 14px; align-items: start; }
.home-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sec-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: 8px; }
.sec-title svg { width: 16px; height: 16px; color: var(--text-3); }
.insight-list { display: flex; flex-direction: column; gap: 8px; }
.impact-list { display: flex; flex-direction: column; gap: 12px; }
.impact-row { display: flex; gap: 10px; align-items: flex-start; }
.impact-dot { width: 8px; height: 8px; border-radius: 9999px; margin-top: 6px; flex: none; }
.impact-title { font-size: 13px; font-weight: 600; color: var(--text); }
.impact-desc { font-size: 12px; color: var(--text-muted); line-height: 1.6; margin-top: 2px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .home-grid { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: none; padding-left: 0; }
}
@media (max-width: 1200px) {
  .planner { display: none; }
  .agent-panel { position: fixed; right: 0; top: var(--header-h); bottom: 0; border-radius: 0; border-right: none; box-shadow: var(--shadow-float); }
  .agent-panel.collapsed { display: none; }
}
@media (max-width: 760px) {
  .dock { position: fixed; left: 0; top: var(--header-h); bottom: 0; border-radius: 0; transform: translateX(-100%); transition: transform .2s; }
  .dock.open { transform: translateX(0); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar-search { display: none; }
  .btn-label { display: none; }
  #menuBtn { display: inline-flex; }
  .agent-panel { width: 92vw; }
}

/* ---------- 培训日历 ---------- */
.cal-layout { display: grid; grid-template-columns: 1fr 340px; gap: 14px; align-items: start; }
.cal-card { padding: 16px 18px; }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.cal-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; flex: 1; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--text-3); padding-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { min-height: 84px; border-radius: var(--radius-sm); background: var(--bg-elev); border: 1px solid var(--border); padding: 6px 7px; cursor: pointer; transition: box-shadow .15s, border-color .15s; display: flex; flex-direction: column; gap: 5px; }
.cal-cell:hover { box-shadow: var(--shadow-sm); }
.cal-cell.out { opacity: .45; }
.cal-cell.has { background: linear-gradient(180deg, #fff, #f6fafe); }
.cal-cell.today { border-color: var(--primary); }
.cal-cell.sel { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cal-dnum { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.cal-dot { width: 7px; height: 7px; border-radius: 9999px; background: var(--primary); }
.cal-chips { display: flex; flex-direction: column; gap: 3px; }
.cal-chip { font-size: 10.5px; line-height: 1.3; color: var(--text-2); background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--c, var(--primary)); border-radius: 6px; padding: 2px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 10px; color: var(--text-muted); padding-left: 4px; }
.cal-detail { padding: 16px 18px; align-self: start; position: sticky; top: calc(var(--header-h) + 14px); }
.cal-detail-head { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.cal-detail-date { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.cal-task-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.cal-task { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; transition: box-shadow .15s; }
.cal-task:hover { box-shadow: var(--shadow-sm); }
.cal-task-name { font-size: 13px; font-weight: 600; margin: 6px 0 4px; }
@media (max-width: 1000px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-detail { position: static; }
}
