/* ============================================================
 * 项目管理工作台 - 样式
 * 布局：左侧紫色渐变侧边栏 + 顶部 Banner + 浅灰背景 + 白色卡片
 * ============================================================ */

:root {
  --purple: #6C5CE7;
  --purple-2: #7C6AEF;
  --purple-3: #A78BFA;
  --purple-dark: #5A4BD1;
  --bg: #F4F5FB;
  --card: #FFFFFF;
  --text: #1F2430;
  --text-2: #6B7280;
  --text-3: #9CA3AF;
  --line: #EEF0F6;
  --green: #10B981;
  --green-bg: #E7F8F1;
  --orange: #F59E0B;
  --orange-bg: #FEF3E2;
  --red: #EF4444;
  --red-bg: #FEECEC;
  --blue: #3B82F6;
  --blue-bg: #E8F1FE;
  --yellow-bg: #FEF9C3;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(31, 36, 48, .06);
  --sidebar-w: 208px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* ================= 侧边栏 ================= */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #6D5BD0 0%, #7C6AEF 45%, #8B7BE8 100%);
  color: #fff;
  display: flex; flex-direction: column;
  z-index: 100;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px;
  font-size: 15px; font-weight: 700;
}
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
}
.nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; margin: 2px 0;
  border-radius: 9px;
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav-item.active {
  background: #fff;
  color: var(--purple);
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12);
}
.nav-item .ico { width: 16px; text-align: center; font-size: 13px; flex: none; }
.nav-item .badge {
  margin-left: auto;
  background: #EF4444; color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.sidebar-foot {
  padding: 10px 16px; font-size: 11px;
  color: rgba(255, 255, 255, .55);
  border-top: 1px solid rgba(255, 255, 255, .12);
}

/* ================= 主区域 ================= */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.banner {
  background: linear-gradient(100deg, #6D5BD0 0%, #8B7BE8 55%, #A78BFA 100%);
  color: #fff;
  padding: 22px 28px 20px;
  position: relative;
  overflow: hidden;
}
.banner::after {
  content: '';
  position: absolute; right: -40px; top: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255, 255, 255, .10);
}
.banner::before {
  content: '';
  position: absolute; right: 130px; bottom: -90px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.banner h1 { font-size: 24px; font-weight: 800; letter-spacing: 1px; position: relative; z-index: 1; }
.banner .sub { margin-top: 6px; font-size: 12.5px; opacity: .85; position: relative; z-index: 1; }
.banner .banner-actions { position: absolute; right: 28px; top: 24px; z-index: 2; display: flex; gap: 10px; }

.content { flex: 1; padding: 20px 24px 30px; }

/* 问候条 */
.greet {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 20px; margin-bottom: 16px;
}
.greet .g-left { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 700; }
.greet .g-date { font-size: 12px; color: var(--text-2); font-weight: 400; margin-top: 3px; }
.greet select {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font-size: 12.5px; color: var(--text-2);
  background: #fff;
}

/* ================= 卡片 ================= */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 700;
  margin-bottom: 14px;
}
.card-title .more { font-size: 12px; color: var(--text-3); font-weight: 400; cursor: pointer; }
.card-title .more:hover { color: var(--purple); }

.grid { display: grid; gap: 16px; }
.grid-kpi { grid-template-columns: repeat(6, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* KPI 卡 */
.kpi { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; position: relative; }
.kpi .k-ico { font-size: 18px; }
.kpi .k-num { font-size: 26px; font-weight: 800; line-height: 1.1; }
.kpi .k-label { font-size: 12px; color: var(--text-2); }
.kpi .k-sub { font-size: 11px; margin-top: 2px; }
.k-sub.up { color: var(--green); }
.k-sub.warn { color: var(--red); font-weight: 700; }
.k-sub.mid { color: var(--orange); }

/* 图表卡 */
.legend { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--text-2); }
.legend .li { display: flex; align-items: center; gap: 7px; }
.legend .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend .val { margin-left: auto; color: var(--text); font-weight: 600; }
.chart-flex { display: flex; align-items: center; gap: 18px; }
.chart-flex .grow { flex: 1; }

/* 进度条 */
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2.5px 9px; border-radius: 20px;
  font-weight: 600; white-space: nowrap;
}
.tag.green  { background: var(--green-bg);  color: var(--green); }
.tag.orange { background: var(--orange-bg); color: var(--orange); }
.tag.red    { background: var(--red-bg);    color: var(--red); }
.tag.blue   { background: var(--blue-bg);   color: var(--blue); }
.tag.gray   { background: #F1F2F7; color: var(--text-2); }
.tag.purple { background: #EFEAFF; color: var(--purple); }
.tag.yellow { background: var(--yellow-bg); color: #B45309; }

/* 头像 */
.avatar {
  width: 24px; height: 24px; border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.avatar.sm { width: 20px; height: 20px; font-size: 10px; }

/* ================= 表格 ================= */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th {
  text-align: left; color: var(--text-3); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap; font-size: 12px;
}
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #FAFBFF; }
.table .proj-name { font-weight: 600; color: var(--text); cursor: pointer; }
.table .proj-name:hover { color: var(--purple); }
.cell-flex { display: flex; align-items: center; gap: 8px; }
.progress-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.progress-cell .bar { flex: 1; min-width: 60px; }
.progress-cell span { font-size: 11.5px; color: var(--text-2); width: 32px; text-align: right; }

/* ================= Tabs / 筛选 ================= */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  padding: 6px 14px; border-radius: 9px;
  font-size: 12.5px; color: var(--text-2);
  background: #fff; border: 1px solid var(--line);
  cursor: pointer; transition: all .15s;
  box-shadow: var(--shadow);
}
.tab:hover { color: var(--purple); border-color: var(--purple-3); }
.tab.active { background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 700; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input[type="text"], .filters select {
  border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 12px; font-size: 12.5px; background: #fff;
  box-shadow: var(--shadow); outline: none;
}
.filters input[type="text"]:focus { border-color: var(--purple-3); }
.filters .count { font-size: 12px; color: var(--text-3); margin-left: 4px; }

.btn {
  border: none; border-radius: 9px;
  padding: 8px 16px; font-size: 12.5px; font-weight: 700;
  background: #fff; color: var(--text-2);
  box-shadow: var(--shadow);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.btn:hover { color: var(--purple); }
.btn.primary { background: var(--purple); color: #fff; }
.btn.primary:hover { background: var(--purple-dark); color: #fff; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover, .btn[disabled]:hover { background: inherit; color: inherit; }
.btn.primary:disabled:hover, .btn.primary[disabled]:hover { background: var(--purple); color: #fff; }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.btn.ghost-green { color: var(--green); }
.btn.ghost-red { color: var(--red); }

/* ================= 项目组合卡片 ================= */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.proj-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 9px;
  transition: transform .15s, box-shadow .15s;
}
.proj-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31, 36, 48, .10); }
.proj-card .p-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.proj-card .p-name { font-size: 14px; font-weight: 700; }
.proj-card .p-desc { font-size: 12px; color: var(--text-2); line-height: 1.6; min-height: 38px; }
.proj-card .p-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.proj-card .p-owner { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.proj-card .p-progress { display: flex; align-items: center; gap: 10px; }
.proj-card .p-progress .bar { flex: 1; }
.proj-card .p-progress b { font-size: 12.5px; color: var(--purple); }
.proj-card .p-next { font-size: 12px; color: var(--text-2); }
.proj-card .p-next b { color: var(--purple); font-weight: 600; }
.proj-card .p-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-3);
  border-top: 1px dashed var(--line); padding-top: 9px; margin-top: 2px;
}

/* ================= 任务看板 ================= */
.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; align-items: start; }
.kanban-col { background: #FFFFFF66; border-radius: var(--radius); padding: 12px; min-height: 200px; }
.kanban-col[data-col="已阻塞"] { background: #FEECEC55; }
.kanban-col-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; padding: 2px 4px 10px;
}
.kanban-col-head .cnt {
  margin-left: auto; background: #fff; border-radius: 12px;
  font-size: 11px; padding: 1px 8px; color: var(--text-2);
  box-shadow: var(--shadow);
}
.kanban-col-head .dot-c { width: 8px; height: 8px; border-radius: 50%; }
.task-card {
  background: #fff; border-radius: 11px;
  box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 10px;
  cursor: pointer; transition: transform .12s, box-shadow .12s;
  border-left: 3px solid transparent;
}
.task-card:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(31, 36, 48, .12); }
.task-card .t-title { font-size: 12.8px; font-weight: 700; line-height: 1.45; }
.task-card .t-proj { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.task-card .t-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 9px; }
.task-card .t-date { font-size: 11px; color: var(--text-3); }
.task-card .t-date.overdue { color: var(--red); font-weight: 700; }
.task-card[data-status="待开始"]  { border-left-color: #94A3B8; }
.task-card[data-status="进行中"]  { border-left-color: var(--blue); }
.task-card[data-status="待审核"]  { border-left-color: var(--orange); }
.task-card[data-status="已完成"]  { border-left-color: var(--green); }
.task-card[data-status="已阻塞"]  { border-left-color: var(--red); }
.task-card .t-blocked { font-size: 11px; color: var(--red); background: var(--red-bg); border-radius: 6px; padding: 4px 8px; margin-top: 7px; }

/* ================= 成员卡片 ================= */
.member-card { display: flex; flex-direction: column; gap: 10px; }
.member-card .m-head { display: flex; align-items: center; gap: 10px; }
.member-card .m-name { font-size: 14px; font-weight: 700; }
.member-card .m-role { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.member-card .m-status { margin-left: auto; }
.member-card .m-load { display: flex; align-items: center; gap: 10px; }
.member-card .m-load .bar { flex: 1; }
.member-card .m-load b { font-size: 12.5px; }
.member-card .m-stats { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); }
.member-card .m-stats b { color: var(--text); }
.member-card .m-projects { font-size: 11.5px; color: var(--text-2); border-top: 1px dashed var(--line); padding-top: 9px; line-height: 1.7; }
.member-card .m-projects b { color: var(--purple); font-weight: 600; }

/* ================= 关键行动 / 列表行 ================= */
.action-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px solid var(--line);
  font-size: 12.8px;
}
.action-row:last-child { border-bottom: none; }
.action-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--purple); cursor: pointer; flex: none; }
.action-row .txt { flex: 1; }
.action-row.done .txt { color: var(--text-3); text-decoration: line-through; }
.action-row .lvl { font-size: 11px; font-weight: 700; width: 26px; }

.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid var(--line);
  font-size: 12.8px;
}
.list-row:last-child { border-bottom: none; }
.list-row .l-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .l-sub { font-size: 11px; color: var(--text-3); }
.list-row .l-meta { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* 风险项 */
.risk-row { padding: 9px 4px; border-bottom: 1px solid var(--line); }
.risk-row:last-child { border-bottom: none; }
.risk-row .r-top { display: flex; align-items: center; gap: 8px; font-size: 12.8px; font-weight: 700; }
.risk-row .r-top .icn { color: var(--red); }
.risk-row .r-desc { font-size: 11.5px; color: var(--text-2); margin-top: 4px; padding-left: 22px; }

/* ================= 流程条 ================= */
.flow-bar { display: flex; align-items: stretch; justify-content: space-between; gap: 8px; }
.flow-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; position: relative; padding: 4px 0; }
.flow-step:not(:last-child)::after {
  content: ''; position: absolute; right: -14px; top: 22px;
  width: 20px; height: 2px; background: var(--line);
}
.flow-step .f-ico {
  width: 40px; height: 40px; border-radius: 12px;
  background: #F3F0FF; display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.flow-step .f-title { font-size: 12.5px; font-weight: 700; }
.flow-step .f-desc { font-size: 11px; color: var(--text-3); }

/* ================= 弹窗 ================= */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 22, 40, .45);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 200; padding: 60px 20px;
  overflow-y: auto;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px;
  width: 460px; max-width: 100%;
  padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  max-height: 88vh; overflow-y: auto;
}
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; font-weight: 600; }
.form-row input[type="text"], .form-row input[type="date"], .form-row input[type="password"],
.form-row input[type="number"],
.form-row select, .form-row textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 12px; font-size: 13px; outline: none; background: #fff;
}
.form-row input[type="password"] { letter-spacing: .5px; }
.form-row input[type="date"] { min-height: 36px; }
.form-row textarea { resize: vertical; min-height: 64px; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--purple-3); }
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Toast */
#toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%) translateY(-10px);
  background: #1F2430; color: #fff; font-size: 13px;
  padding: 9px 20px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 300;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 页头（内页） */
.page-head { margin-bottom: 16px; }
.page-head h2 { font-size: 20px; font-weight: 800; }
.page-head .ph-sub { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; }

/* 空状态 */
.empty { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 30px 0; }

/* 移动端菜单按钮 */
.menu-btn { display: none; }

/* ================= 响应式 ================= */
@media (max-width: 1200px) {
  .grid-kpi { grid-template-columns: repeat(3, 1fr); }
  .kanban { grid-template-columns: repeat(3, 1fr); }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; width: 220px; }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .main { margin-left: 0; }
  .menu-btn {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 9px;
    background: rgba(255, 255, 255, .2); color: #fff;
    border: none; font-size: 16px;
    position: absolute; left: 16px; top: 24px; z-index: 3;
  }
  .banner { padding-left: 60px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .grid-kpi { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 14px; }
  .banner .banner-actions { right: 16px; top: 18px; }
  .flow-bar { flex-wrap: wrap; }
  .flow-step { min-width: 30%; }
}
@media (max-width: 600px) {
  .kanban { grid-template-columns: 1fr; }
  .form-2 { grid-template-columns: 1fr; }
  .flow-step { min-width: 45%; }
  .banner h1 { font-size: 19px; }
  .modal { width: 100%; }
  /* 窄屏：标题与操作按钮分行，问候条换行但不再竖排断字 */
  .banner { padding: 16px 14px 14px 58px; }
  .banner h1 { font-size: 17px; line-height: 1.4; }
  .banner .sub { font-size: 11px; }
  .banner .banner-actions { position: static; margin-top: 10px; justify-content: flex-start; }
  .greet { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .greet .g-left { font-size: 13.5px; }
  .greet .g-date { font-size: 11px; }
  .g-right { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
  .g-right > .muted, .g-right > .sync-dot { display: none; }
  .user-chip { white-space: nowrap; }
}

/* ============================================================
 * 第二版：交互控件（编辑 / 删除 / 表单 / 拖拽 / 状态）
 * ============================================================ */

/* 行内操作 */
.row-actions { display: inline-flex; align-items: center; gap: 4px; }
.icon-btn {
  width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--line); background: #fff;
  color: var(--text-2); font-size: 12px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.icon-btn:hover { border-color: var(--purple-3); color: var(--purple); background: #F8F6FF; }
.icon-btn.danger:hover { border-color: #FCA5A5; color: var(--red); background: #FFF5F5; }
.icon-btn.tiny { width: 22px; height: 22px; font-size: 10px; border: none; background: transparent; }

.card-ops {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-top: 1px dashed var(--line); padding-top: 9px; margin-top: 2px;
}
.head-actions { display: flex; gap: 10px; align-items: center; }
.muted { color: var(--text-3); font-size: 12px; }

/* 内联下拉 */
.inline-select {
  border: 1px solid var(--line); border-radius: 7px;
  padding: 4px 8px; font-size: 12px; background: #fff; color: var(--text-2);
  outline: none; cursor: pointer;
}
.inline-select:focus { border-color: var(--purple-3); }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-row .req { color: var(--red); font-weight: 700; }
.form-stack { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.form-row input[type="color"] { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.file-label {
  font-size: 12.5px; color: var(--purple); cursor: pointer;
  border: 1px dashed var(--purple-3); border-radius: 9px; padding: 7px 14px;
}
.file-label:hover { background: #F8F6FF; }

/* 弹窗加宽 */
.modal.wide { width: 720px; }
.detail-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; background: #FAFBFF; border-radius: 10px; padding: 12px 14px;
}
.detail-grid > div { display: flex; flex-direction: column; gap: 3px; }
.detail-grid span { font-size: 11px; color: var(--text-3); }
.detail-grid b { font-size: 13px; }
.scroll-box { max-height: 260px; overflow-y: auto; }
.doc-content {
  white-space: pre-wrap; line-height: 1.85; font-size: 13px;
  background: #FAFBFF; border-radius: 10px; padding: 14px 16px;
  max-height: 340px; overflow-y: auto; color: var(--text);
}
.readonly-box {
  background: #FAFBFF; border-radius: 9px; padding: 9px 12px;
  font-size: 12.5px; color: var(--text-2); line-height: 1.7;
}
.link { color: var(--purple); font-size: 12.5px; word-break: break-all; }

/* 依赖选择 */
.deps-box {
  max-height: 132px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px; background: #fff;
}
.dep-item { display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; }
.dep-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-item em { font-style: normal; color: var(--text-3); font-size: 11px; }
.dep-item input { accent-color: var(--purple); }

/* 看板拖拽 */
.task-card { cursor: grab; }
.task-card.dragging { opacity: .45; transform: rotate(1deg); }
.kanban-col { min-height: 160px; transition: background .15s, box-shadow .15s; }
.kanban-col.dragover {
  background: #F3F0FF; box-shadow: inset 0 0 0 2px var(--purple-3);
}
.col-empty {
  text-align: center; font-size: 11px; color: var(--text-3);
  padding: 18px 0; border: 1px dashed #E3E6F0; border-radius: 10px;
}
.col-more { text-align: center; font-size: 11px; color: var(--text-3); padding: 6px 0; }

/* 问候右侧 */
.g-right { display: flex; align-items: center; gap: 8px; }
.sync-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px rgba(16, 185, 129, .15);
  display: inline-block;
}

/* 加载 / 错误 */
.spinner {
  width: 26px; height: 26px; margin: 0 auto;
  border: 3px solid #EDEBF7; border-top-color: var(--purple);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.err-pre {
  background: #FFF5F5; color: var(--red); padding: 12px;
  border-radius: 9px; font-size: 12px; white-space: pre-wrap; margin-top: 10px;
}

/* toast 错误态 */
#toast.error { background: #DC2626; }

/* 可点击卡片反馈 */
.card.kpi[data-action] { transition: transform .15s, box-shadow .15s; }
.card.kpi[data-action]:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(31, 36, 48, .10); }

/* 数据规模统计 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-grid > div {
  background: #FAFBFF; border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.stat-grid b { font-size: 18px; font-weight: 800; }
.stat-grid span { font-size: 11px; color: var(--text-3); }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .modal.wide { width: 100%; }
  /* 宽表格在窄屏下卡片内横向滚动，避免整页横溢 */
  .card { overflow-x: auto; }
  .page-head-row { flex-wrap: wrap; gap: 10px; }
  .head-actions { flex-wrap: wrap; }
}

/* ============================================================
 * 第三版：登录 / 会话 / 权限
 * ============================================================ */
body.auth-locked .sidebar, body.auth-locked .main { display: none; }
#auth-screen:empty { display: none; }
#auth-screen { position: fixed; inset: 0; z-index: 500; background: var(--bg); overflow-y: auto; }
.auth-wrap { display: grid; grid-template-columns: 460px 1fr; min-height: 100vh; }
.auth-side {
  background: linear-gradient(160deg, #574ABF 0%, #7C6AEF 55%, #A78BFA 100%);
  color: #fff; padding: 46px 42px; display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
}
.auth-side::after {
  content: ''; position: absolute; right: -70px; bottom: -70px;
  width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .10);
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; margin-bottom: 30px; }
.auth-brand .logo {
  width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 255, 255, .22);
  display: flex; align-items: center; justify-content: center;
}
.auth-side h2 { font-size: 30px; line-height: 1.4; letter-spacing: 1px; }
.auth-side p { font-size: 13px; opacity: .82; margin-top: 2px; }
.auth-points { list-style: none; margin-top: 26px; display: flex; flex-direction: column; gap: 11px; font-size: 12.5px; opacity: .92; }
.auth-points li { display: flex; align-items: flex-start; gap: 8px; line-height: 1.6; }
.auth-points li::before { content: '✓'; font-weight: 700; opacity: .9; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card {
  width: 380px; max-width: 100%; background: #fff; border-radius: 18px;
  box-shadow: 0 12px 40px rgba(31, 36, 48, .10); padding: 28px 30px 24px;
}
.auth-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.auth-tabs span {
  padding: 0 2px 11px; font-size: 15px; font-weight: 700; color: var(--text-3);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.auth-tabs span.active { color: var(--purple); border-bottom-color: var(--purple); }
.auth-submit { width: 100%; justify-content: center; padding: 11px; font-size: 13.5px; margin-top: 6px; }
.auth-submit:disabled { opacity: .65; cursor: default; }
.auth-error { min-height: 18px; font-size: 12px; color: var(--red); margin-bottom: 4px; line-height: 1.5; }
.auth-demo { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }
.auth-demo .ad-title { font-size: 11.5px; color: var(--text-3); margin-bottom: 8px; }
.auth-demo .ad-list { display: flex; flex-direction: column; gap: 6px; }
.auth-demo .ad-list button {
  text-align: left; border: 1px solid var(--line); background: #FAFBFF;
  border-radius: 8px; padding: 7px 10px; font-size: 11.5px; color: var(--text-2);
}
.auth-demo .ad-list button:hover { border-color: var(--purple-3); color: var(--purple); background: #F8F6FF; }
.auth-demo .ad-tip { font-size: 11px; color: var(--text-3); margin-top: 10px; line-height: 1.7; }

/* 用户信息 */
.user-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; background: #F6F6FC; border-radius: 20px; }
.user-chip .uc-name { font-size: 12.5px; font-weight: 700; }
.sf-user { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sf-name { font-size: 12.5px; font-weight: 700; color: #fff; }
.sf-role { font-size: 10.5px; color: rgba(255, 255, 255, .62); margin-top: 2px; }
.sf-logout {
  width: 100%; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .9); border-radius: 7px; font-size: 11.5px; padding: 5px 0;
}
.sf-logout:hover { background: rgba(255, 255, 255, .2); }

/* 只读详情 */
.readonly-list { display: flex; flex-direction: column; }
.detail-line {
  display: flex; gap: 14px; padding: 8px 2px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; align-items: flex-start;
}
.detail-line:last-child { border-bottom: none; }
.detail-line span { width: 120px; flex: none; color: var(--text-3); }
.detail-line b { font-weight: 600; line-height: 1.6; }

/* 成员角色：隐藏写操作入口（后端仍会二次校验） */
body.role-member .banner-actions,
body.role-member [data-action="new"],
body.role-member .icon-btn,
body.role-member .card-ops .btn,
body.role-member [data-action="ap-decide"],
body.role-member [data-action="recalc"],
body.role-member [data-action="decision-to-task"],
body.role-member [data-action="add-decision"],
body.role-member .file-label { display: none !important; }

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-main { padding: 30px 18px; }
}

/* ============================================================
 * 第四版：甘特图
 * ============================================================ */
.gantt {
  display: flex; background: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.gantt-side { width: 260px; flex: none; border-right: 1px solid var(--line); background: #fff; }
.gantt-side-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; font-size: 12px; font-weight: 700;
  border-bottom: 1px solid var(--line); background: #fff;
}
.gantt-side-head .g-hint { font-size: 10.5px; color: var(--text-3); font-weight: 400; }
.g-row {
  display: flex; align-items: center; gap: 7px; padding: 0 12px;
  font-size: 12px; border-bottom: 1px solid #F7F8FC; overflow: hidden;
}
.g-row.g-proj { background: #F7F8FC; font-weight: 700; font-size: 12.5px; color: var(--text); }
.g-proj-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-count {
  font-size: 10.5px; color: var(--text-3); background: #fff;
  border-radius: 9px; padding: 1px 7px; font-weight: 600;
}
.g-row.g-task { cursor: pointer; }
.g-row.g-task:hover { background: #F8F6FF; }
.g-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.g-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-who { font-size: 10.5px; color: var(--text-3); flex: none; }
.gantt-scroll { overflow-x: auto; overflow-y: hidden; flex: 1; }
.gantt-scroll svg { display: block; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--text-2); }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gantt-legend i { width: 14px; height: 8px; border-radius: 3px; display: inline-block; }
.gantt-legend i.g-line { width: 2px; height: 14px; background: #EF4444; border-radius: 0; }
.gantt-legend i.g-arrow { width: 18px; height: 0; border-top: 2px dashed #A78BFA; border-radius: 0; }

@media (max-width: 900px) {
  .gantt { flex-direction: column; }
  .gantt-side { width: 100%; border-right: none; border-bottom: 1px solid var(--line); }
  .gantt-side-rows { max-height: 220px; overflow-y: auto; }
  .gantt-scroll { overflow-x: auto; }
}

/* ============================================================
 * 第五版：评论 / @提醒
 * ============================================================ */
.bell {
  position: relative; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.bell:hover { border-color: var(--purple-3); background: #F8F6FF; }
.bell.has { border-color: #FCA5A5; background: #FFF5F5; }
.bell i {
  position: absolute; top: -5px; right: -5px;
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--red); color: #fff; font-size: 9.5px; font-style: normal;
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}

.cm-wrap { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 4px; }
.cm-list { max-height: 220px; overflow-y: auto; margin-bottom: 10px; }
.cm-item { display: flex; gap: 8px; padding: 8px 2px; border-bottom: 1px solid #F7F8FC; }
.cm-item:last-child { border-bottom: none; }
.cm-main { flex: 1; min-width: 0; }
.cm-head { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.cm-head b { font-size: 12.5px; }
.cm-head span { color: var(--text-3); font-size: 11px; }
.cm-body { font-size: 12.8px; line-height: 1.7; margin-top: 3px; word-break: break-word; }
.cm-body .mention { color: var(--purple); font-weight: 700; background: #F3F0FF; border-radius: 5px; padding: 0 3px; }
.cm-empty { font-size: 12px; color: var(--text-3); padding: 14px 0; text-align: center; }
.cm-input textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 12px; font-size: 13px; outline: none; resize: vertical; min-height: 56px;
}
.cm-input textarea:focus { border-color: var(--purple-3); }
.cm-tools { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.cm-quick { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.cm-at {
  border: 1px dashed var(--line); background: #fff; color: var(--text-2);
  border-radius: 20px; font-size: 11px; padding: 2px 9px;
}
.cm-at:hover { border-color: var(--purple-3); color: var(--purple); background: #F8F6FF; }

.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #FAFBFF; }
.notif-item .ndot {
  width: 7px; height: 7px; border-radius: 50%; background: #D8DCE6;
  margin-top: 6px; flex: none;
}
.notif-item.unread .ndot { background: var(--red); box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
.notif-item .n-text { font-size: 12.8px; line-height: 1.6; }
.notif-item.unread .n-text { font-weight: 700; }
.notif-item .n-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.t-cm { font-size: 10.5px; color: var(--purple); background: #F3F0FF; border-radius: 10px; padding: 1px 7px; }

/* ============================================================
 * 第六版：周报
 * ============================================================ */
.wk-kpi {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow);
  padding: 14px 18px; display: flex; flex-direction: column; gap: 2px;
  border-left: 3px solid var(--purple-3);
}
.wk-kpi b { font-size: 24px; font-weight: 800; line-height: 1.1; }
.wk-kpi span { font-size: 11.5px; color: var(--text-2); }
.wk-kpi.g { border-left-color: var(--green); }
.wk-kpi.b { border-left-color: var(--blue); }
.wk-kpi.r { border-left-color: var(--red); }
.wk-kpi.o { border-left-color: var(--orange); }
.wk-kpi.p { border-left-color: var(--purple); }
.wk-kpi.y { border-left-color: #EAB308; }

.md-pre {
  white-space: pre-wrap; word-break: break-word;
  background: #FAFBFF; border-radius: 10px; padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.8px; line-height: 1.75; color: var(--text);
  max-height: 420px; overflow: auto; margin: 0;
}

/* ============================================================
 * 第七版：Excel 导入导出
 * ============================================================ */
.imp-summary { display: flex; gap: 14px; align-items: center; font-size: 12.5px; margin: 6px 0 10px; }
.imp-summary .ok b { color: var(--green); }
.imp-summary .bad b { color: var(--red); }
.imp-block { margin-top: 10px; }
.imp-title { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.imp-scroll { max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.imp-scroll .table { font-size: 12px; }
.imp-scroll .table th { position: sticky; top: 0; background: #fff; z-index: 1; }
.form-row input[type="file"] {
  width: 100%; border: 1px dashed var(--line); border-radius: 9px;
  padding: 9px 12px; font-size: 12.5px; background: #FAFBFF;
}

