/* ============================================================
   项目管理系统 - 样式表（浅色商务风）
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --sidebar-bg: #ffffff;
    --content-bg: #f4f6f9;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-sub: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);

    --c-todo: #94a3b8;
    --c-doing: #2563eb;
    --c-done: #16a34a;
    --c-delay: #dc2626;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--content-bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* ---------------------------------------------------- 登录页 */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 50%, #f0f9ff 100%);
}
.login-card {
    width: 400px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 40px 36px;
}
.login-card h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    text-align: center;
}
.login-sub {
    text-align: center;
    color: var(--text-sub);
    font-size: 13px;
    margin-bottom: 28px;
}
.login-tip {
    margin-top: 18px;
    padding: 10px 12px;
    background: var(--primary-light);
    border-radius: 6px;
    font-size: 12px;
    color: var(--primary-dark);
    text-align: center;
}

/* ---------------------------------------------------- 布局 */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}
.sidebar-logo {
    padding: 18px 20px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 9px;
}
.logo-mark {
    width: 28px; height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-group { margin-bottom: 4px; }
.nav-group-title {
    padding: 8px 20px 4px;
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: .5px;
}
.nav-item {
    padding: 9px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-sub);
    border-left: 3px solid transparent;
    transition: all .15s;
    font-size: 13.5px;
}
.nav-item:hover { background: var(--border-light); color: var(--text); }
.nav-item.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-left-color: var(--primary);
    font-weight: 500;
}
.nav-icon { width: 16px; text-align: center; font-size: 15px; }

.sidebar-foot {
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-muted);
}
/* 侧边栏底部版本号：版本真源在根目录 VERSION 文件，这里只做展示 */
.side-ver {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-placeholder, var(--text-muted));
    opacity: .75;
    letter-spacing: .2px;
    user-select: text;
}

.main { flex: 1; margin-left: 220px; display: flex; flex-direction: column; }

.topbar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky; top: 0; z-index: 90;
}
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-spacer { flex: 1; }
.project-select {
    min-width: 220px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}
.user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 10px;
    border-radius: 20px;
    background: var(--border-light);
    font-size: 13px;
    cursor: pointer;
}
.user-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
}

.content { padding: 22px 24px 40px; flex: 1; }

/* ---------------------------------------------------- 通用组件 */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.card-title {
    font-size: 15px; font-weight: 600;
    margin-bottom: 14px;
    display: flex; align-items: center; gap: 8px;
}
.card-title .sub { font-size: 12px; color: var(--text-muted); font-weight: 400; }

.card-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.card-head .card-title { margin-bottom: 0; }

.btn {
    padding: 7px 14px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    transition: all .15s;
    white-space: nowrap;
}
.btn:hover { background: var(--border-light); border-color: #d1d5db; }
.btn-primary {
    background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--c-delay); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--border-light); }

.btn-group { display: flex; gap: 8px; }

/* KPI 卡片 */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}
.kpi-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}
.kpi-label { font-size: 12.5px; color: var(--text-sub); margin-bottom: 6px; }
.kpi-value { font-size: 26px; font-weight: 600; line-height: 1.2; }
.kpi-value.primary { color: var(--primary); }
.kpi-value.warn { color: #ea580c; }
.kpi-value.danger { color: var(--c-delay); }
.kpi-value.success { color: var(--c-done); }

/* KPI 卡片可点击 */
.kpi-card.clickable {
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    position: relative;
}
.kpi-card.clickable:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 6px 18px rgba(37, 99, 235, .14);
}
.kpi-card .kpi-arrow {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-sub); font-size: 15px; opacity: 0;
    transition: opacity .12s ease;
}
.kpi-card.clickable:hover .kpi-arrow { opacity: 1; }
.kpi-card .kpi-hint {
    margin-top: 8px; font-size: 11.5px; color: var(--text-sub); opacity: 0;
    transition: opacity .12s ease;
}
.kpi-card.clickable:hover .kpi-hint { opacity: 1; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.data th {
    text-align: left;
    padding: 9px 12px;
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-sub);
    font-size: 12.5px;
    white-space: nowrap;
}
table.data td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
table.data tbody tr:hover { background: #fafbfc; }
table.data td.actions { white-space: nowrap; }

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
}
.tag-todo   { background: #f1f5f9; color: #64748b; }
.tag-doing  { background: #dbeafe; color: #1d4ed8; }
.tag-done   { background: #dcfce7; color: #15803d; }
.tag-delay  { background: #fee2e2; color: #b91c1c; }
.tag-lv极高 { background: #fee2e2; color: #991b1b; font-weight: 500; }
.tag-lv高   { background: #ffedd5; color: #c2410c; }
.tag-lv中   { background: #fef9c3; color: #a16207; }
.tag-lv低   { background: #f1f5f9; color: #64748b; }
.tag-type   { background: #f3e8ff; color: #7e22ce; }
.tag-role   { background: #e0e7ff; color: #4338ca; }

/* 进度条 */
.progress {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
    min-width: 80px;
}
.progress-bar { height: 100%; background: var(--primary); border-radius: 3px; }
.progress-bar.green { background: var(--c-done); }
.progress-bar.red { background: var(--c-delay); }
.progress-cell { display: flex; align-items: center; gap: 8px; }
.progress-text { font-size: 12px; color: var(--text-sub); min-width: 38px; }

/* 双进度条（时间进度 vs 实际进度） */
.dual-progress { display: flex; flex-direction: column; gap: 5px; }
.dual-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.dual-row .label { color: var(--text-sub); min-width: 58px; }

/* 表单 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}
.form-item { display: flex; flex-direction: column; gap: 5px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 12.5px; color: var(--text-sub); font-weight: 500; }
.form-item input,
.form-item select,
.form-item textarea {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
}
.form-item input:focus,
.form-item select:focus,
.form-item textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .08);
}
.form-item textarea { resize: vertical; min-height: 70px; }

/* ---------- 必填标记与校验高亮 ---------- */
.req { color: var(--c-delay); margin-left: 2px; font-weight: 700; }
.form-item.has-error label { color: var(--c-delay); }
.form-item.has-error input,
.form-item.has-error select,
.form-item.has-error textarea {
    border-color: var(--c-delay);
    background: #fff7f7;
}
.form-item.has-error .rich-editor { border-color: var(--c-delay); }
.form-item.has-error .rich-content { background: #fff7f7; }
.form-req-tip { font-size: 12px; color: var(--text-sub); }

.filter-bar {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-bottom: 14px;
}
.filter-bar input,
.filter-bar select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.filter-bar input { min-width: 180px; }

.check-inline {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-sub); cursor: pointer; user-select: none;
}
.check-inline input { min-width: auto; }

/* 分段筛选（正式/临时） */
.seg {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}
.seg button {
    padding: 7px 16px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-sub);
    border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: none; }
.seg button.active { background: var(--primary); color: #fff; }

/* 项目多选过滤器（任务中心/执行分析/仪表盘/事项/风险问题 聚合页复用） */
.proj-filter { position: relative; display: inline-block; }
.proj-filter-btn {
    display: inline-flex; align-items: center; gap: 8px;
    max-width: 260px; white-space: nowrap;
}
.pf-caret { font-size: 10px; color: var(--text-muted); }
.proj-filter-panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 600;
    width: 320px; padding: 10px;
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    box-shadow: 0 12px 28px rgba(16,24,40,.16);
}
.pf-search input {
    width: 100%; box-sizing: border-box;
    padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
    font-size: 13px; min-width: 0;
}
.pf-actions { display: flex; gap: 8px; margin: 8px 0 4px; align-items: center; }
.pf-actions .pf-done { margin-left: auto; }
.pf-list { max-height: 260px; overflow-y: auto; margin-top: 4px; }
.pf-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 6px; border-radius: 6px;
    font-size: 13px; cursor: pointer; user-select: none;
}
.pf-row:hover { background: #f4f6f9; }
.pf-row input { min-width: auto; flex-shrink: 0; }
.pf-code { color: var(--text-muted); font-size: 12px; min-width: 44px; flex-shrink: 0; }
.pf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-none { padding: 8px 6px; }

/* 弹窗 */
.modal-mask {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .45);
    display: flex; align-items: flex-start; justify-content: center;
    z-index: 1000;
    padding: 40px 20px;
    overflow-y: auto;
}
.modal {
    background: #fff;
    border-radius: 10px;
    width: 640px;
    max-width: 100%;
    box-shadow: 0 20px 40px rgba(16,24,40,.2);
}
.modal-lg { width: 900px; }
.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-close {
    border: none; background: none; font-size: 20px;
    cursor: pointer; color: var(--text-muted); line-height: 1;
}
.modal-body { padding: 20px; }
.modal-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: flex-end; gap: 10px;
}

/* Toast */
.toast-wrap {
    position: fixed; top: 20px; right: 20px; z-index: 2000;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 11px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    font-size: 13px;
    min-width: 200px;
}
.toast.success { border-left-color: var(--c-done); }
.toast.error { border-left-color: var(--c-delay); }

/* 空状态 */
.empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}
.empty-icon { font-size: 34px; margin-bottom: 10px; opacity: .35; }

/* Tabs */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
}
.tab {
    padding: 9px 16px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-sub);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

/* 项目名片 */
.project-card {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
}
.project-name { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.project-meta {
    display: flex; flex-wrap: wrap; gap: 16px;
    font-size: 12.5px; color: var(--text-sub);
    margin-bottom: 14px;
}
.project-meta .item { display: flex; gap: 5px; }
.project-meta .item .k { color: var(--text-muted); }
.project-goal {
    font-size: 13px; color: var(--text-sub);
    padding-top: 12px; border-top: 1px dashed var(--border);
}

/* 甘特图 */
.gantt { overflow-x: auto; }
.gantt-table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.gantt-table th {
    padding: 8px 10px;
    background: #fafbfc;
    border-bottom: 1px solid var(--border);
    font-size: 12px; color: var(--text-sub);
    text-align: left; white-space: nowrap;
    position: sticky; top: 0; z-index: 6;
}
.gantt-table th.gantt-time-head { padding: 4px 10px; vertical-align: bottom; position: static; }
.gantt-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
    background: #fff;
}
.gantt-table td.gantt-time-cell { padding: 7px 10px; background: transparent; }
/* 固定左侧任务名列，便于横向滚动对照 */
.gantt-table th:nth-child(1),
.gantt-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 7;
    min-width: 190px;
}
.gantt-axis-wrap {
    position: relative;
    height: 36px;
}
.gantt-axis-wrap .gantt-grid-band { opacity: .25; }
.gantt-grid {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
}
.gantt-grid-band {
    position: absolute;
    top: 0; bottom: 0;
}
.gantt-grid-band.even { background: #f2f4f7; }
.gantt-grid-band.odd { background: transparent; }
.gantt-grid-line {
    position: absolute;
    top: 0; bottom: 0;
    width: 1px;
    background: var(--border);
    z-index: 1;
}
.gantt-axis-label {
    position: absolute;
    top: 2px;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    z-index: 2;
}
.gantt-week-tick {
    position: absolute;
    top: 0; bottom: 0;
    width: 1px;
    background: var(--border-light);
    opacity: .75;
    z-index: 0;
}
.gantt-day-label {
    position: absolute;
    top: 16px;
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    z-index: 2;
    transform: translateX(-50%);
}
.gantt-today-line {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--c-delay);
    z-index: 2;
    box-shadow: 0 0 0 2px rgba(239,68,68,.15);
}
.gantt-today-band {
    position: absolute;
    top: 0; bottom: 0;
    background: rgba(239,68,68,.06);
    z-index: 0;
}
.gantt-today-label {
    position: absolute;
    top: 2px;
    font-size: 10px;
    color: #fff;
    background: var(--c-delay);
    padding: 1px 5px;
    border-radius: 3px;
    z-index: 3;
    font-weight: 600;
}
.gantt-bar-wrap {
    position: relative;
    height: 24px;
    background: var(--border-light);
    border-radius: 3px;
    min-width: 420px;
}
.gantt-bar {
    position: absolute;
    height: 16px;
    top: 4px;
    border-radius: 3px;
    background: var(--primary);
    opacity: .9;
    z-index: 3;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.gantt-bar.done { background: var(--c-done); }
.gantt-bar.delay { background: var(--c-delay); }
.gantt-bar.todo { background: var(--c-todo); }
.gantt-bar-label {
    position: absolute;
    height: 16px;
    top: 4px;
    line-height: 16px;
    font-size: 10px;
    color: #fff;
    padding: 0 5px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 4;
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.gantt-axis { font-size: 11px; color: var(--text-muted); }

/* 图表条 */
.chart-bars { display: flex; flex-direction: column; gap: 10px; }
.chart-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.chart-bar-label { min-width: 92px; color: var(--text-sub); }
.chart-bar-track {
    flex: 1; height: 20px;
    background: var(--border-light);
    border-radius: 4px; overflow: hidden;
}
.chart-bar-fill { height: 100%; border-radius: 4px; }
.chart-bar-value { min-width: 34px; text-align: right; color: var(--text-sub); }

/* 提醒列表 */
.remind-list { display: flex; flex-direction: column; gap: 9px; }
.remind-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}
.remind-item.danger { border-color: #fecaca; background: #fef2f2; }
.remind-item.warn { border-color: #fed7aa; background: #fff7ed; }
.remind-days {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
}
.remind-item.danger .remind-days { color: var(--c-delay); }
.remind-item.warn .remind-days { color: #ea580c; }

/* 汇报预览 */
.report-preview {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}
.report-part { margin-bottom: 28px; }
.report-part h4 {
    font-size: 14px; font-weight: 600; margin-bottom: 12px;
    padding-left: 9px; border-left: 3px solid var(--primary);
}
.report-text {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}
.editable-cell {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    padding: 4px 6px;
    font-size: 13px;
    font-family: inherit;
    border-radius: 4px;
}
.editable-cell:hover { border-color: var(--border); background: #fff; }
.editable-cell:focus { outline: none; border-color: var(--primary); background: #fff; }

/* 时间线（里程碑） */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
    content: '';
    position: absolute; left: 6px; top: 6px; bottom: 6px;
    width: 2px; background: var(--border);
}
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item::before {
    content: '';
    position: absolute; left: -20px; top: 5px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 2px solid var(--c-todo);
}
.tl-item.done::before { background: var(--c-done); border-color: var(--c-done); }
.tl-item.doing::before { background: var(--c-doing); border-color: var(--c-doing); }
.tl-item.current::before {
    background: var(--c-doing); border-color: var(--c-doing);
    box-shadow: 0 0 0 4px rgba(37,99,235,.15);
}
.tl-name { font-size: 13.5px; font-weight: 500; }
.tl-meta { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.tl-desc { font-size: 12.5px; color: var(--text-sub); margin-top: 4px; }

/* 附件 */
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attach-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: var(--border-light);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 12px;
    text-decoration: none;
    color: var(--text);
}
.attach-chip:hover { background: var(--primary-light); border-color: var(--primary); }

/* 附件查看页 */
.attachment-page { display: flex; flex-direction: column; gap: 14px; height: calc(100vh - 110px); }
.attachment-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-shrink: 0; }
.attachment-title { font-size: 17px; font-weight: 600; word-break: break-all; }
.attachment-meta { margin-top: 6px; color: var(--text-muted); font-size: 12.5px; }
.attachment-preview { flex: 1; min-height: 420px; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 16px; }
.attachment-image { max-width: 100%; max-height: calc(100vh - 220px); object-fit: contain; }
.attachment-frame { width: 100%; height: 100%; min-height: 600px; border: 0; }
.attachment-video { max-width: 100%; max-height: calc(100vh - 220px); }
.attachment-text { width: 100%; height: 100%; min-height: 500px; margin: 0; padding: 16px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: #fafafa; border-radius: 6px; font-size: 13px; }
.attachment-no-preview { text-align: center; color: var(--text-sub); }
.attachment-no-preview b { display: block; color: var(--text); word-break: break-all; }
.attachment-no-preview p { margin-top: 10px; }
.attachment-file-icon { font-size: 64px; margin-bottom: 14px; }
.attachment-truncated { padding: 8px 12px; color: var(--text-muted); font-size: 12px; }

@media (max-width: 720px) {
    .attachment-head { align-items: flex-start; flex-direction: column; }
    .attachment-page { height: auto; }
    .attachment-preview { min-height: 360px; }
    .attachment-frame { min-height: 520px; }
}

/* 周报卡片 */
.weekly-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 12px;
    background: #fff;
}
.weekly-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 9px;
    border-bottom: 1px dashed var(--border);
}
.weekly-date { font-weight: 600; font-size: 13.5px; }
.weekly-field { display: flex; gap: 8px; margin-bottom: 6px; font-size: 13px; }
.weekly-field .k {
    color: var(--text-muted); min-width: 68px; flex-shrink: 0;
}
.weekly-field .v { color: var(--text); white-space: pre-wrap; }

/* 工具 */
.row { display: flex; gap: 14px; }
.col { flex: 1; min-width: 0; }
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mb-14 { margin-bottom: 14px; }
.text-sub { color: var(--text-sub); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--c-delay); }
.text-sm { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ===== 任务中心（首页） ===== */
.todo-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 16px;
}
.todo-hello { font-size: 20px; font-weight: 600; }
.todo-sub {
    font-size: 13px; color: var(--text-sub); margin-top: 2px;
    display: flex; align-items: center; gap: 8px;
}
.todo-body {
    display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start;
}
.todo-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.todo-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.todo-list { display: flex; flex-direction: column; gap: 6px; }
.todo-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px; cursor: pointer; background: #fff;
    transition: border-color .15s, background .15s;
}
.todo-item:hover { border-color: var(--primary); background: var(--primary-light); }
.todo-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.todo-right { flex-shrink: 0; font-size: 12px; color: var(--text-sub); display: flex; align-items: center; gap: 4px; }

.mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.mini-card { background: var(--border-light); border-radius: 6px; padding: 10px 12px; }
.mini-label { font-size: 12px; color: var(--text-sub); }
.mini-value { font-size: 20px; font-weight: 600; }
.mini-value.danger { color: var(--c-delay); }

.load-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.load-name { min-width: 52px; color: var(--text); }

.trend-row { display: flex; gap: 14px; align-items: flex-end; margin-top: 4px; }
.trend-col { flex: 1; text-align: center; }
.trend-bars { display: flex; gap: 3px; justify-content: center; align-items: flex-end; height: 64px; }
.trend-bar { width: 14px; border-radius: 3px 3px 0 0; min-height: 2px; }
.trend-bar.done { background: var(--c-done); }
.trend-bar.added { background: #93c5fd; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 3px; vertical-align: middle; }
.dot.done { background: var(--c-done); }
.dot.added { background: #93c5fd; }

@media (max-width: 900px) {
    .todo-body { grid-template-columns: 1fr; }
}

/* 执行分析页：更高的趋势柱 + 柱顶数字 */
.trend-lg .trend-bars { height: 128px; }
.trend-lg .trend-bar { width: 18px; position: relative; }
.trend-num {
    position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
    font-size: 11px; color: var(--text-sub); white-space: nowrap;
}

/* 表单勾选框（如：是否里程碑） */
.cb-inline {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 32px; cursor: pointer; user-select: none;
}
.cb-inline input[type="checkbox"] {
    width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--primary);
}
.cb-inline span { font-size: 13px; color: var(--text-sub); }

/* 里程碑标记 */
.tag-ms {
    display: inline-block; padding: 1px 7px; border-radius: 10px;
    font-size: 11px; line-height: 18px;
    background: #EEEDFE; color: #534AB7; border: 1px solid #CECBF6;
}

/* 周报卡片：本期实际进度标签 */
.tag-progress {
    display: inline-block; padding: 1px 7px; border-radius: 10px;
    font-size: 11px; line-height: 18px;
    background: #E1F5EE; color: #0F6E56; border: 1px solid #9FE1CB;
}
.pg-delta { font-weight: 500; }
.pg-delta.up { color: var(--c-done); }
.pg-delta.down { color: var(--c-delay); }

/* 周报「本周计划完成情况」勾选区 */
.weekly-task-box {
    margin-top: 8px;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    background: var(--bg-subtle, #FAFAFA);
}
.wt-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 4px;
    border-bottom: 1px dashed var(--border);
    cursor: pointer;
}
.wt-item:last-child { border-bottom: none; }
.wt-item:hover { background: rgba(0, 0, 0, .03); border-radius: 6px; }
.wt-item input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.wt-name { font-size: 13px; font-weight: 500; }
.wt-meta { margin-left: auto; font-size: 12px; color: var(--text-sub); white-space: nowrap; }

/* 周报卡片上的「本期计划完成情况」明细 */
.weekly-progress { margin: 10px 0 4px; padding: 8px 12px; background: var(--bg-subtle, #FAFAFA); border-radius: 8px; }
.wp-title { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; }
.wp-list { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.wp-item { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.wp-item.is-done { color: #0F6E56; }
.wp-item.is-undone { color: var(--text-sub); }
.wp-mark { font-weight: 700; }
.wp-st { color: var(--text-sub); font-size: 11px; }

/* 富文本编辑器 */
.rich-editor { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; }
.rich-toolbar {
    display: flex; gap: 4px; padding: 5px 8px;
    background: var(--border-light); border-bottom: 1px solid var(--border);
}
.rich-toolbar button {
    width: 28px; height: 26px; border: 1px solid transparent;
    background: #fff; border-radius: 4px; cursor: pointer;
    font-size: 13px; color: var(--text); line-height: 1;
}
.rich-toolbar button:hover { border-color: var(--border); background: var(--primary-light); }
.rich-content {
    min-height: 90px; max-height: 240px; overflow-y: auto;
    padding: 8px 10px; font-size: 13px; line-height: 1.6;
    outline: none; color: var(--text);
}
.rich-content p { margin: 0 0 6px; }
.rich-content p:last-child { margin-bottom: 0; }
.rich-content ul, .rich-content ol { margin: 0 0 6px; padding-left: 20px; }
.rich-content a { color: var(--primary); text-decoration: underline; }

/* 待上传附件列表 */
.pending-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pending-file {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; background: var(--border-light);
    border: 1px solid var(--border); border-radius: 14px; font-size: 12px;
}
.pending-file button {
    border: none; background: none; cursor: pointer; color: var(--c-delay);
    font-size: 12px; padding: 0; line-height: 1;
}
.weekly-field .v ul, .weekly-field .v ol { padding-left: 18px; margin: 4px 0; }
.weekly-field .v p { margin: 0 0 4px; }
.weekly-field .v p:last-child { margin-bottom: 0; }
