:root {
  --el-font-size-base: 15px;
  --el-font-size-small: 14px;
  --el-table-font-size: 15px;
  --el-color-primary: #0c4a6e;
  --el-color-primary-light-3: #3a7597;
  --el-color-primary-light-5: #6f9cb6;
  --el-color-primary-light-7: #aac6d8;
  --el-color-primary-light-8: #cfe0ea;
  --el-color-primary-light-9: #eaf2f6;
  --el-color-primary-dark-2: #07354d;
  --brand: #0c4a6e;
  --brand-2: #07354d;
  --ink: #16242e;
  --ink-2: #4d5a66;
  --ink-3: #8693a0;
  --line: #e6eaee;
  --bg: #fbfcfd;
  --card: #ffffff;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 35, 52, .05);
  --shadow: 0 2px 8px rgba(16, 35, 52, .06);
  --shadow-lg: 0 12px 34px rgba(16, 35, 52, .14);
  --serif: "Times New Roman", Georgia, "Songti SC", "Source Han Serif SC", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}


/* ============ 登录页 ============ */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
background: #061f31;
}
.login-card {
  width: 400px;
  background: var(--card);
  border-radius: 18px;
  padding: 40px 36px 32px;
  box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #0c4a6e;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  box-shadow: 0 6px 16px rgba(12, 74, 110, .35);
}
.logo-mark.big { width: 60px; height: 60px; font-size: 30px; border-radius: 16px; margin-bottom: 14px; }
.login-title { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: 2px; }
.login-sub { font-size: 13px; color: var(--ink-3); margin-top: 6px; }

/* ============ 布局 ============ */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px;
  background: #0b1f33;
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
}
.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.logo .logo-mark { width: 38px; height: 38px; font-size: 19px; border-radius: 10px; flex: none; }
.logo-name { font-size: 16px; font-weight: 700; line-height: 1.2; letter-spacing: 1px; }
.logo-sub { font-size: 11px; color: rgba(255, 255, 255, .55); margin-top: 2px; }
.sidebar .el-menu { border-right: none; flex: 1; padding: 10px 10px; }
.sidebar .el-menu-item {
  border-radius: 9px;
  margin: 3px 0;
  height: 44px;
  color: rgba(255, 255, 255, .72);
}
.sidebar .el-menu-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar .el-menu-item.is-active {
  background: rgba(12, 74, 110, .28);
  color: #fff;
  box-shadow: inset 3px 0 0 0 #5fb0d9;
}
.sidebar-user {
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-user .el-button { justify-content: flex-start; padding-left: 0; color: rgba(255, 255, 255, .7); }
.sidebar-user .el-button:hover { color: #fff; }
.content { margin-left: 216px; flex: 1; padding: 26px 30px; min-width: 0; }

/* ============ 通用 ============ */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-head h2 { font-size: 20px; margin: 0; display: flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: .2px; }
.head-tools { display: flex; align-items: center; gap: 10px; }

.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.spacer { flex: 1; }
.red { color: #ef4444; font-weight: 600; }
.orange { color: #f59e0b; font-weight: 600; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }

/* ============ 统计条 ============ */
.stats-bar { display: flex; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 26px;
  text-align: center;
  min-width: 100px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.stat-item:hover { box-shadow: var(--shadow); border-color: #b9d0da; }
.stat-item.hot { border-color: #e8b6bf; background: #fffafb; }
.stat-item.hot .stat-num { color: #ef4444; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.stat-label { font-size: 13px; color: var(--ink-3); margin-top: 2px; }

/* ============ 动态面板 ============ */
.act-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}
.act-panel-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding-bottom: 8px; font-size: 14px; }
.act-panel-head b { font-size: 15px; }
.act-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow-y: auto; }
.act-item { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 14px; }
.act-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-right: 2px; align-self: center; }
.act-dot.warn { background: #f59e0b; }
.act-dot.danger { background: #ef4444; }
.act-text { flex: 0 1 auto; color: var(--ink); }
.act-who { flex: none; white-space: nowrap; }
.review-line { border-radius: 6px; padding: 4px 6px; }
.review-line:hover { background: #f1f6f8; }

/* ============ 全局搜索 ============ */
.gsearch { position: relative; }
.gsearch-panel {
  position: absolute;
  top: 38px;
  left: 0;
  width: 400px;
  max-height: 440px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: 6px;
}
.gs-title { font-size: 12px; color: var(--ink-3); padding: 8px 10px 3px; }
.gs-item { padding: 8px 11px; font-size: 14px; border-radius: 7px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-item:hover { background: #edf4f7; }
.gs-empty { padding: 16px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ============ 项目卡片 ============ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 18px; }
.pcard {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.pcard:hover { box-shadow: var(--shadow); border-color: #b9d0da; }
.pcard-head { display: flex; align-items: center; gap: 8px; }
.pname { font-size: 16px; font-weight: 700; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname:hover { color: var(--brand); }
.pcard-meta { display: flex; justify-content: space-between; font-size: 13px; gap: 10px; }
.pcard-members { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-bar { flex: 1; height: 8px; background: #eceef3; border-radius: 99px; overflow: hidden; }
.progress-inner { height: 100%; background: #287a9b; border-radius: 99px; transition: width .4s; }
.pcard-stats { display: flex; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.st { padding: 3px 10px; border-radius: 99px; }
.st-todo { background: #f1f3f4; color: #56636b; }
.st-doing { background: #eaf3f6; color: #286c86; }
.st-blocked { background: #fff0f2; color: #b7354d; }
.st-review { background: #fff7e6; color: #986b21; }
.st-done { background: #edf5f0; color: #47735d; }
.st-overdue { background: #fff0f2; color: #b7354d; font-weight: 700; }
.st-week { background: #eaf3f6; color: #286c86; }
.pcard-next { border-top: 1px dashed var(--line); padding-top: 10px; }
.sec { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.next-item { display: flex; flex-direction: column; padding: 4px 0; gap: 1px; position: relative; padding-right: 90px; }
.t-title { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-due { position: absolute; right: 0; top: 4px; font-size: 13px; }
.pcard-foot { display: flex; align-items: center; border-top: 1px solid #f0f2f6; padding-top: 10px; gap: 4px; }

/* ============ 看板 ============ */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; }
.bcol {
  flex: 1;
  min-width: 250px;
  max-width: 380px;
  background: #eef2f3;
  border-radius: 6px;
  padding: 12px;
}
.bcol-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 12px; font-weight: 700; font-size: 14px; }
.bcol-name { color: var(--ink); }
.cnt { background: #fff; border-radius: 99px; padding: 0 9px; font-size: 12px; color: var(--ink-3); }
.bcol-body { display: flex; flex-direction: column; gap: 9px; min-height: 60px; }
.tcard {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  cursor: grab;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: box-shadow .15s, border-color .15s;
}
.tcard:hover { box-shadow: var(--shadow); border-color: #b9d0da; }
.tcard:active { cursor: grabbing; }
.tcard.done { opacity: .62; }
.tcard.done .tcard-title { text-decoration: line-through; }
.tcard-title { font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.tcard-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tcard-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); }
.tcard-actions { display: flex; justify-content: flex-end; gap: 2px; }
.add-task { width: 100%; }
.add-task span { justify-content: center; }

/* ============ 标签页工具条 ============ */
.tab-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

/* ============ 讨论 ============ */
.disc-list { display: flex; flex-direction: column; gap: 14px; }
.disc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.disc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.disc-body { display: flex; flex-direction: column; gap: 12px; }
.sec-title { font-size: 14px; font-weight: 700; color: var(--brand); margin-bottom: 4px; }
.sec-text { font-size: 14px; color: var(--ink); white-space: pre-wrap; line-height: 1.7; }
.sec-text.collapsed { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ai-list { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.ai-row { display: flex; gap: 8px; align-items: center; }
.ai-row .el-input { flex: 1; }

/* ============ 科学问题卡 ============ */
.sci-card {
  background: #f1f7f8;
  border: 1px solid #cbdde9;
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.sci-item { display: flex; align-items: baseline; gap: 12px; }
.sci-label { flex: none; font-size: 13px; font-weight: 700; color: var(--brand-2); background: #fff; border: 1px solid #cbdde9; border-radius: 6px; padding: 1px 9px; }
.sci-text { font-size: 15px; color: var(--ink); line-height: 1.65; }

/* ============ 决策 ============ */
.dec-item { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.dec-item:last-child { border-bottom: none; }
.dec-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dec-content { font-size: 15px; font-weight: 600; color: var(--ink); }
.dec-reason { padding: 4px 0 0 17px; font-size: 14px; color: var(--ink-2); }

/* ============ 任务进展记录 ============ */
.task-logs { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.log-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; max-height: 220px; overflow-y: auto; }
.log-item { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.log-content { flex: 1; color: var(--ink); }
.log-input { display: flex; gap: 8px; }

/* ============ 我的待办 ============ */
.mgroup { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.mgroup-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: #f7f9fb; border-bottom: 1px solid var(--line); }
.mgroup-name { font-weight: 700; cursor: pointer; }
.mgroup-name:hover { color: var(--brand); }
.mitem { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid #f0f2f6; font-size: 14px; }
.mitem:last-child { border-bottom: none; }
.mitem.done .mtitle { text-decoration: line-through; color: var(--ink-3); }
.mtitle { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.mdue { font-size: 13px; }
.mdue.due-overdue { color: #ef4444; font-weight: 700; }
.mdue.due-soon { color: #f59e0b; font-weight: 600; }

/* ============ 甘特图 ============ */
.gantt { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; background: #fff; }
.gantt-head, .gantt-row { display: flex; align-items: center; min-width: 720px; }
.gantt-head { border-bottom: 1px solid var(--line); background: #f7f9fb; }
.gantt-label-col { width: 240px; flex: none; padding: 9px 14px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid var(--line); }
.gantt-track { flex: 1; position: relative; height: 40px; background: #f7fafb; border-left: 1px solid #dbe6e9; }
.gantt-months { position: absolute; inset: 0; }
.gantt-month { position: absolute; top: 0; font-size: 11px; color: #c0c4cc; border-left: 1px dashed #e4e7ed; padding-left: 5px; }
.gantt-row { border-bottom: 1px solid #f0f2f6; }
.gantt-row:hover { background: #f4f8f9; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1.5px dashed #d05656; z-index: 3; }
.gantt-today::after { content: "今日"; position: absolute; top: -1px; left: 2px; font-size: 10px; color: #d05656; background: #fff; padding: 0 2px; white-space: nowrap; }
.gantt-bar { position: absolute; top: 10px; height: 20px; border-radius: 3px; display: flex; align-items: center; min-width: 12px; box-shadow: none; transition: filter .15s; }
.gantt-bar:hover { filter: brightness(1.06); }
.gantt-bar-label { font-size: 11px; color: #fff; padding: 0 8px; white-space: nowrap; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.gt-doing { background: #4d879b; }
.gt-blocked { background: #b84a5f; }
.gt-review { background: #b28a45; }
.gt-done { background: #668b78; }

/* ============ 图片批注 ============ */
.ann-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ann-canvas-wrap { max-height: 62vh; overflow: auto; text-align: center; background: #eef3f4; border-radius: 6px; }
.ann-canvas { background: #fff; border: 1px solid var(--line); cursor: crosshair; border-radius: 4px; }

/* ============ 知识库 ============ */
.kb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.kb-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; cursor: pointer; transition: transform .15s, box-shadow .15s; position: relative; box-shadow: var(--shadow-sm); }
.kb-card:hover { box-shadow: var(--shadow); border-color: #b9d0da; }
.kb-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.kb-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.kb-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.kb-preview { font-size: 13px; color: var(--ink-2); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-foot { margin-top: 10px; }
.kb-actions { margin-top: 6px; text-align: right; }
.kb-detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.kb-detail-content { font-size: 15px; line-height: 1.8; white-space: pre-wrap; color: var(--ink); }

.file-input { font-size: 13px; }

/* 统计项激活态 */
.stat-item.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 95, 158, .15); }
.stat-item.active .stat-label { color: var(--brand-2); }

/* 任务来源讨论链接 */
.task-title-line { display: flex; align-items: center; gap: 10px; }
.task-title-line .el-input { flex: 1; }
.task-meta-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.task-meta-row .el-form-item { margin-bottom: 0; }
.task-meta-row .el-select, .task-meta-row .el-date-editor { width: 100%; }
.archive-subtitle { margin: 22px 0 8px; font-family: var(--serif); font-size: 16px; font-weight: 700; color: var(--brand-2); }
.task-links { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; display: flex; align-items: center; gap: 8px; }

/* 任务定位高亮闪烁 */
.tcard.flash { animation: flashRing 1s ease 2; }
@keyframes flashRing {
  0%, 100% { box-shadow: var(--shadow-sm); }
  50% { box-shadow: 0 0 0 3px rgba(11, 95, 158, .55), var(--shadow); border-color: var(--brand); }
}

/* 富文本编辑器 */
.quill-wrap { width: 100%; }
.quill-editor { min-height: 280px; font-size: 15px; }
.quill-editor .ql-container { min-height: 240px; font-size: 15px; font-family: inherit; }
.quill-editor .ql-toolbar button.ql-undo,
.quill-editor .ql-toolbar button.ql-redo,
.quill-editor .ql-toolbar button.ql-better-table { width: 28px; }
.quill-editor .ql-editor table.quill-better-table td,
.quill-editor .ql-editor table.quill-better-table th { border-color: #b9cbd7; padding: 6px 8px; }
.quill-editor .ql-editor table.quill-better-table th { background: #eef5fa; font-weight: 700; }


/* 知识库详情富文本内容 */
.kb-detail-content h1, .kb-detail-content h2, .kb-detail-content h3 { color: var(--ink); margin: 14px 0 8px; }
.kb-detail-content p { margin: 6px 0; }
.kb-detail-content ul, .kb-detail-content ol { padding-left: 22px; margin: 6px 0; }
.kb-detail-content li { margin: 3px 0; }
.kb-detail-content img { max-width: 100%; border-radius: 8px; }
.kb-detail-content blockquote { border-left: 3px solid var(--brand); margin: 8px 0; padding: 2px 14px; color: var(--ink-2); background: #f2f7fa; }
.kb-detail-content pre { background: #0b2540; color: #e7eef5; padding: 12px 16px; border-radius: 8px; overflow-x: auto; }

/* 知识库附件 */
.kb-attach { border-top: 1px solid var(--line); padding-top: 14px; }
.kb-attach-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.kb-upload-btn {
  display: inline-flex; align-items: center; padding: 7px 16px;
  border: 1px dashed var(--brand); color: var(--brand-2);
  border-radius: 8px; cursor: pointer; font-size: 13px;
}
.kb-upload-btn:hover { background: #f2f7fa; }

/* 分类管理 */
.cat-add { display: flex; gap: 8px; margin-bottom: 14px; }
.cat-list { display: flex; flex-direction: column; max-height: 320px; overflow-y: auto; }
.cat-item { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.cat-item:last-child { border-bottom: none; }
.gantt-assignee { margin-left: 6px; font-size: 12px; color: var(--brand-2); background: #eaf3f8; border-radius: 4px; padding: 0 6px; }
