/* KPI 任务管理平台 - Notion Design System */

/* ===== 1. 设计变量 ===== */
:root {
    --color-bg: #ffffff;
    --color-surface: #f6f5f4;
    --color-text: rgba(0, 0, 0, 0.95);
    --color-text-secondary: #615d59;
    --color-text-muted: #a39e98;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-link: #0075de;
    --color-link-hover: #005bab;
    --color-primary: #0075de;
    --color-focus: #097fe8;
    --status-pending: #a39e98;
    --status-progress: #0075de;
    --status-paused: #9b59b6;
    --status-completed: #1aae39;
    --status-overdue: #dd5b00;
    --color-success: #2a9d99;
    --color-danger: #e74c3c;
    --font-sans: 'Inter', -apple-system, system-ui, 'Segoe UI', Helvetica, sans-serif;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --radius-xs: 4px;
    --radius-sm: 5px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 9999px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 18px rgba(0,0,0,0.04), 0 0.8px 2.9px rgba(0,0,0,0.02);
    --shadow-elevated: 0 1px 3px rgba(0,0,0,0.05), 0 7px 15px rgba(0,0,0,0.04), 0 14px 28px rgba(0,0,0,0.04), 0 23px 52px rgba(0,0,0,0.05);
    --shadow-focus: 0 0 0 2px var(--color-focus);
}

/* ===== 2. 重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 3. 导航栏 ===== */
.navbar {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-title { font-size: 14px; font-weight: 600; color: var(--color-text); }
.navbar-links { display: flex; gap: var(--space-1); }
.navbar-links a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-xs);
    transition: all 0.15s;
}
.navbar-links a:hover { color: var(--color-text); background: var(--color-surface); }
.navbar-links a.active { color: var(--color-text); font-weight: 600; background: var(--color-surface); }

/* ===== 4. 主容器 ===== */
.container { max-width: 1200px; margin: 0 auto; padding: var(--space-8) var(--space-6); }

/* ===== 5. 页面标题 ===== */
.page-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.96px;
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    line-height: 1.33;
}

/* ===== 6. Tab ===== */
.tabs {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0;
}
.tab {
    padding: var(--space-2) var(--space-4);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.15s;
}
.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-text); font-weight: 600; border-bottom-color: var(--color-text); }

/* ===== 7. 筛选栏 ===== */
.filter-bar {
    background: var(--color-surface);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid var(--color-border);
}
.filter-item { display: flex; align-items: center; gap: var(--space-2); }
.filter-item label { font-size: 14px; color: var(--color-text-secondary); font-weight: 500; }
.filter-item select,
.filter-item input {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.15s;
}
.filter-item select:focus,
.filter-item input:focus { outline: none; border-color: var(--color-link); box-shadow: var(--shadow-focus); }
.filter-item.filter-search { flex: 1; position: relative; }
.filter-item.filter-search input { width: 100%; padding: var(--space-2) 32px var(--space-2) var(--space-3); }
.filter-item.filter-search .clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}
.filter-item.filter-search .clear-btn:hover { color: var(--color-text); }

/* ===== 8. 按钮 ===== */
.btn {
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}
.btn-primary { background: var(--color-link); color: #fff; }
.btn-primary:hover { background: var(--color-link-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: #eeeeed; }
.btn-success { background: var(--status-completed); color: #fff; }
.btn-success:hover { background: #17a032; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-small { padding: var(--space-1) var(--space-2); font-size: 12px; }

/* ===== 9. 任务卡片 ===== */
.task-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
@media (max-width: 900px) { .task-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .task-list { grid-template-columns: 1fr; } }

.task-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: all 0.2s;
}
.task-card:hover { box-shadow: var(--shadow-elevated); transform: translateY(-1px); }

/* 任务卡片隐藏按钮 */
.task-hide-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 6px;
    border: 1px solid rgba(0,0,0,0.15);
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    color: #888;
    opacity: 0;
    transition: opacity 0.15s;
    line-height: 1.4;
}
.task-card:hover .task-hide-btn { opacity: 1; }
.task-hide-btn:hover { background: #fff; color: #333; border-color: rgba(0,0,0,0.3); }
.task-card { position: relative; }

.project-group { margin-bottom: var(--space-5); }
.project-group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    padding: 6px 0 10px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-3);
}
.project-group-tasks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: flex-start;
}
.project-group-tasks .task-card {
    flex: 1 1 calc(33.333% - var(--space-3) * 2 / 3);
    min-width: 200px;
    max-width: 100%;
}

.task-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-3); gap: var(--space-2); }
.task-header .task-title { flex: 1; font-size: 15px; font-weight: 500; color: var(--color-text); margin-bottom: 0; }
.project-name { font-size: 12px; font-weight: 500; color: var(--color-link); }
.task-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.125px;
}
.task-status.pending { background: var(--status-pending); }
.task-status.progress { background: var(--status-progress); }
.task-status.paused { background: var(--status-paused); }
.task-status.completed { background: var(--status-completed); }
.task-status.overdue { background: var(--status-overdue); }
.task-title { font-size: 15px; font-weight: 600; margin-bottom: var(--space-3); letter-spacing: -0.32px; line-height: 1.4; color: var(--color-text); }
.task-info { font-size: 13px; color: var(--color-text-secondary); margin-bottom: var(--space-2); line-height: 1.4; }

/* ===== 10. 表格 ===== */
.table-wrapper { background: var(--color-bg); border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--color-surface); }
th, td { padding: var(--space-3) var(--space-4); text-align: left; font-size: 14px; }
th { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-secondary); }
tbody tr { border-bottom: 1px solid var(--color-border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--color-surface); }

/* ===== 11. 表单 ===== */
.form-group { margin-bottom: var(--space-5); }
.form-group label { display: block; margin-bottom: var(--space-2); font-size: 14px; font-weight: 500; color: var(--color-text); }
.form-group label .required { color: var(--color-danger); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.15s;
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--color-link); box-shadow: var(--shadow-focus); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--color-text-muted); }

/* ===== 12. 人员选择（紧凑胶囊样式） ===== */
.employee-select-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xs);
    padding: var(--space-2);
    background: var(--color-bg);
}
.employee-select-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 13px;
    color: var(--color-text);
    user-select: none;
}
.employee-select-item:hover {
    border-color: var(--color-link);
    background: rgba(0, 117, 222, 0.06);
}
.employee-select-item.selected {
    border-color: var(--color-link);
    background: var(--color-link);
    color: #fff;
}
.employee-select-item.selected:hover {
    background: var(--color-link-hover);
}
.employee-select-item input[type="checkbox"] {
    display: none;
}
.employee-select-item.disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* ===== 13. 进度条 ===== */
.progress-bar-wrap { display: flex; align-items: center; gap: var(--space-3); width: 100%; }
.progress-label { font-size: 12px; color: var(--color-text-secondary); min-width: 48px; }
.progress-bar { flex: 1; height: 8px; background: var(--color-surface); border-radius: var(--radius-pill); overflow: hidden; }
.progress-bar-inner { height: 100%; transition: width 0.3s; border-radius: var(--radius-pill); }
.progress-bar-inner.high { background: var(--status-completed); }
.progress-bar-inner.medium { background: var(--status-progress); }
.progress-bar-inner.low { background: var(--status-overdue); }
.progress-bar-inner.default { background: var(--color-link); }

/* ===== 14. 图谱 ===== */
.graph-container { width: 100%; height: 600px; background: var(--color-bg); border-radius: var(--radius-lg); border: 1px solid var(--color-border); overflow: hidden; }
.graph-node circle { cursor: pointer; }
.graph-node text { font-size: 12px; font-family: var(--font-sans); pointer-events: none; }
/* 图谱节点颜色（由JS动态添加class） */
.node-circle, .node-rect, .node-polygon { }
.node-emp-tech { fill: #3498db; }
.node-emp-sales { fill: #e74c3c; }
.node-emp-support { fill: #27ae60; }
.node-emp-default { fill: #95a5a6; }
.node-project { fill: #9b59b6; }
.node-task-pending { fill: #999; }
.node-task-progress { fill: #0075de; }
.node-task-paused { fill: #9b59b6; }
.node-task-completed { fill: #1aae39; }
.node-task-default { fill: #95a5a6; }
.graph-legend { display: flex; flex-wrap: wrap; gap: var(--space-4); padding: var(--space-3) var(--space-4); background: var(--color-surface); border-radius: var(--radius-sm); margin-bottom: var(--space-4); }
.legend-item { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; color: var(--color-text-secondary); }
.legend-shape { width: 20px; height: 20px; }

/* 图表柱状图（summary页） */
.chart-bar { height: 100%; transition: width 0.3s; border-radius: var(--radius-pill); }
.chart-bar.total { background: var(--color-link); }
.chart-bar.quality { background: var(--color-success); }
.chart-bar.timeliness { background: var(--status-paused); }
.bar-chart { display: flex; flex-direction: column; gap: var(--space-3); }
.bar-row { display: flex; align-items: center; gap: var(--space-3); }
.bar-label { font-size: 13px; color: var(--color-text-secondary); min-width: 60px; text-align: right; }
.bar-container { flex: 1; height: 20px; background: var(--color-surface); border-radius: var(--radius-pill); overflow: hidden; }
.bar { height: 100%; transition: width 0.3s; border-radius: var(--radius-pill); }
.bar.total { background: var(--color-link); }
.bar.quality { background: var(--color-success); }
.bar.timeliness { background: var(--status-paused); }

/* ===== 15. 分页 ===== */
.pagination { display: flex; justify-content: center; align-items: center; gap: var(--space-2); margin-top: var(--space-8); }
.pagination button {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    cursor: pointer;
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all 0.15s;
}
.pagination button:hover { background: var(--color-surface); }
.pagination button.active { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 16. 弹窗 ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}
.modal.show { display: flex; }
.modal-content {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--space-5);
    position: relative;
}
.modal-content.modal-large { max-width: 640px; }
.modal-content.modal-extra-large { max-width: 800px; }
.modal-title { font-size: 18px; font-weight: 600; margin-bottom: var(--space-5); color: var(--color-text); }
.modal-close {
    position: absolute; top: var(--space-4); right: var(--space-4);
    background: none; border: none; font-size: 24px;
    cursor: pointer; color: var(--color-text-muted);
    width: 32px; height: 32px; display: flex; align-items: center;
    justify-content: center; border-radius: var(--radius-xs); transition: all 0.15s;
}
.modal-close:hover { background: var(--color-surface); color: var(--color-text); }

/* ===== 17. 详情弹窗 ===== */
.detail-row { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-4); }
.detail-row label { font-size: 14px; font-weight: 500; color: var(--color-text-secondary); min-width: 80px; padding-top: var(--space-2); }
.detail-readonly { font-size: 14px; color: var(--color-text); padding-top: var(--space-2); }
.detail-textarea {
    flex: 1; padding: var(--space-3);
    border: 1px solid var(--color-border); border-radius: var(--radius-xs);
    font-size: 14px; font-family: var(--font-sans); resize: vertical; min-height: 60px;
    background: var(--color-bg); color: var(--color-text);
}
.detail-textarea:focus { outline: none; border-color: var(--color-link); box-shadow: var(--shadow-focus); }
.detail-section-title { font-size: 14px; font-weight: 600; color: var(--color-text); margin: var(--space-5) 0 var(--space-3); }
.detail-actions { margin-top: var(--space-5); display: flex; gap: var(--space-3); }
.detail-actions .btn { flex: 1; }

/* ===== 18. 评分 ===== */
.score-input { margin-bottom: var(--space-4); }
.score-input label { display: block; font-size: 14px; font-weight: 500; margin-bottom: var(--space-2); color: var(--color-text); }
.score-input input {
    width: 100%; padding: var(--space-3);
    border: 1px solid var(--color-border); border-radius: var(--radius-xs);
    font-size: 16px; font-family: var(--font-sans); text-align: center;
    background: var(--color-bg); color: var(--color-text);
}
.score-input input:focus { outline: none; border-color: var(--color-link); box-shadow: var(--shadow-focus); }

/* ===== 19. 附件 ===== */
.attachment-list { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-3); }
/* 附件网格（缩略图列表） */
.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 8px;
}
.attachment-grid-item {
    position: relative;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #f7f6f3;
    transition: border-color 0.15s;
}
.attachment-grid-item:hover {
    border-color: var(--color-primary);
}
.attachment-grid-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    display: block;
}
.attachment-grid-item .att-name {
    font-size: 11px;
    padding: 4px 6px;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}
.attachment-grid-item .att-del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
}
.attachment-grid-item:hover .att-del { opacity: 1; }

/* 附件列表样式（文件类） */
.attachment-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-3); background: var(--color-surface);
    border-radius: var(--radius-xs); border: 1px solid var(--color-border);
}
.attachment-info { display: flex; align-items: center; gap: var(--space-2); flex: 1; min-width: 0; }
.attachment-icon { font-size: 20px; flex-shrink: 0; }
.attachment-name { font-size: 13px; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-size { font-size: 12px; color: var(--color-text-muted); }
.attachment-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
.attachment-add { display: flex; align-items: center; gap: var(--space-3); }
.attachment-hint { font-size: 12px; color: var(--color-text-muted); }

/* 图片预览弹窗 */
.modal-image-preview {
    max-width: 90vw;
    max-height: 90vh;
    background: #000;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-image-preview img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}
.image-preview-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    color: #fff;
    z-index: 10;
}

/* ===== 20. 工具栏 ===== */
.toolbar { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-5); }
.toolbar .btn { font-size: 13px; }

/* ===== 21. 统计卡片 ===== */
.stat-card {
    background: var(--color-bg); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: var(--space-5);
    box-shadow: var(--shadow-card);
}
.stat-label { font-size: 13px; color: var(--color-text-secondary); margin-bottom: var(--space-2); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--color-text); letter-spacing: -1px; }

/* ===== 22. 头像 ===== */
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--color-surface); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); border: 1px solid var(--color-border); flex-shrink: 0; }
.avatars { display: flex; }
.avatars .avatar + .avatar { margin-left: -8px; }

/* ===== 23. 文字 ===== */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-success { color: var(--status-completed); }
.text-danger { color: var(--color-danger); }

/* ===== 24. 间距 ===== */
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-20 { margin-top: 20px; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

/* ===== 25. 发布任务弹窗 - 紧凑表单 ===== */
.modal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3) var(--space-4);
}
.modal-form-grid .form-group { margin-bottom: 0; }
.modal-form-grid .form-group.full { grid-column: 1 / -1; }
/* 标签和控件左右排列 */
.modal-form-grid .form-group.inline-field {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.modal-form-grid .form-group.inline-field label {
    margin-bottom: 0;
    white-space: nowrap;
    min-width: 40px;
}
.modal-form-grid .form-group.inline-field select {
    flex: 1;
}
.modal-form-grid label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-1);
    display: block;
}
.modal-form-grid input,
.modal-form-grid select,
.modal-form-grid textarea {
    padding: var(--space-2) var(--space-3);
    font-size: 14px;
}
.modal-form-grid textarea { min-height: 60px; }
.publish-form-footer { display: flex; gap: var(--space-3); margin-top: var(--space-4); }
.publish-form-footer .btn { flex: 1; }

/* ===== 26. 图谱 ===== */
.detail-modal-body { display: flex; flex-direction: column; gap: var(--space-3); }
.detail-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
}
.detail-item:last-child { border-bottom: none; }
.detail-item-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-muted);
    min-width: 70px;
    padding-top: 2px;
}
.detail-item-content { flex: 1; min-width: 0; }
.detail-item-content .detail-value { font-size: 14px; color: var(--color-text); }
.detail-item-content input[type="date"],
.detail-item-content select {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    width: 100%;
}
.detail-item-content input[type="date"]:focus,
.detail-item-content select:focus {
    outline: none;
    border-color: var(--color-link);
    box-shadow: var(--shadow-focus);
}
.detail-item-content textarea {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xs);
    font-size: 14px;
    font-family: var(--font-sans);
    resize: vertical;
    min-height: 60px;
    background: var(--color-bg);
    color: var(--color-text);
}
.detail-item-content textarea:focus {
    outline: none;
    border-color: var(--color-link);
    box-shadow: var(--shadow-focus);
}
.detail-item-value-plain { font-size: 14px; color: var(--color-text); }

.status-progression { display: flex; align-items: flex-start; gap: 6px; }
.status-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
}
.status-step.done { background: #16a34a; color: #fff; }
.status-step.done .status-time { color: rgba(255,255,255,0.8); }
.status-step.active { background: var(--color-link); color: #fff; }
.status-step.pending { background: #f3f4f6; color: #6b7280; }
.status-step[data-status="待办"] { background: #94a3b8; color: #fff; }
.status-step[data-status="进行中"] { background: #3b82f6; color: #fff; }
.status-step[data-status="待测试"] { background: #f59e0b; color: #fff; }
.status-step[data-status="优化"] { background: #8b5cf6; color: #fff; }
.status-step[data-status="完成"] { background: #22c55e; color: #fff; }
.status-step.active[data-status="待办"] { background: #64748b; color: #fff; }
.status-step.active[data-status="进行中"] { background: #2563eb; color: #fff; }
.status-step.active[data-status="待测试"] { background: #d97706; color: #fff; }
.status-step.active[data-status="优化"] { background: #7c3aed; color: #fff; }
.status-step.active[data-status="完成"] { background: #16a34a; color: #fff; }
.status-time { display: block; font-size: 10px; font-weight: 400; margin-top: 3px; color: rgba(255,255,255,0.75); white-space: nowrap; }
.status-clickable { cursor: pointer; text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 3px; }
.status-clickable:hover { opacity: 0.8; }

/* 状态切换弹窗 */
#statusModal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); align-items: center; justify-content: center; z-index: 99999; }
#statusModalBody { text-align: center; padding: 20px 0; }
#statusModalBody .modal-title { font-size: 18px; color: #374151; margin-bottom: 20px; font-weight: 600; }

/* 测试表单弹窗 */
#testFormModal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); align-items: center; justify-content: center; z-index: 100001; }
.modal-btns { display: flex; gap: 12px; justify-content: center; }
.modal-btn { padding: 10px 24px; border-radius: 8px; border: 1.5px solid; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.modal-btn.rollback { border-color: #f59e0b; color: #d97706; background: #fffbeb; }
.modal-btn.rollback:hover { background: #fef3c7; }
.modal-btn.advance { border-color: #3b82f6; color: #2563eb; background: #eff6ff; }
.modal-btn.advance:hover { background: #dbeafe; }
.modal-small { width: 340px; max-width: 90vw; }
.status-arrow { display: flex; align-items: center; padding-top: 6px; color: #d1d5db; font-size: 16px; }
.status-next-btn {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    border: 1px dashed #d1d5db;
    color: #6b7280;
    background: none;
    cursor: pointer;
    transition: all 0.2s;
}
.status-next-btn:hover { border-color: var(--color-link); color: var(--color-link); background: #eff6ff; }
.detail-modal-footer { display: flex; gap: var(--space-3); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.detail-modal-footer .btn { flex: 1; }
.detail-modal-tabs { display: flex; gap: 0; margin-bottom: var(--space-4); border-bottom: 1px solid var(--color-border); }
.detail-modal-tabs .tab { padding: var(--space-2) var(--space-4); font-size: 14px; }
.detail-modal-section { margin-top: var(--space-4); }
.detail-modal-section-title { font-size: 13px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: var(--space-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* ===== 27. 移动端适配增强 ===== */
@media (max-width: 768px) {
    /* 通用 */
    .container { padding: var(--space-4); }
    .page-title { font-size: 20px; }

    /* 搜索/筛选栏 */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
    }
    .filter-item {
        display: flex;
        align-items: center;
        width: 100%;
    }
    .filter-item label {
        white-space: nowrap;
        min-width: 36px;
        flex-shrink: 0;
    }
    .filter-item select,
    .filter-item input { flex: 1; width: auto; min-width: 0; }

    /* 弹窗 -> 底部抽屉 */
    .modal { align-items: flex-end; padding: 0; }
    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 92vh;
        padding: var(--space-4);
    }
    .modal-publish .modal-content {
        padding: var(--space-3);
    }
    .modal-publish .modal-title {
        font-size: 16px;
        margin-bottom: var(--space-3);
    }
    .modal-publish .modal-form-grid {
        gap: var(--space-2);
    }
    .modal-publish .modal-form-grid label {
        font-size: 11px;
        margin-bottom: 2px;
    }
    .modal-publish .modal-form-grid input,
    .modal-publish .modal-form-grid select,
    .modal-publish .modal-form-grid textarea {
        padding: var(--space-2);
        font-size: 14px;
    }
    .modal-publish .modal-form-grid textarea {
        min-height: 44px;
    }
    .modal-publish .employee-select-list {
        max-height: 80px;
    }
    .modal-publish .publish-form-footer {
        margin-top: var(--space-3);
    }
    .modal-close {
        top: var(--space-3);
        right: var(--space-3);
    }

    /* 发布任务表单 -> 单列紧凑 */
    .modal-form-grid { grid-template-columns: 1fr; gap: var(--space-3); }
    .modal-form-grid .form-group { margin-bottom: 0; }

    /* 详情弹窗 -> 单列紧凑 */
    .detail-modal-body { gap: 0; }
    .detail-item { padding: var(--space-3) 0; }

    /* 任务卡片 */
    .task-card { padding: var(--space-3); }
    .task-title { font-size: 14px; }

    /* 发布页表单 */
    .publish-page-form { padding: var(--space-4); }
    .publish-page-submit { padding: var(--space-3); }

    /* 汇总分析页 */
    .tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .tabs .tab { display: inline-block; float: none; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-item { width: 100%; }
    .filter-item input[type="date"] { width: 100%; }
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-wrapper table { min-width: 600px; }
    #barChart { overflow-x: auto; }
}

@media (max-width: 480px) {
    .modal-content { border-radius: 12px 12px 0 0; }
    .detail-modal-tabs .tab { font-size: 13px; padding: var(--space-2) var(--space-3); }
    .detail-item-label { min-width: 60px; font-size: 12px; }
    .detail-item-content input[type="date"],
    .detail-item-content select,
    .detail-item-content textarea { font-size: 16px; /* 防止iOS自动缩放 */ }
}
