* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: #f5f6f8; color: #1d2129; line-height: 1.6; }
a { color: #165dff; text-decoration: none; }
a:hover { text-decoration: underline; }

.app { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 220px; background: #fff; border-right: 1px solid #e5e6eb; padding: 16px 0; position: fixed; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 10; }
.sidebar-title { display: block; padding: 0 20px 16px; font-size: 18px; font-weight: 700; color: #1d2129; border-bottom: 1px solid #e5e6eb; margin-bottom: 8px; }
.sidebar-nav { padding: 8px 0; padding-bottom: 60px; }
.nav-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; color: #4e5969; }
.nav-item-left { display: flex; align-items: center; gap: 6px; }
.nav-item:hover { background: #f2f3f5; text-decoration: none; color: #165dff; }
.nav-label { font-size: 14px; }
.nav-count { font-size: 12px; background: #e5e6eb; border-radius: 10px; padding: 1px 8px; color: #86909c; }

/* Main */
.main { flex: 1; min-width: 0; margin-left: 220px; padding: 24px 32px; }

/* Page header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; gap: 16px; }
.page-header-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.page-header h1 { font-size: 24px; font-weight: 700; color: #1d2129; margin: 0; }
.page-subtitle { color: #86909c; font-size: 13px; margin-top: 4px; white-space: nowrap; }
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 内联标题输入框 */
.inline-title-input {
    flex: 1; min-width: 400px;
    font-size: 22px; font-weight: 400; color: #1d2129;
    border: none; border-bottom: 2px solid transparent;
    background: transparent; outline: none; padding: 2px 4px;
    border-radius: 4px; transition: border-color .15s, background .15s;
}
.inline-title-input:hover { border-bottom-color: #c9cdd4; }
.inline-title-input:focus { border-bottom-color: #165dff; background: #f7f8ff; }

/* 元信息内联控件 */
.inline-select, .inline-date, .inline-url {
    font-size: 13px; color: #1d2129;
    border: 1px solid #e5e6eb; border-radius: 4px;
    padding: 3px 8px; background: #fff;
    outline: none; transition: border-color .15s;
    max-width: 100%;
}
.inline-select:focus, .inline-date:focus, .inline-url:focus { border-color: #165dff; }
.inline-url { width: 100%; box-sizing: border-box; }
.multi-picker-portal-root {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 12000;
}
.multi-picker-popover {
    z-index: 60;
}
.multi-picker-popover.is-overlay {
    position: fixed;
    pointer-events: auto;
}
.multi-picker-surface,
.inline-multi-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
    padding: 8px;
    background: #fff;
    border: 1px solid #d9dde4;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
}
.multi-picker-search,
.inline-multi-search {
    width: 100%;
    box-sizing: border-box;
}
.multi-picker-options,
.inline-multi-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 2px;
}
.multi-picker-option,
.inline-multi-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.multi-picker-option:hover,
.inline-multi-option:hover {
    background: #f7f8fa;
}
.multi-picker-option input,
.inline-multi-option input {
    margin: 0;
}
.multi-picker-actions,
.inline-multi-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}
.multi-picker-empty,
.inline-multi-empty {
    padding: 10px 8px;
    color: #86909c;
    font-size: 12px;
    text-align: center;
}
.editable-cell.is-inline-multi-open,
.tree-col.editable-cell.is-inline-multi-open {
    outline: 2px solid rgba(22, 93, 255, 0.28);
    outline-offset: -2px;
    border-radius: 6px;
    background: #f8fbff;
}

/* 内联内容编辑区 */
.inline-content-wrap { margin-bottom: 24px; }
.inline-content-label {
    display: block; font-size: 12px; color: #86909c;
    margin-bottom: 6px; font-weight: 500;
}
.inline-content-textarea {
    width: 100%; min-height: 220px; box-sizing: border-box;
    font-size: 14px; line-height: 1.7; color: #1d2129;
    border: 1px solid #e5e6eb; border-radius: 6px;
    padding: 14px 16px; background: #fff;
    resize: vertical; outline: none; transition: border-color .15s;
    font-family: inherit;
}
.inline-content-textarea:focus { border-color: #165dff; }

/* Type badge */
.type-badge { display: inline-block; background: #e8f3ff; color: #165dff; padding: 2px 10px; border-radius: 4px; font-size: 13px; font-weight: 600; font-family: monospace; }
.type-badge-sm { display: inline-block; background: #f2f3f5; color: #4e5969; padding: 1px 8px; border-radius: 3px; font-size: 12px; font-family: monospace; }
.doc-id-badge { display: inline-block; background: #f7f8fa; color: #4e5969; border: 1px solid #e5e6eb; padding: 1px 8px; border-radius: 3px; font-size: 12px; font-family: monospace; font-weight: 600; }

/* Status badges */
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.status-draft { background: #f2f3f5; color: #86909c; }
.status-not_started { background: #f2f3f5; color: #86909c; }
.status-review { background: #fff7e8; color: #ff7d00; }
.status-in_progress { background: #e8f3ff; color: #165dff; }
.status-done { background: #e8ffea; color: #00b42a; }
.status-closed { background: #f2f3f5; color: #c9cdd4; }
.status-cancelled { background: #fff2f0; color: #d4380d; }
.status-deleted { background: #f2f3f5; color: #c9cdd4; text-decoration: line-through; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; border: 1px solid #e5e6eb; border-radius: 4px; background: #fff; color: #4e5969; font-size: 14px; font-family: inherit; line-height: 1.5; cursor: pointer; }
.btn:hover { background: #f2f3f5; text-decoration: none; }
.btn-primary { background: #165dff; color: #fff; border-color: #165dff; }
.btn-primary:hover { background: #0e42d2; }
.btn-sm { padding: 5px 12px; font-size: 13px; height: 28px; border-radius: 4px; }

/* Type grid (index page) */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.type-card { display: flex; flex-direction: column; align-items: center; padding: 24px 16px; background: #fff; border-radius: 8px; border: 1px solid #e5e6eb; text-decoration: none; color: inherit; transition: box-shadow 0.2s; }
.type-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); text-decoration: none; }
.type-card-icon { font-size: 20px; font-weight: 700; font-family: monospace; color: #165dff; margin-bottom: 8px; }
.type-card-name { font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.type-card-count { font-size: 13px; color: #86909c; }
.create-project-card { border-style: dashed; }
.create-project-card:hover { box-shadow: 0 4px 12px rgba(22,93,255,0.1); }
.create-project-card .type-card-icon { color: #165dff; font-size: 28px; }
.form-container { max-width: 600px; background: #fff; border: 1px solid #e5e6eb; border-radius: 8px; padding: 24px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: #1d2129; }
.form-input, .form-textarea { width: 100%; border: 1px solid #e5e6eb; border-radius: 6px; padding: 8px 12px; font-size: 14px; }
.form-input:focus, .form-textarea:focus { outline: none; border-color: #165dff; box-shadow: 0 0 0 2px rgba(22,93,255,0.1); }
.form-code-input { width: 160px; font-family: monospace; text-transform: uppercase; }
.form-hint { display: block; font-size: 12px; color: #86909c; margin-top: 4px; }
.form-errors { margin-bottom: 16px; }
.form-error { background: #fff2f0; border: 1px solid #ffccc7; border-radius: 6px; padding: 8px 12px; color: #d4380d; font-size: 13px; margin-bottom: 6px; }
.required { color: #f53f3f; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; }

/* Filters */
.filters { margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.filter-form { display: flex; align-items: center; gap: 8px; }
.filter-form label { font-size: 14px; color: #86909c; }
.filter-form select { padding: 4px 8px; border: 1px solid #e5e6eb; border-radius: 4px; font-size: 13px; background: #fff; }

/* 统一小尺寸输入框（与 btn-sm / filter select 等高 28px） */
.form-input-sm { padding: 4px 8px; border: 1px solid #e5e6eb; border-radius: 4px; font-size: 13px; height: 28px; line-height: 20px; background: #fff; outline: none; font-family: inherit; }
.form-input-sm:focus { border-color: #165dff; box-shadow: 0 0 0 2px rgba(22,93,255,0.08); }

/* Table */
.doc-table { background: #fff; border-radius: 8px; border: 1px solid #e5e6eb; min-width: max-content; }
.doc-table table { width: auto; min-width: 100%; border-collapse: collapse; }
.doc-table th { background: #f7f8fa; text-align: left; padding: 8px 12px; font-size: 13px; color: #86909c; font-weight: 500; border-bottom: 1px solid #e5e6eb; }
.doc-table td { padding: 8px 12px; border-bottom: 1px solid #f2f3f5; font-size: 14px; }
.doc-table td:last-child { white-space: nowrap; }
.doc-table tr:last-child td { border-bottom: none; }
.doc-table .empty { text-align: center; color: #c9cdd4; padding: 32px; }

/* 列表视图中类别和执行人列允许多行换行 */
.doc-table table tbody td:nth-child(4),
.doc-table table tbody td:nth-child(8) {
    white-space: normal;
    word-break: break-word;
    line-height: 1.5;
}
/* 列表视图中部分列保持单行省略 */
.doc-table table tbody td:nth-child(5),
.doc-table table tbody td:nth-child(6) {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-table td.cell-wrap-multiline {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.5;
    word-break: break-word;
}
.doc-table table tbody td:nth-child(3) {
    white-space: nowrap;
}
/* 内联编辑单元格 */
.editable-cell { cursor: pointer; position: relative; }

/* 自定义内联下拉框（替代原生 <select>，避免 macOS 闪动问题） */
.dd-wrap { position: relative; display: inline-block; min-width: 80px; overflow: visible !important; }
.dd-trig { display: block; padding: 3px 24px 3px 8px; border: 1px solid #c9cdd4; border-radius: 4px; font-size: 13px; background: #fff; cursor: pointer; white-space: nowrap; min-width: 80px; }
.dd-trig::after { content: '▾'; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 10px; color: #86909c; pointer-events: none; }
.dd-panel { display: none; position: fixed; background: #fff; border: 1px solid #e5e6eb; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 9999; max-height: 200px; overflow-y: auto; min-width: 100px; }
.dd-wrap.open .dd-panel { display: block; }
.dd-item { display: block; padding: 5px 10px; font-size: 13px; color: #1d2129; cursor: pointer; white-space: nowrap; }
.dd-item:hover { background: #f2f3f5; }
.dd-item.selected { color: #165dff; font-weight: 600; }
.editable-cell:hover { outline: 1px dashed #165dff; outline-offset: -1px; border-radius: 2px; }
.tree-col.editable-cell:hover { outline: 1px dashed #165dff; outline-offset: -1px; border-radius: 2px; }
/* 标题内联编辑 */
.title-wrap { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.title-wrap .title-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-edit-btn { display: none; padding: 1px 5px; border: none; background: transparent; color: #165dff; font-size: 13px; cursor: pointer; border-radius: 3px; line-height: 1; }
.title-edit-btn:hover { background: #e8f3ff; }
.title-wrap:hover .title-edit-btn { display: inline-block; }
.tree-col-title:hover .title-edit-btn { display: inline-block; }
.tree-col-title .title-edit-btn { font-size: 11px; padding: 0 4px; vertical-align: middle; }

/* 标题内联编辑输入框（table 视图用） */
.title-edit-input {
    flex: 1; min-width: 120px;
    font-size: 14px; padding: 3px 8px;
    border: 1px solid #c9cdd4; border-radius: 4px;
    outline: none;
}
.title-edit-input:focus { border-color: #165dff; box-shadow: 0 0 0 2px rgba(22,93,255,0.1); }

/* 分页 */
.pagination-bar { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: #fff; border-top: 1px solid #f2f3f5; flex-wrap: nowrap; }
.pagination-bar .page-info { color: #86909c; font-size: 12px; white-space: nowrap; }
.pagination-bar .page-size-select { font-size: 12px; padding: 3px 8px; flex-shrink: 0; }
.pagination-bar .page-buttons { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.pagination-bar .page-btn { padding: 3px 8px; border: 1px solid #e5e6eb; border-radius: 4px; background: #fff; color: #4e5969; font-size: 12px; cursor: pointer; text-decoration: none; line-height: 1.4; }
.pagination-bar .page-btn:hover { background: #f2f3f5; text-decoration: none; }
.pagination-bar .page-btn.active { background: #165dff; color: #fff; border-color: #165dff; }
.pagination-bar .page-btn:disabled { opacity: 0.4; cursor: default; }

/* Doc detail meta */
.doc-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; background: #fff; border: 1px solid #e5e6eb; border-radius: 8px; padding: 16px; margin-bottom: 24px; }
.meta-item label { display: block; font-size: 12px; color: #86909c; margin-bottom: 4px; }
.meta-item-inline { display: inline-flex; align-items: center; gap: 8px; margin-right: 12px; }
.meta-item-inline label { font-size: 12px; color: #86909c; white-space: nowrap; margin: 0; }
.meta-item span, .meta-item a { font-size: 14px; }
.version-edit-input {
    font-size: 14px; color: #1d2129;
    border: 1px solid #d0d5dd; border-radius: 4px;
    padding: 4px 10px; background: #fafbfc;
    outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
    max-width: 24rem; width: 100%;
}
.version-edit-input:hover { border-color: #a8aeb8; }
.version-edit-input:focus { border-color: #165dff; background: #fff; box-shadow: 0 0 0 2px rgba(22,93,255,0.1); }
.version-edit-input::placeholder { color: #c9cdd4; }

/* Meta 芯片：类别 / 经办人（与详情页风格统一） */
.meta-item-chips-wrap {
    grid-column: span 2;
    min-width: 0;
}
.meta-chips-field {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}
.meta-chips-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 6px;
}
.meta-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
    min-height: 30px;
    align-items: center;
}
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    max-width: 100%;
    padding: 3px 3px 3px 11px;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 500;
    color: #1d2129;
    background: #fff;
    border: 1px solid #e1e3e8;
    border-radius: 100px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.meta-chip:hover {
    border-color: #c9cdd4;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.meta-chip-label {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.meta-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 1px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #a0a5b0;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    font-weight: 400;
    transition: background 0.12s, color 0.12s;
}
.meta-chip-remove:hover {
    color: #d0302f;
    background: #ffecec;
}
.meta-chip-remove:focus-visible {
    outline: 2px solid #165dff;
    outline-offset: 1px;
}
.meta-chip-add-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    color: #165dff;
    background: #fff;
    border: 1px dashed #b3c7f7;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(22, 93, 255, 0.08);
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.meta-chip-add-btn:hover {
    background: #f0f6ff;
    border-color: #165dff;
    border-style: solid;
}
.meta-chip-add-btn:active {
    transform: scale(0.94);
}
.meta-chip-add-btn:focus-visible {
    outline: 2px solid #165dff;
    outline-offset: 2px;
}
.meta-pick-pop {
    display: none;
    position: fixed;
    z-index: 80;
    background: #fff;
    border: 1px solid #d9dde4;
    border-radius: 8px;
    border-left: 3px solid #165dff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.12);
    min-width: 220px;
    max-width: 360px;
    padding: 8px;
}
.meta-pick-pop.is-open {
    display: block;
}
.meta-pick-pop .multi-picker-surface {
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    gap: 8px;
}
.meta-pick-pop .meta-search-list {
    max-height: 260px;
    overflow-y: auto;
}
.meta-pick-pop .meta-pick-select-wrap {
    max-height: 260px;
    overflow-y: auto;
}
.meta-pick-pop .meta-pick-select {
    max-height: 260px;
}
.meta-pick-hint {
    margin: 0 0 8px;
    font-size: 12px;
    color: #86909c;
    line-height: 1.4;
}
.meta-pick-select {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
    color: #1d2129;
    background: #fafbfc;
    border: 1px solid #e1e3e8;
    border-radius: 8px;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.meta-pick-select:hover {
    border-color: #c9cdd4;
}
.meta-pick-select:focus {
    outline: none;
    border-color: #165dff;
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.12);
    background: #fff;
}
.meta-chip-search-input {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
    color: #1d2129;
    background: #fafbfc;
    border: 1px solid #e1e3e8;
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.meta-chip-search-input::placeholder {
    color: #a0a5b0;
}
.meta-chip-search-input:hover {
    border-color: #c9cdd4;
}
.meta-chip-search-input:focus {
    outline: none;
    border-color: #165dff;
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.12);
    background: #fff;
}
.meta-search-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 4px 0;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 8px;
}
.meta-search-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    margin: 0 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #1d2129;
    transition: background 0.1s;
}
.meta-search-list li::before {
    content: '';
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6aa1ff, #165dff);
    opacity: 0.85;
}
.meta-search-list li:hover {
    background: #f0f6ff;
}
.meta-search-list li:active {
    background: #e5efff;
}
.meta-search-list li.meta-search-empty-msg {
    cursor: default;
    justify-content: center;
    color: #86909c;
    font-size: 12px;
    padding: 11px 12px;
}
.meta-search-list li.meta-search-empty-msg:hover,
.meta-search-list li.meta-search-empty-msg:active {
    background: transparent;
}
.meta-search-list li.meta-search-empty-msg::before {
    display: none;
}
.meta-chip-add-btn.is-pop-open {
    background: #e8f0ff;
    border-style: solid;
    border-color: #165dff;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.15);
}
.meta-search-empty {
    margin: 8px 0 0;
    padding: 10px 12px;
    font-size: 12px;
    color: #86909c;
    text-align: center;
    background: #fafbfc;
    border: 1px dashed #e1e3e8;
    border-radius: 8px;
}

/* ── 分栏通用卡片 ─────────────────────────────────────────────────── */
.detail-section {
    background: #fff;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d2129;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-hdr-btns { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ── 统一操作按钮（编辑 / 保存 / 上传 / 添加关联）── */
.section-edit-btn,
.section-save-btn,
.att-upload-btn,
.btn-rel-edit {
    font-size: 13px;
    color: #165dff;
    background: #e8f3ff;
    border: none;
    border-radius: 4px;
    padding: 4px 12px;
    cursor: pointer;
    transition: background .12s;
    white-space: nowrap;
    line-height: 1.5;
}
.section-edit-btn:hover,
.section-save-btn:hover,
.att-upload-btn:hover,
.btn-rel-edit:hover { background: #cfe0ff; }

/* 取消按钮 — 次要操作，低视觉权重 */
.section-cancel-btn {
    font-size: 13px;
    color: #86909c;
    background: transparent;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    transition: color .12s;
    line-height: 1.5;
}
.section-cancel-btn:hover { color: #1d2129; }

/* ── 分栏内 doc-meta 去掉原有的 margin/border（由 detail-section 承载） ── */
.detail-section .doc-meta {
    border: none;
    padding: 0;
    margin-bottom: 0;
    background: transparent;
}

/* Doc content — Markdown 渲染区 */
.doc-content {
    background: transparent;
    min-height: 60px;
    font-size: 14px;
    line-height: 1.7;
    color: #1d2129;
}
.doc-content h1 { font-size: 22px; font-weight: 700; margin: 20px 0 10px; }
.doc-content h2 { font-size: 18px; font-weight: 600; margin: 18px 0 8px; border-bottom: 1px solid #e5e6eb; padding-bottom: 4px; }
.doc-content h3 { font-size: 15px; font-weight: 600; margin: 14px 0 6px; }
.doc-content p  { margin-bottom: 10px; }
.doc-content ul, .doc-content ol { margin: 0 0 10px 24px; }
.doc-content li { margin-bottom: 4px; }
.doc-content a  { color: #165dff; text-decoration: none; }
.doc-content a:hover { text-decoration: underline; }
.doc-content strong { font-weight: 600; }
.doc-content em { font-style: italic; }
.doc-content code {
    background: #f2f3f5; border-radius: 3px;
    padding: 1px 5px; font-family: monospace; font-size: 13px;
}
.doc-content pre {
    background: #f2f3f5; border-radius: 6px; padding: 14px 16px;
    overflow-x: auto; margin-bottom: 12px;
}
.doc-content pre code { background: none; padding: 0; font-size: 13px; }
.doc-content blockquote {
    border-left: 3px solid #c9cdd4; margin: 0 0 10px;
    padding: 4px 16px; color: #86909c;
}
/* 表格 */
.doc-content table {
    border-collapse: collapse; width: 100%; margin-bottom: 14px; font-size: 13px;
}
.doc-content th, .doc-content td {
    border: 1px solid #e5e6eb; padding: 7px 12px; text-align: left;
}
.doc-content th { background: #f7f8fa; font-weight: 600; }
.doc-content tr:nth-child(even) { background: #fafafa; }
.doc-content hr { border: none; border-top: 1px solid #e5e6eb; margin: 16px 0; }
.doc-content .empty { color: #c9cdd4; text-align: center; padding: 32px; }

/* 回复区 Markdown 渲染 */
.comment-content h1,.comment-content h2,.comment-content h3 { font-size:14px; font-weight:600; margin:6px 0 4px; }
.comment-content p { margin-bottom:6px; }
.comment-content a { color:#165dff; }
.comment-content code { background:#f2f3f5; padding:1px 4px; border-radius:3px; font-size:12px; }
.comment-content table { border-collapse:collapse; font-size:12px; margin-bottom:8px; }
.comment-content th,.comment-content td { border:1px solid #e5e6eb; padding:4px 8px; }
.comment-content th { background:#f7f8fa; }

/* EasyMDE 样式修正 */
.EasyMDEContainer { border-radius: 6px; overflow: hidden; }
.CodeMirror { font-family: inherit; font-size: 14px; min-height: 200px; }
.editor-toolbar { border-radius: 6px 6px 0 0; }
.editor-preview { font-size: 14px; line-height: 1.7; }
.editor-preview table { border-collapse: collapse; width: 100%; }
.editor-preview th, .editor-preview td { border: 1px solid #e5e6eb; padding: 6px 10px; }
.editor-preview th { background: #f7f8fa; }

/* Relations */
.relation-section { margin-bottom: 24px; }
.relation-section h3 { font-size: 16px; margin-bottom: 12px; color: #4e5969; }
.relation-table { background: #fff; border-radius: 8px; border: 1px solid #e5e6eb; overflow: hidden; width: 100%; }
.relation-table th { background: #f7f8fa; text-align: left; padding: 8px 16px; font-size: 13px; color: #86909c; }
.relation-table td { padding: 8px 16px; border-bottom: 1px solid #f2f3f5; font-size: 14px; }

/* Form */
.doc-form { max-width: 800px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; color: #4e5969; }
.form-group input, .form-group select { width: 100%; padding: 8px 12px; border: 1px solid #e5e6eb; border-radius: 4px; font-size: 14px; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #165dff; box-shadow: 0 0 0 2px rgba(22,93,255,0.1); }
#editor { border: 1px solid #e5e6eb; border-radius: 6px; padding: 16px; min-height: 300px; background: #fff; }
#editor:focus-within { border-color: #165dff; box-shadow: 0 0 0 2px rgba(22,93,255,0.1); }
#editor .ProseMirror { outline: none; }
.content-textarea {
    width: 100%;
    min-height: 300px;
    padding: 14px 16px;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.7;
    font-family: inherit;
    resize: vertical;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.content-textarea:focus {
    outline: none;
    border-color: #165dff;
    box-shadow: 0 0 0 2px rgba(22,93,255,0.1);
}
.form-actions { display: flex; gap: 8px; margin-top: 24px; }

/* ── 追溯树通用样式（追溯图、文档详情共用） ── */
.tree-panel {
  background: #fff; border: 1px solid #e5e6eb;
  border-radius: 8px; padding: 20px 24px;
}
.tree-root {
  margin-bottom: 20px; padding-bottom: 20px;
  border-bottom: 1px dashed #e5e6eb;
}
.tree-root:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.tree-line {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 13px; line-height: 1.5;
}
.tree-connector { font-family: monospace; color: #c9cdd4; white-space: pre; flex-shrink: 0; font-size: 13px; }
.tree-rel { font-size: 11px; color: #86909c; background: #f2f3f5; padding: 1px 6px; border-radius: 3px; white-space: nowrap; flex-shrink: 0; }
.tree-title { color: #1d2129; text-decoration: none; font-size: 13px; }
.tree-title:hover { color: #165dff; text-decoration: underline; }
.tree-section { margin-bottom: 24px; }
.tree-section-label { font-size: 13px; font-weight: 600; color: #4e5969; margin-bottom: 10px; }

/* 类型徽章 */
.tb { display:inline-block; padding:1px 7px; border-radius:3px; font-size:12px; font-weight:600; font-family:monospace; white-space:nowrap; flex-shrink:0; }
.tb-REQ    { background:#e8f3ff; color:#165dff; }
.tb-TASK   { background:#fff3e8; color:#e05b00; }
.tb-BUG    { background:#ffe8e8; color:#cb1b1b; }
.tb-TC     { background:#e8fff0; color:#0a7c2e; }
.tb-TS     { background:#e8fff0; color:#0a7c2e; }
.tb-TR     { background:#e8fff0; color:#0a7c2e; }
.tb-TRPT   { background:#e8fff0; color:#0a7c2e; }

/* tree-id pill */
.tree-id { display:inline-block; padding:1px 8px; border-radius:3px; font-size:12px; font-weight:600; font-family:monospace; white-space:nowrap; flex-shrink:0; background:#f2f3f5; color:#4e5969; }
.tree-id.tb-REQ    { background:#e8f3ff; color:#165dff; }
.tree-id.tb-TASK   { background:#fff3e8; color:#e05b00; }
.tree-id.tb-BUG    { background:#ffe8e8; color:#cb1b1b; }
.tree-id.tb-TC     { background:#e8fff0; color:#0a7c2e; }
.tree-id.tb-TS     { background:#e8fff0; color:#0a7c2e; }
.tree-id.tb-TR     { background:#e8fff0; color:#0a7c2e; }
.tree-id.tb-TRPT   { background:#e8fff0; color:#0a7c2e; }

/* 状态徽章 sb-* */
.sb { display:inline-block; padding:1px 8px; border-radius:10px; font-size:11px; font-weight:500; white-space:nowrap; flex-shrink:0; }
.sb-not_started  { background:#f2f3f5; color:#86909c; }
.sb-review      { background:#fff7e8; color:#b95e00; }
.sb-in_progress { background:#e8f3ff; color:#165dff; }
.sb-done        { background:#e8ffea; color:#007d1a; }
.sb-closed      { background:#f0f0f0; color:#aaa; }
.sb-cancelled   { background:#ffe8e8; color:#d4380d; }

/* 文档详情追溯树 */
.trace-focal {
  display:flex; align-items:center; gap:8px;
  padding: 7px 12px; margin: 6px 0;
  background: #f0f5ff; border: 1.5px solid #165dff;
  border-radius: 6px; font-size: 13px;
}
.trace-focal .tree-title { font-weight: 600; color:#1d2129; }
.current-tag {
  font-size:11px; background:#165dff; color:#fff;
  padding:1px 7px; border-radius:3px; flex-shrink:0;
}
.trace-divider {
  border: none; border-top: 1px dashed #e5e6eb; margin: 6px 0;
}
.trace-parent-line {
  display:flex; align-items:center; gap:8px;
  padding: 3px 0; font-size: 13px; opacity: .82;
}
.trace-parent-arrow { color:#c9cdd4; font-size:12px; flex-shrink:0; }

/* Sidebar extras */
.sidebar-section-label { padding: 12px 20px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #c9cdd4; font-weight: 600; }
.sidebar-divider { margin: 8px 20px; border-top: 1px solid #e5e6eb; }
.nav-item-flow { color: #165dff; font-weight: 500; }
.nav-item-flow:hover { background: #e8f3ff; }

/* ── 侧边栏品牌 Logo ── */
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 16px 12px; margin-bottom: 8px; border-bottom: 1px solid #e5e6eb; }
.sidebar-logo { width: 32px; height: 32px; flex-shrink: 0; }
.sidebar-brand-name { font-size: 18px; font-weight: 700; color: #8B5A2B; letter-spacing: 0.5px; }

/* ── 侧边栏版权信息（底部固定） ── */
.sidebar-footer { margin-top: auto; padding: 12px 16px 8px; border-top: 1px solid #e5e6eb; text-align: center; }
.sidebar-copyright { font-size: 11px; color: #c9cdd4; line-height: 1.4; display: block; }

/* ── 侧边栏用户信息（底部固定） ── */
.sidebar-user {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-top: 1px solid #e5e6eb;
    background: #fff;
    padding: 0;
}
.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background .12s;
}
.sidebar-user-info:hover {
    background: #f2f3f5;
}
.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #165dff;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-user-name {
    font-size: 14px;
    font-weight: 500;
    color: #1d2129;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e6eb;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,.08);
    z-index: 100;
    overflow: hidden;
}
.sidebar-user-menu.open {
    display: block;
}
.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    color: #4e5969;
    cursor: pointer;
    transition: background .12s;
    text-decoration: none;
}
.sidebar-menu-item:hover {
    background: #f2f3f5;
    color: #165dff;
    text-decoration: none;
}
.sidebar-menu-item button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 13px;
    color: #4e5969;
}
.sidebar-menu-item button:hover {
    color: #cb1b1b;
}
.sidebar-menu-item .menu-icon {
    width: 16px;
    text-align: center;
    font-size: 13px;
    flex-shrink: 0;
}
.sidebar-menu-form {
    margin: 0;
}
.sidebar-menu-divider {
    border-top: 1px solid #e5e6eb;
    margin: 0;
}

/* Messages */
.messages { margin-bottom: 16px; }
.message { padding: 10px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 8px; }
.message.error { background: #ffece8; color: #d4380d; }
.message.success { background: #e8ffea; color: #00b42a; }
.message.warning { background: #fff7e8; color: #ff7d00; }

/* ── 项目切换器 ──────────────────────────────────────────────────── */
.project-switcher { position: relative; padding: 0 16px 12px; border-bottom: 1px solid #e5e6eb; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.project-name { display: block; flex: 1; font-size: 15px; font-weight: 700; color: #1d2129; padding: 0; border: none; margin: 0; }
.project-name:hover { text-decoration: none; color: #165dff; }
.switcher-arrow { font-size: 12px; color: #86909c; user-select: none; }
.switcher-menu { display: none; position: absolute; top: 100%; left: 8px; right: 8px; background: #fff; border: 1px solid #e5e6eb; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 100; overflow: hidden; padding-top: 4px; }
.project-switcher:hover .switcher-menu,
.switcher-menu:hover { display: block; }
.switcher-item { display: flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 13px; color: #4e5969; }
.switcher-item:hover { background: #f2f3f5; text-decoration: none; color: #165dff; }
.switcher-item.active { background: #e8f3ff; color: #165dff; font-weight: 500; }
.switcher-divider { border-top: 1px solid #e5e6eb; margin: 4px 0; }
.switcher-create { color: #165dff; font-weight: 600; }
.switcher-create:hover { background: #f0f5ff; }
.switcher-create .nav-icon { display: inline-block; width: 16px; text-align: center; margin-right: 6px; }
.proj-code-tag { display: inline-block; background: #f2f3f5; color: #4e5969; border-radius: 3px; padding: 1px 6px; font-size: 11px; font-family: monospace; font-weight: 600; }

/* ── 团队成员（角色标签，成员页和侧边栏共用）──────────────────────── */
.member-role-tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 3px; }
.role-proj-admin { background: #fff3e8; color: #d4380d; font-weight: 600; }
.role-member { background: #f2f3f5; color: #86909c; }
.member-type-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 2px 7px; border-radius: 3px; font-family: monospace; font-weight: 600; cursor: default; }
.type-tag-worker { background: #e8f3ff; color: #165dff; }
.type-tag-admin  { background: #fff7e8; color: #ff7d00; }
.type-role-label { font-family: sans-serif; font-weight: 400; font-size: 10px; }

/* ── 成员页 ───────────────────────────────────────────────────────── */
.member-header-actions { display: flex; gap: 8px; align-items: center; }
#toggle-edit-btn.btn-active { background: #165dff; color: #fff; border-color: #165dff; }

/* 角色下拉框 */
.member-role-select { border: 1px solid #e5e6eb; border-radius: 4px; padding: 2px 6px; font-size: 12px; min-width: 100px; background: #fff; }

/* 类型权限编辑器 */
.type-perm-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.type-perm-item { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.type-perm-code { font-family: monospace; font-weight: 600; color: #1d2129; min-width: 50px; flex-shrink: 0; text-align: right; }
.type-perm-select { border: 1px solid #e5e6eb; border-radius: 4px; padding: 1px 4px; font-size: 11px; background: #fff; }

/* 添加成员表单 */
.member-add-form { margin-bottom: 16px; }
.member-add-inner { display: flex; gap: 8px; align-items: center; background: #f7f8fa; border: 1px solid #e5e6eb; border-radius: 6px; padding: 10px 14px; }
.member-add-select { border: 1px solid #e5e6eb; border-radius: 4px; padding: 5px 8px; font-size: 13px; min-width: 180px; background: #fff; }

/* 提示消息 */
.toast-msg { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: rgba(0,0,0,0.75); color: #fff; padding: 8px 20px; border-radius: 6px; font-size: 13px; opacity: 0; transition: all 0.2s ease; pointer-events: none; z-index: 9999; }
.toast-msg.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 成员页卡片网格 ───────────────────────────────────────────────── */
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.member-card { background: #fff; border: 1px solid #e5e6eb; border-radius: 8px; padding: 20px; display: flex; gap: 14px; align-items: flex-start; }
.member-card-avatar { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; background: #165dff; color: #fff; font-size: 18px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.member-card-body { flex: 1; min-width: 0; }
.member-card-name { font-size: 15px; font-weight: 600; color: #1d2129; }
.member-card-email { font-size: 12px; color: #86909c; margin-bottom: 8px; }
.member-card-roles { display: flex; flex-wrap: wrap; gap: 5px; }
.member-card-type-perms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

/* 侧边栏成员入口链接 */
.nav-item-members { color: #4e5969; }
.nav-item-members:hover { background: #f2f3f5; color: #165dff; text-decoration: none; }

/* 删除按钮 */
.btn-danger { background: #fff2f0; color: #d4380d; border-color: #ffccc7; }
.btn-danger:hover { background: #d4380d; color: #fff; }

/* ── 操作历史区块 ────────────────────────────────────────────────── */
.history-section {
    margin-top: 32px;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.history-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #4e5969;
    background: #f7f8fa;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}
.history-toggle:hover { background: #e8eaf0; }
.history-toggle-icon { font-size: 11px; color: #86909c; }
.history-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: #86909c;
    background: #e5e6eb;
    padding: 1px 8px;
    border-radius: 9px;
}
.history-body { padding: 0 18px 16px; }
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 12px;
}
.history-table th {
    text-align: left;
    color: #86909c;
    font-weight: 600;
    padding: 6px 10px;
    border-bottom: 1px solid #e5e6eb;
}
.history-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f1f4;
    vertical-align: top;
}
.history-table tr:last-child td { border-bottom: none; }
.history-time { font-family: monospace; color: #86909c; white-space: nowrap; }
.history-action-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}
.action-created      { background: #e8ffea; color: #00b42a; }
.action-updated      { background: #e8f3ff; color: #165dff; }
.action-status_changed { background: #fff7e8; color: #ff7d00; }
.history-detail { display: inline-block; margin-right: 10px; }
.history-old { text-decoration: line-through; color: #86909c; }
.history-new { color: #165dff; font-weight: 600; }

/* ── 编辑表单行布局 ─────────────────────────────────────────────────── */
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.form-row .form-group {
    flex: 1;
    min-width: 160px;
}

/* ── 关联制品编辑区 ──────────────────────────────────────────────────────── */
.rel-section {
    /* 卡片样式由 .detail-section 提供 */
}
.rel-section-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px;
}
.rel-section-title { font-size: 14px; font-weight: 600; color: #1d2129; margin: 0; }


.rel-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 6px 4px; border-bottom: 1px solid #f2f3f5;
}
.rel-row:last-child { border-bottom: none; }
.rel-focal-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 8px 4px; background: #f7f8fa; border-radius: 4px; margin: 4px 0;
}
.rel-direction-tag {
    font-size: 11px; padding: 1px 7px; border-radius: 3px; white-space: nowrap;
}
.rel-out { background: #e8f3ff; color: #165dff; }
.rel-in  { background: #fff3e8; color: #b85c00; }

.rel-del-btn {
    margin-left: auto; flex-shrink: 0;
    font-size: 12px; color: #cb1b1b; background: none;
    border: 1px solid #ffcdd2; border-radius: 4px;
    padding: 2px 8px; cursor: pointer; transition: all .12s;
}
.rel-del-btn:hover { background: #ffebee; }
.rel-empty { color: #c9cdd4; font-size: 13px; text-align: center; padding: 16px 0; margin: 0; }

/* 添加关联表单 */
.rel-add-form {
    margin-top: 12px; padding-top: 12px;
    border-top: 1px dashed #e5e6eb;
    display: flex; flex-direction: column; gap: 10px;
}
.rel-allowed-hint {
    display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap;
    background: #f7f8fa; border-radius: 6px; padding: 8px 12px;
    font-size: 12px;
}
.rel-hint-label { color: #86909c; white-space: nowrap; padding-top: 2px; }
.rel-hint-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: #fff; border: 1px solid #e5e6eb; border-radius: 4px;
    padding: 2px 8px 2px 4px;
}
.rel-hint-desc { color: #4e5969; }
.rel-hint-none { color: #86909c; font-style: italic; }
.rel-search-wrap { position: relative; }
.rel-search-input {
    width: 100%; box-sizing: border-box;
    font-size: 13px; border: 1px solid #e5e6eb; border-radius: 4px;
    padding: 5px 10px; outline: none; transition: border-color .15s;
}
.rel-search-input:focus { border-color: #165dff; }
.rel-search-results {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
    background: #fff; border: 1px solid #e5e6eb; border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1); max-height: 240px; overflow-y: auto;
}
.rel-search-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer; font-size: 13px;
}
.rel-search-item:hover { background: #f2f3f5; }
.rel-no-result { color: #86909c; cursor: default; }
.rel-search-title { color: #1d2129; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-selected-wrap {
    font-size: 13px; color: #4e5969;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #f7f8fa; border-radius: 6px; padding: 8px 12px;
}
.rel-selected-label { display: flex; align-items: center; gap: 6px; }
.btn-link { background: none; border: none; color: #165dff; cursor: pointer; font-size: 12px; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* ── 附件面板 ─────────────────────────────────────────────────────────────── */
.att-section {
    /* 卡片样式由 .detail-section 提供 */
    transition: box-shadow .3s;
}
.att-section-highlight { box-shadow: 0 0 0 3px #cfe0ff; }
.att-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.att-title { font-size: 14px; font-weight: 600; color: #1d2129; margin: 0; display: flex; align-items: center; gap: 8px; }
.att-count { font-size: 12px; background: #f2f3f5; color: #86909c; padding: 1px 8px; border-radius: 10px; }
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 6px; background: #fafafa;
    border: 1px solid #f0f0f0;
}
.att-item:hover { background: #f5f7fa; }
.att-icon {
    width: 36px; height: 36px; border-radius: 4px;
    background: #e8f3ff; color: #165dff;
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-family: monospace;
}
.att-info { flex: 1; min-width: 0; }
.att-name { font-size: 13px; font-weight: 500; color: #1d2129; text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-name:hover { color: #165dff; text-decoration: underline; }
.att-meta { font-size: 11px; color: #86909c; }
.att-ref-btn {
    flex-shrink: 0; font-size: 12px; padding: 3px 10px;
    background: #fff; border: 1px solid #c9cdd4; border-radius: 4px;
    cursor: pointer; color: #4e5969; transition: all .12s;
}
.att-ref-btn:hover { background: #165dff; color: #fff; border-color: #165dff; }
.att-empty { color: #c9cdd4; font-size: 13px; text-align: center; padding: 16px 0; margin: 0; }
/* 附件图片预览 */
.att-img-wrap { display: block; flex-shrink: 0; }
.att-img-preview {
    width: 64px; height: 64px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e6eb;
    cursor: pointer;
    transition: transform .15s;
}
.att-img-preview:hover { transform: scale(1.06); }

/* doc-content / comment-content 内的图片以缩略图形式显示 */
.doc-content img, .comment-content img {
    height: 180px;
    max-width: 300px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e6eb;
    margin: 4px;
    vertical-align: middle;
    cursor: zoom-in;
    transition: opacity .15s, transform .15s, box-shadow .15s;
    display: inline-block;
}
.doc-content img:hover, .comment-content img:hover {
    opacity: .9;
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

/* ── 图片灯箱 ── */
.img-lightbox-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.78);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity .2s;
}
.img-lightbox-overlay.open {
    opacity: 1; pointer-events: auto;
}
.img-lightbox-inner {
    position: relative;
    max-width: 90vw; max-height: 90vh;
    display: flex; align-items: center; justify-content: center;
}
.img-lightbox-inner img {
    max-width: 90vw !important;
    max-height: 88vh !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 8px;
    box-shadow: 0 8px 48px rgba(0,0,0,.5);
    cursor: default;
    border: none;
    margin: 0;
    transform: none !important;
}
.img-lightbox-close {
    position: absolute;
    top: -14px; right: -14px;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #fff;
    border: none;
    font-size: 18px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    color: #1d2129;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    z-index: 1;
    transition: background .12s;
    padding: 0;
}
.img-lightbox-close:hover { background: #f2f3f5; }
.img-lightbox-caption {
    position: absolute;
    bottom: -32px; left: 0; right: 0;
    text-align: center;
    color: rgba(255,255,255,.7);
    font-size: 12px;
}

/* Mermaid 图表容器 */
.doc-content .mermaid, .comment-content .mermaid {
    background: #f7f8fa;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    overflow-x: auto;
    text-align: center;
}

/* Toast 提示 */
.toast-msg {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: #1d2129;
    color: #fff;
    font-size: 13px;
    padding: 8px 20px;
    border-radius: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 9999;
    white-space: nowrap;
}
.toast-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.att-hint {
    margin-top: 12px; font-size: 12px; color: #86909c;
    background: #f7f8fa; border-radius: 4px; padding: 8px 12px;
}
.att-hint code { background: #e5e6eb; padding: 1px 5px; border-radius: 3px; font-size: 11px; }

/* 内联内容工具栏 */
.inline-content-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.att-insert-hint {
    font-size: 12px; color: #165dff; background: none; border: none;
    cursor: pointer; padding: 2px 6px; border-radius: 4px;
    transition: background .12s;
}
.att-insert-hint:hover { background: #e8f3ff; }

/* 引用链接渲染 */
.att-ref-link { color: #165dff; text-decoration: none; border-bottom: 1px dashed #99c0ff; }
.att-ref-link:hover { text-decoration: underline; }

/* ── 回复 / 进度更新 ───────────────────────────────────────────────────── */
.comments-section {
    /* 卡片样式由 .detail-section 提供 */
}
.comments-title {
    font-size: 15px; font-weight: 600; color: #1d2129;
    margin: 0 0 16px; display: flex; align-items: center; gap: 8px;
}
.comments-count {
    font-size: 12px; font-weight: 500; color: #86909c;
    background: #f2f3f5; border-radius: 10px; padding: 1px 8px;
}
.comments-list { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.comment-item {
    display: flex; gap: 12px; align-items: flex-start;
}
.comment-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: #165dff; color: #fff;
    font-size: 13px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-header {
    display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px;
}
.comment-author { font-size: 13px; font-weight: 600; color: #1d2129; }
.comment-time   { font-size: 12px; color: #86909c; }
.comment-content {
    font-size: 14px; line-height: 1.65; color: #3a3a3a;
    white-space: pre-wrap; word-break: break-word;
}
/* 输入区 */
.comment-form { border-top: 1px solid #f2f3f5; padding-top: 16px; }
.comment-input-row { display: flex; gap: 12px; align-items: flex-start; }
.comment-input-wrap { flex: 1; min-width: 0; }
.comment-textarea {
    width: 100%; box-sizing: border-box;
    min-height: 72px; resize: vertical;
    font-size: 14px; line-height: 1.6; font-family: inherit;
    border: 1px solid #e5e6eb; border-radius: 6px;
    padding: 10px 14px; outline: none; color: #1d2129;
    transition: border-color .15s;
}
.comment-textarea:focus { border-color: #165dff; }
.comment-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.comment-hint { font-size: 11px; color: #c2c7ce; flex: 1; }
/* ── 管理页面选项卡 ─────────────────────────────────────────────────── */
.flow-tabs { display:flex; gap:0; margin-bottom:0; border-bottom:2px solid #e5e6eb; }
.flow-tab { padding:8px 24px; font-size:14px; font-weight:500; color:#86909c; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; user-select:none; text-decoration:none; display:inline-block; }
.flow-tab.active { color:#165dff; border-bottom-color:#165dff; }
.flow-tab:hover { color:#165dff; text-decoration:none; }

/* ── 流转图 ──────────────────────────────────────────────────────────── */
.flow-timeline-section {
    margin-top: 32px;
}
.flow-timeline-title {
    font-size: 15px;
    font-weight: 700;
    color: #1d2129;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e6eb;
}
.flow-timeline {
    position: relative;
    padding-left: 28px;
}
.flow-timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 12px;
    bottom: 12px;
    width: 2px;
    background: #e5e6eb;
}
.ft-node {
    position: relative;
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
    align-items: flex-start;
}
.ft-dot {
    position: absolute;
    left: -23px;
    top: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    flex-shrink: 0;
}
.ft-dot-created       { background: #00b42a; }
.ft-dot-updated       { background: #165dff; }
.ft-dot-status_changed { background: #ff7d00; }
.ft-card {
    flex: 1;
    background: #f7f8fa;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    padding: 10px 14px;
}
.ft-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.ft-action-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}
.ft-time { font-size: 12px; color: #86909c; font-family: monospace; }
.ft-by   { font-size: 12px; color: #4e5969; }
.ft-card-body {
    font-size: 13px;
    color: #4e5969;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}
.ft-field    { color: #86909c; font-size: 12px; }
.ft-val-old  { text-decoration: line-through; color: #86909c; }
.ft-val-new  { color: #165dff; font-weight: 600; }
.ft-arrow    { color: #c9cdd4; }
.ft-sep      { color: #c9cdd4; margin: 0 4px; }

/* ── 历史记录按钮 ────────────────────────────────────────────────── */
.btn-history {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f7f8fa;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    font-size: 13px;
    color: #4e5969;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.btn-history:hover { background: #e8eaf0; border-color: #c9cdd4; }
.btn-history-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #165dff;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
}

/* ── 历史抽屉遮罩 ────────────────────────────────────────────────── */
.history-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.18);
    z-index: 400;
}
.history-overlay.open { display: block; }

/* ── 历史抽屉本体 ────────────────────────────────────────────────── */
.history-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    z-index: 401;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.history-drawer.open { transform: translateX(0); }

.history-drawer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 16px;
    border-bottom: 1px solid #e5e6eb;
    flex-shrink: 0;
}
.history-drawer-title {
    font-size: 16px;
    font-weight: 700;
    color: #1d2129;
    flex: 1;
}
.history-drawer-count {
    font-size: 12px;
    color: #86909c;
    background: #f2f3f5;
    padding: 2px 8px;
    border-radius: 9px;
}
.history-drawer-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #86909c;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
}
.history-drawer-close:hover { background: #f2f3f5; color: #1d2129; }

.history-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px 24px;
}

/* ── 抽屉内每条历史 ─────────────────────────────────────────────── */
.hd-item {
    padding: 12px 0;
    border-bottom: 1px solid #f2f3f5;
}
.hd-item:last-child { border-bottom: none; }
.hd-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.hd-time {
    font-size: 12px;
    font-family: monospace;
    color: #86909c;
    margin-left: auto;
}
.hd-item-by {
    font-size: 12px;
    color: #4e5969;
    margin-bottom: 6px;
}
.hd-item-detail {
    font-size: 13px;
    color: #4e5969;
    line-height: 1.6;
}
.hd-change {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 2px;
}
.hd-field { color: #86909c; font-size: 12px; }
.hd-old   { text-decoration: line-through; color: #86909c; }
.hd-new   { color: #165dff; font-weight: 600; }
.hd-arrow { color: #c9cdd4; }

/* ── 统一工具页标题（追溯图 / 甘特图 / 项目成员） ───────────────────── */
.project-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.project-page-header-left { display: flex; align-items: baseline; gap: 12px; }
/* Manage page: hide category/milestone action buttons until edit mode is toggled on */
.cat-actions,
.ms-actions { display: none; }
.project-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1d2129;
    margin: 0;
}
.project-page-subtitle {
    font-size: 13px;
    color: #86909c;
}

/* ── 项目首页 Dashboard ── */
.dashboard-section { margin-bottom: 24px; }
.dashboard-section-title {
    font-size: 16px; font-weight: 600; color: #1d2129;
    margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #f2f3f5;
}
.chart-card {
    background: #fff;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    padding: 16px 20px;
}
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
}
.chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}
.pie-wrapper {
    max-width: 280px;
    height: 200px;
}
.chart-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px; flex-wrap: wrap; gap: 8px;
}
.chart-title { font-size: 14px; font-weight: 600; color: #1d2129; margin: 0; }
.chart-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.chart-period-group { display: flex; align-items: center; gap: 8px; }
.chart-period-label {
    font-size: 12px; color: #4e5969; cursor: pointer;
    padding: 3px 10px; border: 1px solid #e5e6eb; border-radius: 4px;
    background: #fff; transition: background 0.15s, border-color 0.15s;
}
.chart-period-label:has(input:checked) {
    background: #f0f5ff; border-color: #165dff; color: #165dff;
}
.chart-period-label input { display: none; }
.chart-toggles { display: flex; align-items: center; gap: 10px; }
.chart-toggle {
    font-size: 12px; color: #4e5969; cursor: pointer;
    display: flex; align-items: center; gap: 4px;
}
.chart-toggle input { accent-color: #165dff; }
.pie-charts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}
.pie-chart-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 280px;
    flex-shrink: 0;
}
.pie-chart-card canvas {
    width: 100% !important;
}
.pie-wrapper {
    width: 280px;
    height: 200px;
}
.pie-chart-title {
    font-size: 13px; font-weight: 600; color: #4e5969;
    margin: 0 0 8px; padding: 0; border: 0;
}

.dashboard-section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #f2f3f5;
    flex-wrap: wrap; gap: 8px;
}
.dashboard-section-header .dashboard-section-title { margin: 0; padding: 0; border: 0; }
.dashboard-filters { display: flex; align-items: center; gap: 8px; }
.dashboard-filter-form { display: flex; align-items: center; gap: 8px; }
.dashboard-filter-select {
    border: 1px solid #e5e6eb; border-radius: 4px;
    padding: 5px 10px; font-size: 13px; background: #fff;
}
.btn-dashboard-filter {
    font-size: 12px; padding: 5px 12px;
    border: 1px solid #e5e6eb; border-radius: 4px;
    background: #fff; color: #4e5969; cursor: pointer;
    text-decoration: none; transition: all .12s;
}
.btn-dashboard-filter:hover { background: #f2f3f5; text-decoration: none; }
.btn-dashboard-filter.active { background: #165dff; color: #fff; border-color: #165dff; }

.dashboard-my-items { display: flex; flex-direction: column; gap: 16px; }
.my-items-panel { background: #fff; border: 1px solid #e5e6eb; border-radius: 8px; padding: 16px 20px; }
.my-items-title {
    font-size: 14px; font-weight: 600; color: #1d2129;
    margin: 0 0 12px; display: flex; align-items: center; gap: 8px;
}
.my-items-count {
    font-size: 12px; font-weight: 400; color: #86909c;
    background: #f2f3f5; padding: 1px 8px; border-radius: 10px;
}
.my-items-table { width: 100%; border-collapse: collapse; }
.my-items-table th {
    background: #f7f8fa; text-align: left; padding: 8px 12px;
    font-size: 12px; color: #86909c; font-weight: 500;
    border-bottom: 1px solid #e5e6eb;
}
.my-items-table td {
    padding: 8px 12px; border-bottom: 1px solid #f2f3f5; font-size: 13px;
}
.my-items-table tr:last-child td { border-bottom: none; }
.my-items-table a { color: #1d2129; text-decoration: none; }
.my-items-table a:hover { color: #165dff; text-decoration: underline; }
.my-items-empty {
    text-align: center; color: #c9cdd4; font-size: 13px; padding: 16px 0; margin: 0;
}

@media (max-width: 1024px) {
    /* responsive adjustments */
}

/* ── 侧边栏工具入口（追溯图 / 甘特图 / 项目成员统一样式） ─────────────── */
.nav-item-tool { color: #4e5969; }
.nav-item-tool:hover { background: #f2f3f5; color: #165dff; text-decoration: none; }

/* 图标区：固定宽度 + 居中，确保所有图标垂直与文字对齐 */
.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    font-size: 13px;
    line-height: 1;
    flex-shrink: 0;
    color: #86909c;
}
.nav-item-tool:hover .nav-icon { color: #165dff; }

/* ── 甘特图工具栏 ──────────────────────────────────────────────── */
.gantt-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* 计划/实际 开关 */
.gantt-toggle-group { display: flex; gap: 0; border: 1px solid #e5e6eb; border-radius: 6px; overflow: hidden; }
.gantt-toggle-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 14px; font-size: 13px;
    background: #fff; border: none; border-right: 1px solid #e5e6eb;
    cursor: pointer; transition: background .12s, color .12s;
    /* 默认：关闭态 */
    color: #c9cdd4;
}
.gantt-toggle-btn:last-child { border-right: none; }
/* 开启态 */
.gantt-toggle-btn.active {
    background: #f0f5ff;
    color: #1d2129;
    font-weight: 600;
}
.gantt-toggle-btn:hover { background: #f2f3f5; }
.gantt-toggle-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.dot-plan   { background: #722ed1; }
.dot-actual { background: #165dff; }

/* ── 甘特图缩放切换按钮 ─────────────────────────────────────────── */
.gantt-zoom-bar {
    display: flex;
    gap: 0;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    overflow: hidden;
}
.gantt-zoom-btn {
    padding: 5px 16px;
    font-size: 13px;
    color: #4e5969;
    background: #fff;
    text-decoration: none;
    border-right: 1px solid #e5e6eb;
    transition: background .12s, color .12s;
}
.gantt-zoom-btn:last-child { border-right: none; }
.gantt-zoom-btn:hover { background: #f2f3f5; }
.gantt-zoom-btn.active { background: #165dff; color: #fff; font-weight: 600; }

.gantt-filter-select {
    padding: 4px 8px;
    font-size: 13px;
    height: 28px;
    color: #4e5969;
    background: #fff;
    border: 1px solid #e5e6eb;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}
.gantt-filter-select:hover { border-color: #4080ff; }

/* ── 甘特图整体容器（单一滚动区）─────────────────────────────────── */
:root { --gantt-lcol-w: 260px; }

.gantt-container {
    border: 1px solid #e5e6eb;
    border-radius: 10px;
    overflow: auto;              /* 同时管理 x / y 滚动 */
    max-height: calc(100vh - 180px); /* 自身高度受限，水平条始终在视口内 */
    background: #fff;
    position: relative;
    max-width: 100%;
}

/* 刻度头行 */
.gantt-ruler-row {
    display: flex;
    align-items: stretch;
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f7f8fa;
    border-bottom: 2px solid #e5e6eb;
    min-width: max-content;
}

/* 分组行 */
.gantt-group-row {
    display: flex;
    align-items: stretch;
    background: #f2f3f5;
    border-top: 1px solid #e5e6eb;
    border-bottom: 1px solid #e5e6eb;
    min-width: max-content;
}

/* 数据行 */
.gantt-data-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #f0f1f4;
    min-width: max-content;
}
.gantt-data-row:last-child { border-bottom: none; }

/* ── 冻结标签列（sticky left）────────────────────────────────────── */
.gantt-lcol {
    position: sticky;
    left: 0;
    z-index: 10;
    width: var(--gantt-lcol-w);
    min-width: var(--gantt-lcol-w);
    flex-shrink: 0;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-right: 1px solid #e5e6eb;
    font-size: 13px;
    color: #4e5969;
    overflow: hidden;
    box-sizing: border-box;
}

/* 角落（ruler行 + label列）最高层级 */
.gantt-corner {
    z-index: 21;
    background: #f7f8fa;
}
.gantt-corner-label { font-size: 11px; color: #86909c; }

/* 分组列 */
.gantt-lcol-group {
    background: #f2f3f5;
    padding: 6px 14px;
    gap: 8px;
}
.gantt-lcol-group .tree-id { font-size: 11px; }

/* 数据行 label */
.gantt-data-row .gantt-lcol {
    background: #fff;
    padding: 6px 14px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
}

/* item 链接 */
.gantt-item-link {
    display: flex; flex-direction: column; gap: 1px;
    text-decoration: none; width: 100%; overflow: hidden;
}
.gantt-item-link:hover .gantt-item-title { color: #165dff; }
/* .gantt-item-id 已废弃，ID 改用 .tree-id.tb-* 统一样式 */
.gantt-item-link .tree-id { font-size: 11px; line-height: 1.3; }
.gantt-item-title {
    font-size: 12px; color: #1d2129;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 230px; transition: color .15s;
}

/* 类型徽章 */
.gantt-type-name  { font-size: 13px; font-weight: 600; color: #1d2129; }
.gantt-type-count {
    font-size: 11px; color: #86909c; background: #e5e6eb;
    padding: 1px 7px; border-radius: 9px; margin-left: auto;
}

/* ── 轨道区（像素定位）─────────────────────────────────────────────── */
.gantt-track {
    position: relative;
    flex-shrink: 0;
    /* 高度由内容（ruler/bars）撑开 */
}
.gantt-ruler-row  .gantt-track { height: 40px; }
.gantt-group-row  .gantt-track { height: 32px; }
.gantt-data-row   .gantt-track { min-height: 52px; }

/* 刻度 */
.gantt-tick {
    position: absolute; top: 0; bottom: 0;
    display: flex; flex-direction: column;
    align-items: flex-start; justify-content: center;
    padding-left: 4px;
    border-left: 1px solid #e5e6eb;
}
.gantt-tick-weekend { border-left-color: #ffccc7; background: rgba(255,204,199,.08); }
.gantt-tick-label   { font-size: 11px; color: #86909c; white-space: nowrap; line-height: 1.2; }
.gantt-tick-day     { font-size: 10px; color: #c9cdd4; line-height: 1; }

/* 网格线 */
.gantt-grid {
    position: absolute; top: 0; bottom: 0;
    width: 1px; background: #f0f1f4; pointer-events: none;
}
.gantt-grid-weekend { background: rgba(255,204,199,.5); }

/* 进度条 */
.gantt-bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    overflow: hidden;
    cursor: default;
    transition: filter .15s;
    min-width: 6px;
    box-sizing: border-box;
}
.gantt-bar:hover { filter: brightness(.92); }
.gantt-bar-label { font-size: 10px; font-weight: 600; white-space: nowrap; overflow: hidden; }

.gantt-bar-draft       { background: #e5e6eb; color: #4e5969; }
.gantt-bar-review      { background: #fff7e8; color: #d46b08; border: 1px solid #ffd591; }
.gantt-bar-in_progress { background: #e8f3ff; color: #165dff; border: 1px solid #bedaff; }
.gantt-bar-done        { background: #e8ffea; color: #009a29; border: 1px solid #90e49e; }
.gantt-bar-closed      { background: #f0f0f0; color: #86909c; }
.gantt-bar-cancelled   { background: #fff2f0; color: #d4380d; border: 1px solid #ffd8d4; }

.gantt-bar-ongoing::after {
    content: '';
    position: absolute;
    right: 0; top: 3px; bottom: 3px;
    width: 3px;
    border-radius: 2px;
    background: currentColor;
    opacity: .5;
    animation: gantt-pulse 1.2s ease-in-out infinite;
}
@keyframes gantt-pulse { 0%,100% { opacity: .15; } 50% { opacity: .7; } }

/* 计划条 (上层，紫色) */
.gantt-plan-bar {
    position: absolute;
    top: 4px;
    height: 16px;
    border-radius: 4px;
    background: rgba(114,46,209,.18);
    border: 1.5px solid #722ed1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    box-sizing: border-box;
    z-index: 3;
    min-width: 8px;
    user-select: none;
}
.gantt-plan-bar:active { cursor: grabbing; }
.gantt-plan-empty {
    background: rgba(114,46,209,.06);
    border-style: dashed;
    cursor: grab;
    opacity: .75;
}
.gantt-plan-label {
    font-size: 9px;
    font-weight: 600;
    color: #722ed1;
    padding: 0 4px;
    white-space: nowrap;
    overflow: hidden;
    flex: 1;
    text-align: center;
    pointer-events: none;
}

/* 实际条 (下层) */
.gantt-actual-bar {
    position: absolute;
    bottom: 4px;
    height: 16px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    overflow: hidden;
    cursor: default;
    box-sizing: border-box;
    z-index: 2;
    min-width: 6px;
}

/* 拖拽手柄 */
.gantt-drag-handle {
    flex-shrink: 0;
    width: 10px;
    min-width: 10px;
    height: 100%;
    cursor: ew-resize;
    background: rgba(114,46,209,.2);
    border-radius: 3px;
    transition: background .12s;
    position: relative;
    z-index: 1;
}
.gantt-drag-handle:hover { background: rgba(114,46,209,.5); }
/* 手柄中间三条竖纹提示可拖拽 */
.gantt-drag-handle::after {
    content: '⋮';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 10px;
    color: rgba(114,46,209,.7);
    line-height: 1;
    pointer-events: none;
}

/* 层开关隐藏 */
.layer-hidden { display: none !important; }

/* 拖拽 tooltip */
.gantt-drag-tooltip {
    position: fixed;
    background: #1d2129;
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 5px;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* 今日线 */
.gantt-today-line {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: #165dff;
    z-index: 5;
    pointer-events: none;
}
.gantt-today-label {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 10px;
    font-weight: 700;
    color: #165dff;
    background: #e8f3ff;
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
}

/* 未来区域浅色背景 */
.gantt-future-bg {
    position: absolute;
    top: 0; bottom: 0;
    background: rgba(22,93,255,.03);
    pointer-events: none;
    z-index: 1;
}

/* 空状态 */
.empty-state { text-align: center; padding: 60px 0; color: #86909c; font-size: 14px; }

/* ── 树形列表视图 ──────────────────────────────────────────────────── */
.tree-view {
    background: #fff;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    min-width: max-content;
}

/* 表头 — 与 .doc-table th 一致 */
.tree-header {
    display: flex;
    align-items: center;
    background: #f7f8fa;
    border-bottom: 1px solid #e5e6eb;
    padding: 0;
    font-size: 13px;
    color: #86909c;
    font-weight: 500;
    min-width: max-content;
}

.tree-body {
    display: block;
    min-width: max-content;
}

/* ── 列可见性切换 ── */
/* 树形视图列隐藏 */
.hide-col-category .tree-col-category { display: none; }
.hide-col-milestone .tree-col-milestone { display: none; }
.hide-col-author .tree-col-author { display: none; }
.hide-col-owner .tree-col-owner { display: none; }
.hide-col-assignee .tree-col-assignee { display: none; }
/* 列表视图列隐藏 (nth-child: 1=ID 2=Title 3=Status 4=Category 5=Milestone 6=Author 7=Owner 8=Assignee 9=Created 10=Actions) */
.hide-col-category table col:nth-child(4),
.hide-col-category th:nth-child(4),
.hide-col-category td:nth-child(4) { display: none; }
.hide-col-milestone table col:nth-child(5),
.hide-col-milestone th:nth-child(5),
.hide-col-milestone td:nth-child(5) { display: none; }
.hide-col-author table col:nth-child(6),
.hide-col-author th:nth-child(6),
.hide-col-author td:nth-child(6) { display: none; }
.hide-col-owner table col:nth-child(7),
.hide-col-owner th:nth-child(7),
.hide-col-owner td:nth-child(7) { display: none; }
.hide-col-assignee table col:nth-child(8),
.hide-col-assignee th:nth-child(8),
.hide-col-assignee td:nth-child(8) { display: none; }

/* 列切换下拉面板 */
.col-toggle-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: auto;
}
.col-toggle-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    padding: 8px 0;
    z-index: 100;
    min-width: 160px;
}
.col-toggle-panel.open {
    display: block;
}
.col-toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 13px;
    color: #1d2129;
    cursor: pointer;
    white-space: nowrap;
}
.col-toggle-item:hover {
    background: #f2f3f5;
}
.col-toggle-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #165dff;
}

.tree-loading {
    text-align: center;
    padding: 24px;
    color: #86909c;
    font-size: 14px;
}

.tree-empty {
    text-align: center;
    padding: 48px 0;
    color: #c9cdd4;
    font-size: 14px;
}

/* 树形工具栏（全部展开/收起） */
.tree-toolbar {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin-left: 16px;
}
.tree-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    padding: 5px 10px;
    border: 1px solid #e5e6eb;
    border-radius: 4px;
    background: #fff;
    color: #4e5969;
    cursor: pointer;
    transition: all .12s;
    line-height: 1.5;
    height: 28px;
}

.tree-toolbar-btn:hover {
    background: #f2f3f5;
    color: #165dff;
    border-color: #bedaff;
}

/* 列宽定义 */
.tree-col {
    font-size: 13px;
    color: #86909c;
    padding: 8px 12px;
}
.tree-header .tree-col {
    white-space: nowrap;
    font-weight: 500;
}

/* 树列宽：flex-shrink:0 保证不收缩，min-width 与列表视图对齐，JS autoFitTreeColumns 可扩宽 */
.tree-col-id      { flex-shrink: 0; white-space: nowrap; min-width: 80px; }
.tree-col-title   { flex-shrink: 0; min-width: 400px; }
.tree-col-status  { flex-shrink: 0; min-width: 130px; white-space: nowrap; }
.tree-col-milestone { flex-shrink: 0; min-width: 110px; white-space: nowrap; }
.tree-col-author  { flex-shrink: 0; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-col-owner   { flex-shrink: 0; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-col-created { flex-shrink: 0; min-width: 150px; white-space: nowrap; }
.tree-col-actions { flex-shrink: 0; min-width: 120px; white-space: nowrap; }

/* 行 */
.tree-row {
    display: flex;
    align-items: center;
    transition: background .12s;
    padding: 0;
    min-height: 40px;
    min-width: max-content;
}
.tree-row:hover {
    background: #fafbfc;
}

/* 行内列 — 与 .doc-table td 一致 */
.tree-row .tree-col {
    font-size: 14px;
    font-weight: normal;
    color: #1d2129;
    padding: 8px 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-bottom: 1px solid #f2f3f5;
}
.tree-row .tree-col.tree-col-wrap {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    line-height: 1.5;
    word-break: break-word;
}
.tree-row .tree-col-actions {
    overflow: visible;
    white-space: nowrap;
}
/* 类别和执行人列：与列表视图行为一致（换行、行高自适应） */
.tree-row .tree-col-category,
.tree-row .tree-col-assignee {
    flex-shrink: 1;
    min-width: 120px;
    overflow: visible;
    white-space: normal;
    word-break: break-word;
    line-height: 1.5;
}
.tree-row .tree-col-id {
    overflow: visible;
}

/* ── 树连接线 ── */
.tree-conn {
    display: inline-block;
    width: 20px;
    text-align: center;
    font-family: monospace;
    font-size: 14px;
    color: #d0d5dd;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
    user-select: none;
}
.tree-conn-v {
    color: #d0d5dd;
}
.tree-conn-v-spacer {
    display: inline-block;
    width: 20px;
    color: transparent;
}

/* 叶节点连接线 ├ └ */
.tree-leaf-connector {
    display: inline-block;
    width: 20px;
    text-align: center;
    font-family: monospace;
    font-size: 14px;
    color: #d0d5dd;
    line-height: 1;
    vertical-align: middle;
    flex-shrink: 0;
    user-select: none;
}

/* 叶节点连接线 ├ └，与竖线之间保持正常间距 */
.tree-col-id .tree-conn.tree-conn-v + .tree-leaf-connector,
.tree-add-inner .tree-conn.tree-conn-v + .tree-leaf-connector {
    margin-left: 0;
    position: relative;
    z-index: 1;
}

/* 展开/折叠 — 用 ::after 伪元素画 ▶，展开时 CSS 旋转 90° 变成 ▼ */
.tree-toggle-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    cursor: pointer;
    color: #86909c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    flex-shrink: 0;
    padding: 0;
    margin-right: 2px;
    transition: background .12s, color .12s;
    vertical-align: middle;
    font-size: 11px;
    line-height: 1;
}
.tree-toggle-btn::after {
    content: '▶';
    display: inline-block;
    transition: transform .15s;
    transform: rotate(0deg);
}
.tree-toggle-btn.expanded::after {
    transform: rotate(90deg);
}
.tree-toggle-btn:hover {
    background: #e5e6eb;
    color: #1d2129;
}

/* 标题列 — 垂直居中，宽度由 JS autoFitTreeColumns 统一计算 */
.tree-row .tree-col-title {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    min-width: 200px;
}

/* 标题链接 */
.tree-title {
    color: #165dff;
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tree-title:hover {
    color: #4080ff;
    text-decoration: underline;
}

/* 标题旁的添加子需求按钮 */
.tree-add-btn-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: #86909c;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    line-height: 1;
    transition: all .12s;
    padding: 0;
    flex-shrink: 0;
    vertical-align: middle;
}
.tree-add-btn-inline:hover {
    background: #165dff;
    color: #fff;
    border-color: #165dff;
}

/* 子节点容器 */
.tree-children {
    display: block;
}

/* 内联添加子需求 */
.tree-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid #e5e6eb;
    border-radius: 4px;
    background: #fff;
    color: #165dff;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    transition: all .12s;
    padding: 0;
    flex-shrink: 0;
    vertical-align: middle;
}
.tree-add-btn:hover {
    background: #165dff;
    color: #fff;
    border-color: #165dff;
}

.tree-add-form {
    display: none;
    align-items: stretch;
    border-bottom: 1px solid #f2f3f5;
    min-height: 40px;
    min-width: max-content;
}
.tree-add-form:last-child {
    border-bottom: none;
}

.tree-add-inner {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    gap: 4px;
    background: #fafbfc;
    width: 100%;
}

.tree-add-icon {
    display: inline-block;
    font-size: 16px;
    color: #165dff;
    margin: 0 4px;
    font-weight: 300;
}

.tree-add-input {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid #e5e6eb;
    border-radius: 4px;
    outline: none;
    transition: border-color .15s;
    background: #fff;
    height: 28px;
}
.tree-add-input:focus {
    border-color: #165dff;
    box-shadow: 0 0 0 2px rgba(22,93,255,0.08);
}

.tree-add-submit,
.tree-add-cancel {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    transition: all .12s;
    height: 28px;
    flex-shrink: 0;
}
.tree-add-submit {
    background: #165dff;
    color: #fff;
}
.tree-add-submit:hover {
    background: #0e42d2;
}
.tree-add-cancel {
    background: #f2f3f5;
    color: #86909c;
}
.tree-add-cancel:hover {
    background: #e5e6eb;
    color: #4e5969;
}

.btn-xs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    font-size: 12px;
    font-family: inherit;
    line-height: 1.5;
    border: 1px solid #e5e6eb;
    border-radius: 4px;
    background: #fff;
    color: #4e5969;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all .12s;
}
.btn-xs:hover {
    background: #f2f3f5;
    text-decoration: none;
}

/* ── 用户设置弹窗 ── */
.user-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-modal {
    background: #fff;
    border-radius: 10px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    overflow: hidden;
}
.user-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e6eb;
}
.user-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2129;
}
.user-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #86909c;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.user-modal-close:hover { color: #1d2129; }
.user-modal-body {
    padding: 20px;
}
.user-profile-form .form-group {
    margin-bottom: 14px;
}
.user-profile-form label {
    display: block;
    font-size: 13px;
    color: #86909c;
    margin-bottom: 4px;
}
.user-profile-input,
.user-profile-input-disabled {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #e5e6eb;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color .15s;
}
.user-profile-input:focus {
    border-color: #165dff;
}
.user-profile-input-disabled {
    background: #f7f8fa;
    color: #86909c;
    cursor: not-allowed;
}
.user-profile-msg {
    font-size: 12px;
    min-height: 18px;
    margin-bottom: 8px;
}
.user-profile-msg.msg-error { color: #cb1b1b; }
.user-profile-msg.msg-success { color: #00b42a; }
.user-profile-form .form-actions {
    display: flex;
    gap: 8px;
}

/* ── 帮助页 ── */
.help-page {
    max-width: 860px;
}
.help-section {
    background: #fff;
    border: 1px solid #e5e6eb;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
}
.help-section h2 {
    font-size: 16px;
    font-weight: 600;
    color: #1d2129;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f2f3f5;
}
.help-section ol, .help-section ul {
    margin-left: 20px;
    font-size: 14px;
    line-height: 1.8;
    color: #4e5969;
}
.help-section ol li, .help-section ul li {
    margin-bottom: 6px;
}
.help-section p {
    font-size: 14px;
    color: #4e5969;
    line-height: 1.7;
    margin-bottom: 10px;
}
.help-note {
    font-size: 13px;
    color: #ff7d00;
    background: #fff7e8;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 10px;
}
.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 8px;
}
.help-table th, .help-table td {
    border: 1px solid #e5e6eb;
    padding: 8px 12px;
    text-align: left;
}
.help-table th {
    background: #f7f8fa;
    font-weight: 600;
    color: #86909c;
}
.help-table td {
    color: #4e5969;
}
.help-section.help-section-accent {
    border-color: #c7dcff;
    background: linear-gradient(180deg, #f5f9ff 0%, #fff 56px);
    box-shadow: 0 1px 2px rgba(22, 93, 255, 0.06);
}
.help-section.help-section-accent h2 {
    border-bottom-color: #e8f0fe;
    color: #0e42c3;
}


/* ── TC 结构化字段 ── */
.tc-fields-view { padding: 0 0 16px 0; }
.tc-badges { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tc-badge { display: inline-block; padding: 3px 12px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.tc-badge-priority { background: #fef3c7; color: #92400e; }
.tc-badge-type { background: #dbeafe; color: #1e40af; }
.tc-badge-env { background: #d1fae5; color: #065f46; }
.tc-block { margin-bottom: 16px; }
.tc-block-title { font-size: 14px; font-weight: 600; color: #1e293b; margin: 0 0 6px 0; padding-bottom: 4px; border-bottom: 1px solid #e2e8f0; }
.tc-block-content { font-size: 14px; color: #334155; line-height: 1.7; white-space: pre-wrap; }
.tc-edit-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.tc-edit-row label { font-size: 13px; color: #64748b; font-weight: 600; margin-right: -10px; }
.tc-edit-row .inline-select { min-width: 120px; }
.tc-edit-block { margin-bottom: 12px; }
.tc-edit-block label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 4px; }
.tc-textarea { width: 100%; padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; line-height: 1.6; resize: vertical; font-family: inherit; }
.tc-textarea:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,0.15); }

/* ── 已取消制品灰色删除线 ── */
a.cancelled-link,
a.tree-title.cancelled-link,
a.gantt-item-link.cancelled-link {
    color: #94a3b8 !important;
    text-decoration: line-through;
}
a.cancelled-link:hover {
    color: #64748b !important;
}

/* 追溯图 & 树形图中已取消 item 灰色删除线 */
.tree-line:has(.sb-cancelled) a.tree-title,
.tree-line:has(.sb-cancelled) a.tree-title:hover {
    color: #94a3b8 !important;
    text-decoration: line-through;
}

/* ── 删除确认弹窗 ── */
.delete-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10000;
}
.delete-overlay.open { display: block; }

.delete-modal {
    display: none;
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 440px;
    max-width: 90vw;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    z-index: 10001;
}
.delete-modal.open { display: block; }

.delete-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e6eb;
}
.delete-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #e53e3e;
}
.delete-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #86909c;
    padding: 4px;
    border-radius: 4px;
}
.delete-modal-close:hover { background: #f2f3f5; color: #1d2129; }

.delete-modal-body {
    padding: 20px;
}
.delete-warning {
    margin: 0 0 12px;
    font-size: 14px;
    color: #4e5969;
}
.delete-target-title {
    margin: 0 0 16px;
    padding: 8px 12px;
    background: #fff7e6;
    border: 1px solid #ffd666;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    color: #d4380d;
    word-break: break-all;
}
.delete-confirm-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #c9cdd4;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s;
}
.delete-confirm-input:focus {
    border-color: #165dff;
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.15);
}
.delete-error {
    margin: 8px 0 0;
    font-size: 12px;
    color: #e53e3e;
}

.delete-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e5e6eb;
}
.delete-modal-footer .btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── 树形视图拖拽排序 ── */
.tree-col-drag-handle {
    width: 28px; min-width: 28px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    cursor: grab; opacity: 0; transition: opacity .15s;
}
.tree-row:hover .tree-col-drag-handle { opacity: 1; }
.tree-col-drag-handle:active { cursor: grabbing; }
.drag-grip {
    color: #c9cdd4; font-size: 14px; letter-spacing: -2px;
    user-select: none; line-height: 1;
}

/* 拖拽源状态 */
.tree-row.dragging {
    opacity: 0.4; background: #f0f5ff;
}
.tree-row.dragging .tree-col-drag-handle { cursor: grabbing; }

/* Drop zone 指示器 */
.tree-row.drop-zone-before {
    border-top: 3px solid #165dff;
    padding-top: 5px;
}
.tree-row.drop-zone-after {
    border-bottom: 3px solid #165dff;
}
.tree-row.drop-zone-inside {
    background: #e8f3ff;
    outline: 2px dashed #165dff;
    outline-offset: -2px;
}
.tree-row.drop-invalid { cursor: not-allowed; }

body.tree-dragging .tree-col-drag-handle { opacity: 0.6; }
