/* 项目管理系统 —— 自研界面样式（极简手写 CSS / 清爽浅色） */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --brand: #2b6cb0;
    --brand-dark: #245a92;
    --brand-light: #ebf4ff;
    --ink: #1f2937;
    --ink-2: #4b5563;
    --ink-3: #9ca3af;
    --line: #e5e7eb;
    --line-2: #f1f3f5;
    --bg: #f5f7fa;
    --white: #fff;
    --ok: #16a34a;
    --warn: #d97706;
    --danger: #dc2626;
    --row-h: 34px;
}

html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 13px; color: var(--ink); background: var(--bg); line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
    width: 360px; background: var(--white); border-radius: 12px; padding: 34px 30px;
    box-shadow: 0 8px 30px rgba(31, 41, 55, .09);
}
.login-card h1 { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.login-card h1 i { color: var(--brand); margin-right: 8px; }
.login-card .sub { color: var(--ink-3); font-size: 12.5px; margin-bottom: 22px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select {
    width: 100%; padding: 9px 12px; border: 1px solid #d7dde5; border-radius: 7px;
    outline: none; background: var(--white); transition: .15s;
}
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(43,108,176,.12); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: none; cursor: pointer; border-radius: 7px; padding: 8px 14px;
    background: var(--white); color: var(--ink-2); border: 1px solid var(--line);
    transition: .15s; white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #d1d9e2; }
.btn i { font-size: 12px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: #eef2f7; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.alert { padding: 9px 13px; border-radius: 7px; font-size: 12.5px; margin-bottom: 14px; }
.alert-error { background: #fef2f2; color: #b91c1c; border-left: 3px solid var(--danger); }

/* ---------- 顶栏 ---------- */
.topbar {
    height: 52px; background: var(--white); border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 14px; padding: 0 18px;
    position: sticky; top: 0; z-index: 30;
}
.topbar .brand { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.topbar .brand i { color: var(--brand); }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.avatar {
    width: 28px; height: 28px; border-radius: 50%; background: var(--brand-light); color: var(--brand);
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.crumb { color: var(--ink-3); }
.crumb b { color: var(--ink); font-weight: 600; }

/* ---------- 页面容器 ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 22px 20px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 17px; font-weight: 600; }
.page-head .spacer { flex: 1; }

/* ---------- 项目列表 ---------- */
.proj-table { width: 100%; background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(31,41,55,.06); }
.proj-table table { width: 100%; border-collapse: collapse; }
.proj-table th {
    text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3);
    padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fbfcfe;
}
.proj-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.proj-table tr:last-child td { border-bottom: none; }
.proj-table tbody tr:hover { background: #fafcff; }
.proj-name { font-weight: 600; color: var(--brand); cursor: pointer; }
.proj-name:hover { text-decoration: underline; }
.bar-mini { width: 90px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; display: inline-block; vertical-align: middle; }
.bar-mini span { display: block; height: 100%; background: var(--brand); }
.empty-state { text-align: center; padding: 56px 0; color: var(--ink-3); }
.empty-state i { font-size: 32px; display: block; margin-bottom: 12px; color: #cdd5df; }

/* ---------- 项目视图 ---------- */
.proj-head {
    background: var(--white); border-bottom: 1px solid var(--line);
    padding: 12px 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    position: sticky; top: 52px; z-index: 25;
}
.proj-head h3 { font-size: 15px; font-weight: 600; }
.proj-meta { color: var(--ink-3); font-size: 12.5px; display: flex; gap: 14px; }
.tabs { display: flex; gap: 4px; }
.tab {
    padding: 6px 13px; border-radius: 7px; cursor: pointer; color: var(--ink-2); font-size: 12.5px;
    border: 1px solid transparent;
}
.tab:hover { background: #f1f5f9; }
.tab.active { background: var(--brand-light); color: var(--brand); font-weight: 600; }

.toolbar {
    display: flex; align-items: center; gap: 6px; padding: 8px 18px;
    background: var(--white); border-bottom: 1px solid var(--line); flex-wrap: wrap;
    position: sticky; top: 105px; z-index: 24;
}
.toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { border: none; background: var(--white); padding: 5px 11px; cursor: pointer; color: var(--ink-2); font-size: 12.5px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--brand); color: #fff; }

/* ---------- 甘特图 ---------- */
.gantt {
    display: flex; background: var(--white); border: 1px solid var(--line);
    border-radius: 10px; overflow: hidden; margin: 14px 18px 30px; height: calc(100vh - 210px);
}
.gantt-left { min-width: 320px; display: flex; flex-direction: column; overflow: hidden; }
.gantt-right { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 300px; }
.gantt-scroll { overflow: auto; flex: 1; position: relative; }
/* 中间可拖动分栏 */
.gantt-splitter {
    width: 7px; flex: none; cursor: col-resize; background: #eef2f7;
    border-left: 1px solid var(--line); border-right: 1px solid var(--line);
    position: relative; touch-action: none;
}
.gantt-splitter::after {
    content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 2px; height: 28px; border-radius: 2px; background: #c8d3e0;
}
.gantt-splitter:hover, .dragging-split .gantt-splitter { background: var(--brand-light); }
.gantt-splitter:hover::after, .dragging-split .gantt-splitter::after { background: var(--brand); }
body.dragging-split, body.dragging-split * { cursor: col-resize !important; user-select: none; }
/* 右侧表头吸顶 */
.tl-head { position: sticky; top: 0; z-index: 6; background: #fff; }
.g-head { position: sticky; top: 0; z-index: 6; }

.g-head, .g-row { display: flex; align-items: stretch; min-width: max-content; }
.g-head { position: sticky; top: 0; z-index: 5; background: #fbfcfe; border-bottom: 1px solid var(--line); }
.g-cell {
    padding: 0 8px; height: var(--row-h); display: flex; align-items: center;
    border-right: 1px solid var(--line-2); overflow: hidden; white-space: nowrap;
}
.g-head .g-cell { font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.g-row { border-bottom: 1px solid var(--line-2); }
.g-row:hover { background: #fafcff; }
.g-row.summary { background: #fcfdff; font-weight: 600; }
.g-row.selected { background: var(--brand-light); }
.c-wbs { width: 54px; color: var(--ink-3); font-size: 12px; }
.c-name { flex: 1; min-width: 240px; }
.c-assignee { width: 92px; }
.c-prio { width: 62px; }
.c-dep { width: 96px; color: var(--ink-3); font-size: 12px; }
.c-date { width: 96px; font-size: 12px; }
.c-dur { width: 62px; font-size: 12px; }
.c-prog { width: 66px; font-size: 12px; }
.c-act { width: 34px; justify-content: center; }
.name-text { overflow: hidden; text-overflow: ellipsis; cursor: text; flex: 1; }
.name-indent { display: inline-block; width: 14px; flex: none; }
.row-toggle {
    width: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--ink-3); font-size: 9px;
}
.row-toggle:hover { color: var(--brand); }
.milestone-dot { color: var(--warn); margin-right: 5px; font-size: 10px; }
.prog-pill { font-size: 11px; padding: 1px 6px; border-radius: 9px; background: #eef2f7; color: var(--ink-2); }
.prog-pill.done { background: #e8f7ee; color: var(--ok); }

/* 右侧时间轴 */
.tl-head { position: sticky; top: 0; z-index: 5; background: #fbfcfe; border-bottom: 1px solid var(--line); }
.tl-months { display: flex; height: 18px; }
.tl-month { font-size: 11px; color: var(--ink-3); border-right: 1px solid var(--line); padding-left: 6px; display: flex; align-items: center; overflow: hidden; }
.tl-days { display: flex; height: 16px; }
.tl-day { font-size: 9.5px; color: var(--ink-3); border-right: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; }
.tl-day.weekend { background: #f8fafc; }
.tl-day.today { background: var(--brand-light); color: var(--brand); font-weight: 700; }
.tl-body { position: relative; }
.tl-row { position: relative; height: var(--row-h); border-bottom: 1px solid var(--line-2); }
.tl-weekend { position: absolute; top: 0; bottom: 0; background: #f9fbfd; }
.tl-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #ef4444; opacity: .5; z-index: 3; }
.bar {
    position: absolute; top: 8px; height: 17px; border-radius: 4px; background: #7ea9d8;
    cursor: grab; z-index: 2; display: flex; align-items: center; overflow: hidden;
}
.bar.summary { top: 10px; height: 12px; background: #334155; border-radius: 2px; }
.bar.milestone { background: transparent; top: 8px; height: 17px; }
.bar.milestone::after {
    content: ''; position: absolute; left: 50%; top: 4px; width: 11px; height: 11px;
    background: var(--warn); transform: translateX(-50%) rotate(45deg); border-radius: 2px;
}
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--brand); opacity: .85; }
.bar.summary .fill { background: #0f172a; }
.bar .label { position: relative; z-index: 2; font-size: 10px; color: #fff; padding: 0 5px; white-space: nowrap; }
.bar .grip { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: ew-resize; z-index: 3; }
.bar:hover { filter: brightness(1.06); }
.bar.dragging { opacity: .85; cursor: grabbing; }
.dep-layer { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

/* ---------- 看板 ---------- */
.kanban { display: flex; gap: 14px; padding: 16px 18px 40px; align-items: flex-start; overflow-x: auto; }
.kcol { background: #eef2f7; border-radius: 10px; width: 300px; flex: none; padding: 10px; min-height: 200px; }
.kcol h4 { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; margin-bottom: 10px; padding: 0 4px; }
.kcol h4 .cnt { margin-left: auto; background: #dfe6ee; color: var(--ink-2); border-radius: 9px; padding: 0 7px; font-size: 11px; }
.kcard {
    background: var(--white); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(31,41,55,.07); cursor: grab;
}
.kcard:hover { box-shadow: 0 3px 10px rgba(31,41,55,.1); }
.kcard .t { font-weight: 500; margin-bottom: 6px; }
.kcard .m { display: flex; gap: 10px; color: var(--ink-3); font-size: 11.5px; flex-wrap: wrap; }
.kcol.drag-over { outline: 2px dashed var(--brand); outline-offset: -3px; }

/* ---------- 文件 / 成员 ---------- */
.panel { background: var(--white); border-radius: 10px; margin: 14px 18px 30px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(31,41,55,.06); }
.panel h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.file-list li { list-style: none; display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.file-list li:last-child { border-bottom: none; }
.file-list .sz { color: var(--ink-3); font-size: 12px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
    display: none; position: fixed; inset: 0; background: rgba(17,24,39,.42);
    align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal-mask.open { display: flex; }
.modal { background: var(--white); border-radius: 12px; width: 460px; max-width: 100%; padding: 22px 24px; max-height: 88vh; overflow-y: auto; }
.modal h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; }
.modal-acts { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.hint { font-size: 12px; color: var(--ink-3); line-height: 1.7; }

/* 行内编辑 */
.inline-input {
    width: 100%; border: 1px solid var(--brand); border-radius: 5px; padding: 3px 6px;
    outline: none; font-size: 12.5px; background: #fff;
}
.toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
    background: #1f2937; color: #fff; padding: 10px 18px; border-radius: 8px;
    font-size: 13px; z-index: 200; opacity: 0; transition: .25s; pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { background: #b91c1c; }

@media (max-width: 900px) {
    .gantt { flex-direction: column; height: auto; }
    .gantt-left { width: 100%; }
    .gantt-right { height: 420px; }
}

/* ---------- 行内「⋯」菜单 ---------- */
.row-menu-btn {
    opacity: 0; flex: none; width: 20px; height: 20px; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-3); cursor: pointer; font-size: 12px; transition: .12s;
}
.g-row:hover .row-menu-btn { opacity: 1; }
.row-menu-btn:hover { background: #e8eef6; color: var(--brand); }
.ctx-menu {
    position: fixed; z-index: 300; min-width: 236px; background: #fff;
    border: 1px solid var(--line); border-radius: 9px;
    box-shadow: 0 10px 30px rgba(31,41,55,.16); padding: 5px; font-size: 12.8px;
}
.ctx-menu .mi {
    display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 6px;
    cursor: pointer; color: var(--ink); white-space: nowrap;
}
.ctx-menu .mi:hover { background: #f1f5f9; }
.ctx-menu .mi i { width: 14px; color: var(--ink-3); font-size: 11.5px; }
.ctx-menu .mi .kb { margin-left: auto; color: var(--ink-3); font-size: 11px; font-family: "SF Mono", Consolas, monospace; }
.ctx-menu .mi.danger { color: var(--danger); }
.ctx-menu .mi.danger i { color: var(--danger); }
.ctx-menu .divider { height: 1px; background: var(--line-2); margin: 4px 2px; }
.kbd-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.kbd-row:last-child { border-bottom: none; }
kbd {
    background: #f1f5f9; border: 1px solid #d8e0e9; border-bottom-width: 2px; border-radius: 4px;
    padding: 1px 6px; font-family: "SF Mono", Consolas, monospace; font-size: 11.5px; color: var(--ink-2);
}

/* ---------- 行悬停快捷按钮 / 列宽拖动手柄 ---------- */
.row-acts { gap: 2px; justify-content: flex-end; }
.row-act-btn {
    opacity: 0; flex: none; width: 18px; height: 18px; border-radius: 4px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--ink-3); cursor: pointer; font-size: 10px; transition: .12s;
}
.g-row:hover .row-act-btn { opacity: 1; }
.row-act-btn:hover { background: var(--brand-light); color: var(--brand); }
.col-resizer {
    position: absolute; right: -3px; top: 0; bottom: 0; width: 7px;
    cursor: col-resize; z-index: 6;
}
.col-resizer:hover { background: rgba(43,108,176,.18); }
.c-status { justify-content: center; }
.c-collab { font-size: 12px; color: var(--ink-2); }
.c-assignee { cursor: pointer; }

/* ---------- 甘特条：状态色 / 百分比 / 汇总括号 / 把手 ---------- */
.bar {
    box-shadow: 0 1px 2px rgba(31,41,55,.14);
    transition: filter .12s, box-shadow .12s;
}
.bar.leaf { border-radius: 5px; }
.bar.st-todo    { background: #94a3b8; }
.bar.st-doing   { background: #2b6cb0; }
.bar.st-done    { background: #16a34a; }
.bar.st-overdue { background: #dc2626; }
.bar.leaf .fill {
    background: rgba(255,255,255,.34);
    border-radius: 5px 0 0 5px;
}
.bar.leaf .label {
    position: absolute; left: 6px; top: 0; bottom: 0; display: flex; align-items: center;
    font-size: 10.5px; color: #fff; max-width: calc(100% - 42px);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bar.leaf .pct {
    position: absolute; right: 6px; top: 0; bottom: 0; display: flex; align-items: center;
    font-size: 10px; font-weight: 700; color: #fff; opacity: .95;
    text-shadow: 0 1px 1px rgba(0,0,0,.18);
}
.bar.leaf:hover { filter: brightness(1.07); box-shadow: 0 2px 8px rgba(31,41,55,.22); }
.bar.leaf .grip {
    width: 5px; background: rgba(255,255,255,.45);
    border-radius: 2px; margin: 3px 0; opacity: 0; transition: opacity .12s;
}
.bar.leaf:hover .grip { opacity: 1; }
.bar.leaf .grip-l { left: 0; right: auto; }
.bar.leaf:hover .grip-l { left: 1px; }

/* 汇总任务：括号条 */
.sum-wrap { position: absolute; top: 0; height: var(--row-h); }
.sum-label {
    position: absolute; top: 1px; left: 2px; font-size: 10px; color: var(--ink-2);
    display: flex; gap: 6px; align-items: center; white-space: nowrap;
    max-width: 100%; overflow: hidden;
}
.sum-label b { color: var(--ink); font-weight: 700; }
.bar.summary {
    position: absolute; bottom: 5px; left: 0; right: 0; height: 8px;
    background: #cbd5e1; border-radius: 2px; box-shadow: none; overflow: hidden;
}
.bar.summary .sum-prog {
    position: absolute; left: 0; top: 0; bottom: 0; background: #16a34a; opacity: .85;
}
.sum-cap-l, .sum-cap-r {
    position: absolute; bottom: -4px; width: 0; height: 0;
    border-left: 5px solid transparent; border-right: 5px solid transparent;
    border-top: 5px solid #64748b;
}
.sum-cap-l { left: 0; }
.sum-cap-r { right: 0; }

/* 里程碑菱形 */
.bar.milestone { width: 18px; height: 18px; top: 8px; background: transparent; box-shadow: none; }
.ms-diamond {
    position: absolute; inset: 3px; background: #d97706; transform: rotate(45deg);
    border-radius: 2px; box-shadow: 0 1px 3px rgba(217,119,6,.5);
}

/* ---------- 拖拽手感（鼠标 + 平板触屏） ---------- */
.bar { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.bar.dragging { cursor: grabbing; z-index: 9; box-shadow: 0 6px 18px rgba(31,41,55,.28); }
body.dragging-bar, body.dragging-bar * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.drag-hint {
    position: fixed; z-index: 400; transform: translateX(-50%);
    background: #1f2937; color: #fff; font-size: 11.5px; padding: 5px 10px;
    border-radius: 6px; white-space: nowrap; pointer-events: none;
    box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
/* 触屏设备上把手和行内按钮常显，方便点 */
@media (hover: none) and (pointer: coarse) {
    .bar.leaf .grip { opacity: .85; width: 9px; }
    .row-act-btn, .row-menu-btn { opacity: .9; }
    .g-cell { height: 38px; }
    :root { --row-h: 38px; }
    .bar { top: 11px; height: 20px; }
}

/* 任务名称前的层级编号 */
.wbs-tag {
    flex: none; color: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums;
    min-width: 40px; margin-right: 5px; letter-spacing: .2px;
}
.c-wbs { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; }

/* ---------- 时间轴表头：年/月 + 周 + 日 ---------- */
.tl-months { display: flex; height: 20px; border-bottom: 1px solid var(--line-2); }
.tl-month {
    font-size: 11.5px; font-weight: 600; color: var(--ink-2); border-right: 1px solid var(--line);
    padding-left: 7px; display: flex; align-items: center; overflow: hidden;
    background: #f8fafc;
}
.tl-weeks { position: relative; height: 15px; border-bottom: 1px solid var(--line-2); }
.tl-week {
    position: absolute; top: 0; bottom: 0; border-right: 1px dashed #d7dee7;
    display: flex; align-items: center; gap: 4px; overflow: hidden; padding-left: 4px;
}
.tl-week span { font-size: 9.5px; color: var(--ink-3); white-space: nowrap; }
.tl-week em { font-size: 9px; color: var(--warn); font-style: normal; white-space: nowrap; }

/* ---------- 时间轴分层表头（年 / 季度 / 月 / 周 / 日） ---------- */
.tl-band { position: relative; height: 19px; border-bottom: 1px solid var(--line-2); }
.tl-bcell {
    position: absolute; top: 0; bottom: 0; display: flex; align-items: center; gap: 5px;
    padding-left: 7px; overflow: hidden; border-right: 1px solid var(--line);
    font-size: 11.5px; color: var(--ink-2); white-space: nowrap;
}
.tl-bcell em { font-style: normal; font-size: 9.5px; color: var(--warn); }
.band-year .tl-bcell { background: #eef3f9; font-weight: 700; color: var(--ink); font-size: 12px; }
.band-quarter .tl-bcell { background: #f6f9fc; font-weight: 600; }
.band-month .tl-bcell { background: #fafcfe; font-weight: 600; font-size: 11.5px; }
.band-week .tl-bcell {
    background: transparent; border-right: 1px dashed #d7dee7;
    font-size: 10px; color: var(--ink-3); font-weight: 400;
}
.tl-days { display: flex; height: 17px; }

/* ---------- 表头竖线：实线、周界与月界错开 ---------- */
.tl-bcell { border-right: 1px solid #e3e9f0; }
.band-month .tl-bcell { border-right: 1px solid #cdd7e3; }   /* 月界更深一点 */
.band-week .tl-bcell { border-right: 1px solid #e8edf3; }
.band-year .tl-bcell { border-right: 1px solid #b9c6d6; }
/* 时间轴区域网格 */
.tl-vline { position: absolute; top: 0; bottom: 0; width: 1px; background: #eef2f7; }
.tl-vline.month { background: #d6dfea; }

/* ==================== 补齐功能样式 ==================== */
/* 顶栏搜索 */
.search-wrap { position: relative; margin-left: 18px; }
.search-wrap > i {
    position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
    font-size: 11px; color: var(--ink-3); pointer-events: none;
}
#pm-search {
    width: 190px; height: 28px; padding: 0 10px 0 26px; font-size: 12.5px;
    border: 1px solid var(--line-2); border-radius: 6px; background: #f8fafc; color: var(--ink);
    transition: .15s;
}
#pm-search:focus { width: 280px; background: #fff; border-color: var(--brand); outline: none; }
.search-results {
    display: none; position: absolute; top: 34px; left: 0; width: 460px; max-height: 420px;
    overflow: auto; background: #fff; border: 1px solid var(--line-2); border-radius: 8px;
    box-shadow: 0 10px 30px rgba(31,41,55,.16); z-index: 320; padding: 4px;
}
.search-results.open { display: block; }
.sr-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 6px;
    font-size: 12.5px; cursor: pointer;
}
.sr-item.on, .sr-item:hover { background: var(--brand-light); }
.sr-item > i { color: var(--ink-3); font-size: 11px; width: 13px; }
.sr-wbs { color: var(--ink-3); font-size: 11px; min-width: 42px; }
.sr-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-proj { color: var(--brand); font-size: 11px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-date { color: var(--ink-3); font-size: 10.5px; }
.sr-empty { padding: 14px; text-align: center; color: var(--ink-3); font-size: 12px; }

/* 行高亮闪烁 */
@keyframes flashRow { 0%,100% { background: transparent } 30% { background: #fff3cd } }
.g-row.flash { animation: flashRow 1.6s ease 2; }

/* 徽标 / 标签 */
.badge-num {
    display: inline-block; min-width: 15px; padding: 0 4px; border-radius: 8px;
    background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; line-height: 15px;
}
.crit-tag {
    flex: none; margin-left: 6px; padding: 0 5px; border-radius: 3px; font-size: 9.5px;
    background: #fee2e2; color: #b91c1c; font-weight: 700;
}
.late-tag {
    flex: none; margin-left: 6px; padding: 0 5px; border-radius: 3px; font-size: 9.5px;
    background: #fee2e2; color: #b91c1c;
}
.early-tag {
    flex: none; margin-left: 6px; padding: 0 5px; border-radius: 3px; font-size: 9.5px;
    background: #dcfce7; color: #15803d;
}
.bar.leaf.critical { outline: 1.5px solid #b91c1c; outline-offset: 1px; }

/* 实际工期条 / 条下日期 */
.actual-bar {
    position: absolute; height: 5px; top: 26px; background: #475569; border-radius: 3px; opacity: .85;
}
.range-label {
    position: absolute; top: 25px; font-size: 9px; color: var(--ink-3); text-align: center;
    white-space: nowrap; overflow: hidden; pointer-events: none;
}
.tl-row { height: var(--row-h); position: relative; }

/* 任务详情扩展 */
.detail-extra { margin-top: 16px; border-top: 1px dashed var(--line-2); padding-top: 14px; }
.de-sec { margin-bottom: 16px; }
.de-head {
    display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700;
    color: var(--ink); margin-bottom: 9px;
}
.de-head > i { color: var(--brand); }
.de-head .hint { font-weight: 400; }
.chk-list { display: flex; flex-direction: column; gap: 3px; }
.chk-item {
    display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 5px;
    font-size: 12.5px; cursor: pointer; border: 1px solid transparent;
}
.chk-item:hover { background: #f8fafc; border-color: var(--line-2); }
.chk-item input { width: auto; margin: 0; }
.chk-item span { flex: 1; }
.chk-item.done span { text-decoration: line-through; color: var(--ink-3); }
.chk-item .chk-del { color: var(--ink-3); font-size: 10px; opacity: 0; }
.chk-item:hover .chk-del { opacity: 1; }
.chk-item .chk-del:hover { color: var(--danger); }
.chk-add { display: flex; gap: 6px; margin-top: 8px; }
.chk-add input { flex: 1; }

/* 表格 / 图例 / 设置 */
.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini-table th, .mini-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.mini-table th { background: #f8fafc; font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.mini-table tr.row-changed td { background: #fffbeb; }
.legend-list { display: flex; flex-direction: column; gap: 9px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.legend-chip { width: 26px; height: 10px; border-radius: 3px; flex: none; }
.legend-chip.st-done { background: #16a34a; }
.legend-chip.st-doing { background: #2b6cb0; }
.legend-chip.st-overdue { background: #dc2626; }
.legend-chip.st-todo { background: #94a3b8; }
.legend-chip.chip-sum { background: #cbd5e1; height: 6px; }
.legend-chip.chip-ms { background: #d97706; width: 10px; height: 10px; transform: rotate(45deg); }
.legend-chip.chip-crit { background: #fff; outline: 1.5px solid #b91c1c; }
.legend-chip.chip-actual { background: #475569; height: 5px; }
.wd-row { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-chip {
    padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 16px;
    font-size: 12px; cursor: pointer; color: var(--ink-2); user-select: none;
}
.wd-chip.on { background: var(--brand-light); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.wl-bar { display: inline-block; width: 130px; height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.wl-bar > span { display: block; height: 100%; background: var(--brand); }
.profile-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.avatar-big {
    width: 54px; height: 54px; border-radius: 50%; background: var(--brand-light); color: var(--brand);
    display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700;
    overflow: hidden; flex: none;
}
.avatar-big img { width: 100%; height: 100%; object-fit: cover; }

/* 项目列表：页签 / 分组 / 行菜单 */
.tab-count {
    display: inline-block; margin-left: 5px; padding: 0 5px; border-radius: 8px;
    background: var(--line); color: var(--ink-2); font-size: 10px; font-weight: 700;
}
.tab.active .tab-count { background: var(--brand); color: #fff; }
.proj-layout { display: flex; gap: 16px; align-items: flex-start; }
.folder-pane { width: 190px; flex: none; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; }
.fp-head { font-size: 11.5px; color: var(--ink-3); padding: 4px 6px 8px; }
.fp-item {
    display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-radius: 6px;
    font-size: 12.5px; cursor: pointer; color: var(--ink-2);
}
.fp-item:hover { background: #f8fafc; }
.fp-item.on { background: var(--brand-light); color: var(--brand); font-weight: 600; }
.fp-item > i { font-size: 11px; }
.fp-count { margin-left: auto; color: var(--ink-3); font-size: 10.5px; }
.fp-del { opacity: 0; font-size: 10px; }
.fp-item:hover .fp-del { opacity: 1; }
.fp-del:hover { color: var(--danger); }
.fp-add {
    margin-top: 6px; padding: 7px 8px; border-top: 1px dashed var(--line-2);
    font-size: 12px; color: var(--ink-3); cursor: pointer;
}
.fp-add:hover { color: var(--brand); }
.proj-table { flex: 1; min-width: 0; }
.proj-table table { width: 100%; }
.folder-tag {
    margin-left: 7px; padding: 1px 6px; border-radius: 4px; background: #eef3f9;
    color: var(--ink-2); font-size: 10.5px;
}
.row-menu-btn.always { opacity: 1; }
.modal-wide { max-width: 900px; width: 92%; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }

/* 内联回复框 */
.inline-reply { display: flex; gap: 6px; margin: 6px 0 2px 18px; }
.inline-reply input { flex: 1; padding: 5px 9px; font-size: 12.5px; border: 1px solid var(--line-2); border-radius: 6px; }

/* 菜单分组标题 */
.cm-section {
    padding: 6px 9px 3px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .3px;
}

/* 分组项上的小图标 */
.fp-item { position: relative; }
.fp-item .fp-gear, .fp-item .fp-del { opacity: 0; transition: opacity .15s; margin-left: 4px; color: var(--ink-3); }
.fp-item:hover .fp-gear, .fp-item:hover .fp-del { opacity: 1; }
.fp-item .fp-gear:hover { color: var(--brand); }
.fp-item .fp-del:hover, .fp-item .fa-lock { color: #dc2626; opacity: 1; }
.fp-item .fa-lock { font-size: 11px; margin-left: 4px; }
