/* ============ 任务管家 样式 ============ */
:root {
  --blue: #1677ff;
  --blue-dark: #0958d9;
  --blue-soft: #e8f1ff;
  --bg: #f5f7fa;
  --card: #fff;
  --border: #e6e9f0;
  --text: #1f2329;
  --text-2: #4e5969;
  --muted: #8a919f;
  --danger: #f5222d;
  --danger-soft: #fff1f0;
  --warn: #fa8c16;
  --warn-soft: #fff7e6;
  --success: #52c41a;
  --success-soft: #f6ffed;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(31, 35, 41, .06);
  --shadow-lg: 0 8px 28px rgba(31, 35, 41, .14);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
h1, h2, h3 { margin: 0; font-weight: 600; }
[hidden] { display: none !important; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-danger { color: var(--danger); border-color: #ffd8d6; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-block { width: 100%; padding: 11px; font-size: 15px; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.mini-btn {
  border: none; background: transparent; color: var(--muted);
  font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.mini-btn:hover { background: var(--blue-soft); color: var(--blue); }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e8f1ff 0%, #f5f7fa 45%, #eef6ff 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card);
  border-radius: 16px; padding: 36px 32px 28px;
  box-shadow: var(--shadow-lg);
}
.login-logo { font-size: 40px; text-align: center; margin-bottom: 8px; }
.login-card h1 { text-align: center; font-size: 22px; margin-bottom: 6px; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 26px; }
.login-card label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.login-card input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; outline: none; transition: border-color .15s;
}
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.login-card .btn-block { margin-top: 22px; }
.login-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-top: 10px; }
.login-hint { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 0; }

/* ---------- 顶栏 ---------- */
.topbar {
  height: 56px; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 18px; padding: 0 18px;
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; white-space: nowrap; }
.brand-icon { font-size: 18px; }
.topbar-search { flex: 1; max-width: 420px; }
.topbar-search input {
  width: 100%; padding: 8px 14px; border: 1px solid var(--border);
  border-radius: 20px; background: var(--bg); outline: none;
}
.topbar-search input:focus { border-color: var(--blue); background: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px;
  border-radius: 20px; cursor: pointer; user-select: none;
}
.user-chip:hover { background: var(--bg); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600;
  background: var(--blue); flex: none;
}
.caret { color: var(--muted); font-size: 11px; }
.menu {
  position: absolute; right: 0; top: 46px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg);
  min-width: 140px; padding: 6px; z-index: 50;
}
.menu button {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  padding: 9px 12px; border-radius: 7px; font-size: 13px; color: var(--text-2);
}
.menu button:hover { background: var(--bg); color: var(--blue); }

/* ---------- 布局 ---------- */
.layout { display: flex; align-items: flex-start; min-height: calc(100vh - 56px); }
.sidebar {
  width: 240px; flex: none; padding: 16px 12px; position: sticky; top: 56px;
  height: calc(100vh - 56px); overflow-y: auto;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; border: none; background: transparent;
  padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--text-2); text-align: left;
}
.nav-item span { width: 18px; text-align: center; }
.nav-item:hover { background: #eef2f8; }
.nav-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.side-section { margin-top: 22px; }
.side-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--muted); padding: 0 8px 8px; letter-spacing: .5px;
}
.project-list { display: flex; flex-direction: column; gap: 1px; }
.project-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text-2);
}
.project-item:hover { background: #eef2f8; }
.project-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.project-item .pdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.project-item .pcount { margin-left: auto; font-size: 11px; color: var(--muted); }
.filter-group { display: flex; flex-direction: column; gap: 4px; padding: 0 9px; }
.filter-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-2); padding: 4px 0; gap: 8px;
}
.filter-row select {
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px;
  background: #fff; color: var(--text-2); font-size: 12px; max-width: 108px;
}
.filter-row input[type=checkbox] { accent-color: var(--blue); }

/* ---------- 内容区 ---------- */
.content { flex: 1; padding: 20px 24px 60px; min-width: 0; }
.view-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap;
}
.view-head h2 { font-size: 19px; }
.view-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.view-actions input[type=date] {
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; color: var(--text-2);
}
.muted { color: var(--muted); font-size: 13px; }

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat-card .stat-label { font-size: 12px; color: var(--muted); }
.stat-card .stat-value { font-size: 26px; font-weight: 700; margin-top: 4px; line-height: 1.1; }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.warn .stat-value { color: var(--warn); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.blue .stat-value { color: var(--blue); }

/* ---------- 面板 ---------- */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-head h3 { font-size: 14px; }
.panel-head .badge { margin-left: auto; }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px;
  background: #eef2f8; color: var(--text-2); font-weight: 600;
}
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--success-soft); color: var(--success); }

/* ---------- 迷你任务列表 ---------- */
.task-mini-list { padding: 6px 0; max-height: 340px; overflow-y: auto; }
.mini-task {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px;
  cursor: pointer; border-left: 3px solid transparent;
}
.mini-task:hover { background: var(--bg); }
.mini-task.overdue { border-left-color: var(--danger); background: #fffafa; }
.mini-task .mt-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.mini-task .mt-due { font-size: 12px; color: var(--muted); flex: none; }
.mini-task .mt-due.overdue { color: var(--danger); font-weight: 600; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- 看板 ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.board-col { background: #eef2f8; border-radius: 12px; padding: 10px; min-height: 200px; }
.board-col-head {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-2); padding: 4px 6px 10px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-todo { background: #8a919f; }
.dot-doing { background: var(--blue); }
.dot-done { background: var(--success); }
.col-count {
  margin-left: auto; background: #fff; border-radius: 10px; padding: 0 8px;
  font-size: 11px; color: var(--muted); line-height: 18px;
}
.board-drop { min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.board-drop.drag-over { outline: 2px dashed var(--blue); outline-offset: 2px; border-radius: 8px; }

.card {
  background: var(--card); border-radius: 9px; padding: 11px 12px;
  box-shadow: 0 1px 3px rgba(31,35,41,.08); cursor: grab; border: 1px solid transparent;
  transition: box-shadow .15s, transform .1s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card.dragging { opacity: .45; }
.card .card-title { font-size: 13px; line-height: 1.45; margin-bottom: 8px; word-break: break-word; }
.card .card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card.done .card-title { color: var(--muted); text-decoration: line-through; }
.card .prio-bar { height: 3px; border-radius: 2px; margin: -11px -12px 9px; }
.prio-3 { background: #ff4d4f; }
.prio-2 { background: #ffa940; }
.prio-1 { background: #b8c2d6; }
.prio-0 { background: #dfe4ee; }
.tag {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 9px;
  background: var(--blue-soft); color: var(--blue-dark);
}
.due-pill { font-size: 11px; color: var(--muted); }
.due-pill.overdue { color: var(--danger); font-weight: 600; }
.due-pill.today { color: var(--warn); font-weight: 600; }
.meta-icons { display: flex; gap: 8px; color: var(--muted); font-size: 11px; margin-left: auto; }
.avatar-xs {
  width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 10px;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600; flex: none;
}

/* ---------- 表格 ---------- */
.table-wrap {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.task-table { width: 100%; border-collapse: collapse; }
.task-table th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 500;
  padding: 11px 14px; background: #fafbfd; border-bottom: 1px solid var(--border);
}
.task-table td { padding: 11px 14px; border-bottom: 1px solid #f2f4f8; font-size: 13px; vertical-align: middle; }
.task-table tbody tr { cursor: pointer; }
.task-table tbody tr:hover { background: var(--bg); }
.task-table tr.overdue td { background: #fffafa; }
.status-pill { font-size: 12px; padding: 2px 9px; border-radius: 10px; font-weight: 600; }
.st-todo { background: #eef2f8; color: #4e5969; }
.st-doing { background: var(--blue-soft); color: var(--blue-dark); }
.st-done { background: var(--success-soft); color: var(--success); }
.cell-title { display: flex; align-items: center; gap: 8px; }
.cell-title .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 480px; }
.cell-title .done-text { color: var(--muted); text-decoration: line-through; }

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(15, 20, 30, .32); z-index: 60;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw);
  background: var(--card); z-index: 61; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
}
.drawer-head {
  display: flex; align-items: flex-start; gap: 10px; padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-head .close {
  border: none; background: transparent; font-size: 20px; color: var(--muted);
  line-height: 1; padding: 0 4px; margin-left: auto;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }
.drawer-foot {
  border-top: 1px solid var(--border); padding: 12px 20px; display: flex; gap: 8px; align-items: center;
}
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input[type=text], .field input[type=date], .field select, .field textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 11px;
  outline: none; color: var(--text); background: #fff;
}
.field textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft);
}
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }
.title-input { font-size: 17px !important; font-weight: 600; padding: 8px 2px !important; border: none !important; box-shadow: none !important; }
.title-input:focus { border-bottom: 2px solid var(--blue) !important; border-radius: 0 !important; }
.section-title {
  font-size: 12px; color: var(--muted); letter-spacing: .4px;
  margin: 22px 0 10px; display: flex; align-items: center; gap: 8px;
}
.section-title .count { background: #eef2f8; border-radius: 8px; padding: 0 7px; font-size: 11px; }
.check-item { display: flex; align-items: center; gap: 9px; padding: 6px 0; }
.check-item input[type=checkbox] { accent-color: var(--blue); width: 15px; height: 15px; }
.check-item .ct { flex: 1; font-size: 13px; }
.check-item .ct.done { color: var(--muted); text-decoration: line-through; }
.check-item .del { border: none; background: transparent; color: var(--muted); opacity: 0; }
.check-item:hover .del { opacity: 1; }
.check-item .ct-time { flex: none; font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---------- 可搜索人员选择器 ---------- */
.pp { position: relative; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
      border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; background: #fff; }
.pp:focus-within { border-color: var(--blue); }
.pp-input { flex: 1; min-width: 90px; border: none; outline: none; padding: 5px 0;
            font-size: 13px; background: transparent; }
.pp-clear { border: none; background: transparent; color: var(--muted); font-size: 16px;
            line-height: 1; cursor: pointer; padding: 0 2px; }
.pp-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px);
           max-height: 240px; overflow-y: auto; background: #fff; border: 1px solid var(--border);
           border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 4px; }
.pp-item { display: flex; align-items: baseline; gap: 8px; padding: 7px 9px;
           border-radius: 6px; cursor: pointer; }
.pp-item:hover, .pp-item.active { background: #eef2f8; }
.pp-name { font-size: 13px; }
.pp-sub { font-size: 11px; color: var(--muted); }
.pp-empty { padding: 10px; text-align: center; color: var(--muted); font-size: 12px; }
.pp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.pp-chip { display: inline-flex; align-items: center; gap: 4px; background: #eef2f8;
           border-radius: 10px; padding: 2px 6px; font-size: 12px; }
.pp-chip button { border: none; background: transparent; color: var(--muted);
                  cursor: pointer; padding: 0; font-size: 13px; line-height: 1; }

.inline-check { display: inline-flex; align-items: center; gap: 6px;
                font-size: 13px; cursor: pointer; }
.inline-check input { width: 15px; height: 15px; accent-color: var(--blue); }

/* ---------- 层级表格视图 ---------- */
.task-table tr.row-over .tbl-name { color: #e03131; }
.tbl-num { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tbl-title-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tbl-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl-caret { border: none; background: transparent; color: var(--muted); cursor: pointer;
             width: 16px; flex: none; padding: 0; font-size: 11px; }
.tbl-caret.is-empty { cursor: default; }
.tbl-progress { flex: none; font-size: 11px; color: var(--muted); background: #eef2f8;
                border-radius: 8px; padding: 1px 6px; }
.tbl-claim { flex: none; margin-left: 4px; }
.tbl-time { white-space: nowrap; color: #495057; font-size: 12px; }
.tbl-over { color: #e03131; font-size: 12px; white-space: nowrap; }
.st { display: inline-block; border-radius: 10px; padding: 1px 8px; font-size: 12px; white-space: nowrap; }
.st-doing { background: #e7f0ff; color: #1c7ed6; }
.st-overdue { background: #ffe8e8; color: #e03131; }
.st-done-ok { background: #e6f7ee; color: #0ca678; }
.st-done-late { background: #fff4e6; color: #e8590c; }
.st-idle { background: #f1f3f5; color: #868e96; }

/* 列选择器 */
.col-picker { position: relative; display: inline-block; }
.col-picker > summary { list-style: none; cursor: pointer; }
.col-picker > summary::-webkit-details-marker { display: none; }
.col-picker-body { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 150px; }

/* 批量选择列 */
.task-table .tbl-sel { width: 34px; text-align: center; }
.task-table .tbl-sel input { width: 15px; height: 15px; accent-color: var(--blue); }

/* 完成审批 */
.approval-box { border-radius: 8px; padding: 8px 11px; font-size: 13px; margin-bottom: 8px; }
.approval-box.pending { background: #fff9db; color: #b8860b; }
.approval-box.rejected { background: #ffe8e8; color: #e03131; }
.approval-box.approved { background: #e6f7ee; color: #0ca678; }

/* 日程视图 */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell { min-height: 92px; background: #fff; border: 1px solid var(--border);
            border-radius: 8px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.is-blank { background: transparent; border-color: transparent; }
.cal-cell.is-today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.cal-day { font-size: 12px; color: var(--muted); }
.cal-chip { font-size: 11px; background: #eef2f8; border-radius: 5px; padding: 2px 5px;
            cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip:hover { background: #dde6f5; }
.cal-chip.over { background: #ffe8e8; color: #e03131; }
.cal-more { font-size: 11px; color: var(--muted); }

/* ---------- 消息中心 ---------- */
.nav-badge { background: #e03131; color: #fff; border-radius: 9px; padding: 0 5px;
             font-size: 10px; margin-left: 4px; }
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-item { display: flex; align-items: flex-start; gap: 10px; background: #fff;
            border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.msg-item.unread { border-left: 3px solid var(--blue); background: #f8fbff; }
.msg-item:hover { background: #f2f6fc; }
.msg-kind { flex: none; font-size: 11px; border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.m-due { background: #fff4e6; color: #e8590c; }
.m-over { background: #ffe8e8; color: #e03131; }
.m-review { background: #fff9db; color: #b8860b; }
.m-ok { background: #e6f7ee; color: #0ca678; }
.m-rej { background: #ffe8e8; color: #c92a2a; }
.m-sys { background: #f1f3f5; color: #868e96; }
.msg-main { flex: 1; min-width: 0; }
.msg-title { font-size: 13px; font-weight: 500; }
.msg-body { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; word-break: break-word; }
.msg-time { flex: none; font-size: 11px; color: var(--muted); white-space: nowrap; }
.msg-ding { flex: none; font-size: 11px; color: #1c7ed6; background: #e7f0ff;
            border-radius: 6px; padding: 1px 5px; }
.inline-add { display: flex; gap: 8px; margin-top: 8px; }
.inline-add input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 7px 11px; outline: none; }
.inline-add input:focus { border-color: var(--blue); }
.comment { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f2f4f8; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.comment-head .who { color: var(--text-2); font-weight: 600; }
.comment-text { font-size: 13px; line-height: 1.6; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.comment .del { border: none; background: transparent; color: var(--muted); font-size: 12px; opacity: 0; }
.comment:hover .del { opacity: 1; }
.attach-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: 13px;
}
.attach-item a { color: var(--blue); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-item a:hover { text-decoration: underline; }
.attach-item .size { color: var(--muted); font-size: 11px; margin-left: auto; flex: none; }
.attach-item .del { border: none; background: transparent; color: var(--muted); opacity: 0; }
.attach-item:hover .del { opacity: 1; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 20, 30, .35); z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: min(520px, 100%); max-height: 90vh; overflow-y: auto; padding: 22px;
}
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ---------- 日报 ---------- */
.report-body {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow); line-height: 1.75;
}
.report-body h3 { font-size: 16px; margin: 20px 0 10px; }
.report-body h3:first-child { margin-top: 0; }
.report-body ul { margin: 0 0 4px; padding-left: 20px; }
.report-body li { font-size: 13.5px; margin: 3px 0; }
.report-body .rp-date { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.report-body .rp-empty { color: var(--muted); font-size: 13px; }
.rp-stat { display: inline-flex; gap: 20px; flex-wrap: wrap; margin-bottom: 6px; }
.rp-stat b { color: var(--blue); }

/* ---------- 团队 ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.member-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); position: relative;
}
.member-card .mc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.member-card .mc-name { font-weight: 600; }
.member-card .mc-role { font-size: 11px; color: var(--muted); }
.member-card .mc-badge {
  position: absolute; top: 14px; right: 14px; font-size: 11px; padding: 1px 8px;
  border-radius: 9px; background: var(--blue-soft); color: var(--blue-dark); font-weight: 600;
}
.member-card .mc-stats { display: flex; gap: 14px; }
.mc-stat { font-size: 12px; color: var(--muted); }
.mc-stat b { display: block; font-size: 18px; color: var(--text); font-weight: 700; }
.mc-stat.danger b { color: var(--danger); }
.member-card .mc-actions { margin-top: 14px; display: flex; gap: 8px; }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: rgba(31, 35, 41, .92); color: #fff; padding: 9px 18px;
  border-radius: 20px; font-size: 13px; box-shadow: var(--shadow-lg);
  animation: toast-in .18s ease-out;
}
.toast.err { background: rgba(245, 34, 45, .95); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 任务模板 ---------- */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.tpl-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px;
}
.tpl-head { display: flex; align-items: center; gap: 10px; }
.tpl-name { font-weight: 600; font-size: 15px; }
.tpl-head .badge { margin-left: auto; background: var(--blue-soft); color: var(--blue-dark); }
.tpl-title { font-size: 13px; color: var(--text-2); }
.tpl-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.tpl-steps {
  margin: 2px 0 0; padding: 9px 12px 9px 28px; background: var(--bg);
  border-radius: 8px; font-size: 12.5px; color: var(--text-2); line-height: 1.8;
}
.tpl-steps li { margin: 1px 0; }
.tpl-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; }
.tpl-hint-box {
  background: var(--blue-soft); color: var(--blue-dark); border-radius: 8px;
  padding: 9px 12px; font-size: 12.5px; line-height: 1.65; margin-bottom: 16px;
}
.tpl-item-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.tpl-item-row .idx {
  width: 20px; height: 20px; border-radius: 50%; background: var(--blue-soft);
  color: var(--blue-dark); font-size: 11px; font-weight: 600; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.tpl-item-row input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 7px 11px; outline: none;
}
.tpl-item-row input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.tpl-item-row .del {
  border: none; background: transparent; color: var(--muted); font-size: 13px; padding: 2px 6px;
  border-radius: 6px;
}
.tpl-item-row .del:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- 参与人 / 三角色 ---------- */
.req { color: var(--danger); font-weight: 700; }
.person-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 0;
  border-bottom: 1px solid #f2f4f8;
}
.person-row:last-child { border-bottom: none; }
.person-row .pname { flex: 1; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-row .badge { flex: none; }
.person-row .del {
  border: none; background: transparent; color: var(--muted); font-size: 12px;
  padding: 2px 5px; border-radius: 5px; opacity: 0;
}
.person-row:hover .del { opacity: 1; }
.person-row .del:hover { background: var(--danger-soft); color: var(--danger); }
select.inline-select {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 11px; outline: none; background: #fff; color: var(--text-2);
}
select.inline-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
select.multi {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 4px; outline: none; color: var(--text); background: #fff;
}
select.multi:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
select.multi option { padding: 4px 8px; border-radius: 4px; }
select.multi option:checked { background: var(--blue); color: #fff; }

/* ---------- 钉钉登录 ---------- */
.dt-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted); font-size: 12px; margin: 22px 0 16px;
}
.dt-divider::before, .dt-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.btn-dingtalk {
  width: 100%; padding: 11px; border-radius: 8px; border: 1px solid #d0d7e2;
  background: #fff; color: #1f2329; font-size: 15px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  transition: all .15s;
}
.btn-dingtalk:hover { border-color: #1677ff; color: #1677ff; background: #f5f9ff; }
.btn-dingtalk .dt-logo {
  width: 20px; height: 20px; border-radius: 5px; background: #1677ff;
  color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.dt-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; line-height: 1.6; }
.dt-error {
  background: var(--danger-soft); color: var(--danger); border-radius: 8px;
  padding: 9px 12px; font-size: 12.5px; line-height: 1.6; margin-bottom: 14px;
  word-break: break-all;
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .board { grid-template-columns: 1fr; }
  .content { padding: 16px 14px 60px; }
  .topbar-search { display: none; }
}
