/* =============================================
   项目跟踪管理系统 - 样式表
   ============================================= */

/* ----- CSS 变量 (亮色主题) ----- */
:root {
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-header: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #3b82f6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: 0.2s ease;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
}

/* ----- 暗色主题 ----- */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-header: #1e293b;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --primary: #818cf8;
    --primary-hover: #6366f1;
    --primary-light: #1e1b4b;
    --success: #34d399;
    --success-light: #064e3b;
    --warning: #fbbf24;
    --warning-light: #451a03;
    --danger: #f87171;
    --danger-light: #450a0a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
}

/* ----- 全局重置 ----- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    transition: background var(--transition), color var(--transition);
}

a { color: var(--primary); text-decoration: none; }

/* ----- 顶部导航 ----- */
.header {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--transition);
}
.btn-icon:hover { background: var(--primary-light); }

/* ----- Tab 导航 ----- */
.tabs {
    background: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    gap: 2px;
    position: sticky;
    top: 56px;
    z-index: 99;
}

.tab {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
    font-family: var(--font);
    white-space: nowrap;
}
.tab:hover { color: var(--primary); background: var(--primary-light); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

#btnNewProject {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    border: none;
    font-weight: 600;
}
#btnNewProject:hover { background: var(--primary-hover); color: #fff; }

/* ----- 主内容区 ----- */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* ----- 视图切换 ----- */
.view { display: none; }
.view.active { display: block; }

/* ----- 统计卡片网格 ----- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    border-left: 4px solid var(--info);
    cursor: pointer;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-card.stat-active { border-left-color: var(--primary); }
.stat-card.stat-done { border-left-color: var(--success); }
.stat-card.stat-warn { border-left-color: var(--danger); }

.stat-icon { font-size: 2rem; }
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); }

/* ----- 通用卡片 ----- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}
.card-header {
    padding: 14px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-body { padding: 20px; }

/* ----- 双列网格 ----- */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.grid-2col .card { margin-bottom: 0; }

/* ----- 进度条 ----- */
.progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.progress-item:last-child { border-bottom: none; }

.progress-info {
    flex: 1;
    min-width: 0;
}
.progress-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.progress-meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.progress-bar-wrap {
    flex: 2;
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
    background: var(--primary);
}
.progress-bar-fill.low { background: var(--danger); }
.progress-bar-fill.mid { background: var(--warning); }
.progress-bar-fill.high { background: var(--primary); }
.progress-bar-fill.done { background: var(--success); }

.progress-pct {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: right;
}
.progress-days {
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 55px;
    text-align: right;
}
.progress-days.urgent { color: var(--danger); font-weight: 600; }

/* ----- 项目列表 ----- */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.85rem;
    font-family: var(--font);
    cursor: pointer;
}
.filter-search {
    flex: 1;
    min-width: 200px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.85rem;
    font-family: var(--font);
}
.filter-search:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.project-list { display: flex; flex-direction: column; gap: 12px; }

.project-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
}
.project-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.project-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.project-card-title {
    font-weight: 600;
    font-size: 1rem;
}

.project-card-body {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.project-card-body .progress-bar-wrap {
    flex: 1;
    max-width: 200px;
}

.project-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

/* ----- 徽章 ----- */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-planning { background: var(--info); color: #fff; }
.badge-active { background: var(--primary); color: #fff; }
.badge-paused { background: var(--warning); color: #000; }
.badge-completed { background: var(--success); color: #fff; }
.badge-archived { background: var(--text-muted); color: #fff; }

.badge-low { background: var(--text-muted); color: #fff; }
.badge-medium { background: var(--info); color: #fff; }
.badge-high { background: var(--warning); color: #000; }
.badge-critical { background: var(--danger); color: #fff; }

.badge-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* ----- 按钮 ----- */
.btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--font);
    transition: all var(--transition);
    white-space: nowrap;
}
.btn:hover { box-shadow: var(--shadow); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--bg-card); color: var(--text); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm { padding: 4px 12px; font-size: 0.78rem; }
.btn-xs { padding: 2px 8px; font-size: 0.72rem; border-radius: 4px; }

/* ----- 模态框 ----- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40px;
    animation: fadeIn 0.2s;
}
.modal-overlay.open { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.25s;
}
.modal-sm { max-width: 400px; }

@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal-header h2, .modal-header h3 { font-size: 1.1rem; }

.btn-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
}
.btn-close:hover { background: var(--danger-light); color: var(--danger); }

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
}

/* ----- 表单 ----- */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}
.form-group .required { color: var(--danger); }
.form-group small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: all var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ----- 项目详情 ----- */
.detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.detail-back {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 1rem;
}
.detail-back:hover { background: var(--primary-light); }
.detail-title { font-size: 1.3rem; font-weight: 700; flex: 1; }

.detail-meta {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.detail-meta-item { font-size: 0.85rem; }
.detail-meta-item .meta-label { color: var(--text-secondary); font-size: 0.75rem; }
.detail-meta-item .meta-value { font-weight: 600; margin-top: 2px; }

.detail-description {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}
.detail-description h3 { margin-bottom: 10px; font-size: 0.95rem; }
.detail-description p { font-size: 0.88rem; color: var(--text-secondary); white-space: pre-wrap; }

/* ----- 任务列表 ----- */
.task-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.task-header h3 { font-size: 0.95rem; }

.task-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.task-title {
    flex: 1;
    font-size: 0.88rem;
}
.task-title.done {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-priority {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
}
.task-priority.p-high { background: var(--danger-light); color: var(--danger); }
.task-priority.p-medium { background: var(--warning-light); color: var(--warning); }
.task-priority.p-low { background: var(--border); color: var(--text-secondary); }

.task-deadline {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
.task-deadline.urgent { color: var(--danger); font-weight: 600; }

.task-delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: all var(--transition);
}
.task-item:hover .task-delete { opacity: 1; }
.task-delete:hover { background: var(--danger-light); color: var(--danger); }

.add-task-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.add-task-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 0.85rem;
    font-family: var(--font);
}
.add-task-input:focus {
    outline: none;
    border-color: var(--primary);
    border-style: solid;
}

/* ----- Toast 通知 ----- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.85rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ----- 文本辅助 ----- */
.text-muted { color: var(--text-muted); font-size: 0.88rem; text-align: center; padding: 20px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }

/* ----- 禁用输入框 ----- */
.form-group input:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}
.lock-icon { font-size: 0.85rem; margin-left: 4px; }

/* ----- Markdown 内容 ----- */
.md-content { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.7; }
.md-content h1, .md-content h2, .md-content h3 { color: var(--text); margin: 12px 0 6px; }
.md-content h1 { font-size: 1.2rem; }
.md-content h2 { font-size: 1.05rem; }
.md-content h3 { font-size: 0.95rem; }
.md-content p { margin-bottom: 8px; }
.md-content ul, .md-content ol { margin: 6px 0 6px 20px; }
.md-content li { margin-bottom: 2px; }
.md-content code { background: var(--primary-light); padding: 2px 6px; border-radius: 3px; font-size: 0.82rem; }
.md-content pre { background: var(--bg); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; margin: 8px 0; }
.md-content pre code { background: none; padding: 0; }
.md-content blockquote { border-left: 3px solid var(--primary); padding-left: 12px; color: var(--text-muted); margin: 8px 0; }
.md-content a { color: var(--primary); }
.md-content hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* ----- 甘特图 / 时间线 ----- */
.gantt-legend { margin-left: 12px; display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; }
.gantt-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }

.gantt-wrap { overflow-x: auto; }
.gantt-table { width: 100%; min-width: 700px; border-collapse: collapse; }
.gantt-table th, .gantt-table td { padding: 8px 10px; text-align: left; }
.gantt-table th { font-size: 0.78rem; color: var(--text-secondary); font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap; }
.gantt-table td { border-bottom: 1px solid var(--border); font-size: 0.82rem; }

.gantt-project-name { font-weight: 500; cursor: pointer; }
.gantt-project-name:hover { color: var(--primary); }

.gantt-bar-col { width: 50%; }
.gantt-bar-bg { position: relative; height: 22px; background: var(--bg); border-radius: 4px; overflow: hidden; min-width: 100px; }
.gantt-bar-fill { position: absolute; top: 0; height: 100%; border-radius: 4px; opacity: 0.85; min-width: 4px; transition: width 0.4s ease; }
.gantt-bar-fill.status-active { background: var(--primary); }
.gantt-bar-fill.status-completed { background: var(--success); }
.gantt-bar-fill.status-planning { background: var(--warning); }
.gantt-bar-fill.status-paused { background: var(--text-muted); }
.gantt-bar-fill.overdue { background: var(--danger); }

.gantt-today-line { position: absolute; top: 0; width: 2px; height: 100%; background: var(--danger); z-index: 2; }
.gantt-today-label { font-size: 0.7rem; color: var(--danger); font-weight: 600; }

.gantt-date { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.gantt-months { display: flex; margin-bottom: 4px; padding-left: 200px; }
.gantt-month { font-size: 0.7rem; color: var(--text-muted); text-align: center; border-left: 1px solid var(--border); }

/* ----- 任务拖拽排序 ----- */
.task-item { cursor: grab; }
.task-item:active { cursor: grabbing; }
.task-item.dragging { opacity: 0.4; background: var(--bg); }
.task-item.drag-over { border-top: 3px solid var(--primary); padding-top: 13px; }
.task-drag-handle { cursor: grab; color: var(--text-muted); margin-right: 2px; user-select: none; }
.task-expand {
    cursor: pointer; font-size: 0.65rem; color: var(--text-muted);
    width: 14px; flex-shrink: 0; text-align: center; user-select: none;
    transition: transform 0.2s;
}
.task-expand:hover { color: var(--primary); }
.task-children { /* container for sub-tasks */ }
.task-btn {
    background: none; border: none; cursor: pointer; font-size: 0.85rem;
    padding: 2px 5px; border-radius: 3px; opacity: 0.6; transition: all var(--transition);
}
.task-btn:hover { opacity: 1; background: var(--primary-light); }
.task-breakdown { opacity: 0; }
.task-item:hover .task-breakdown { opacity: 0.7; }

/* ----- 批量操作栏 ----- */
.batch-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 1px dashed var(--border);
    font-size: 0.85rem;
}
.batch-check {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
    flex-shrink: 0;
    margin-right: 4px;
}

/* ----- AI 智能规划 ----- */
.ai-panel {
    background: linear-gradient(135deg, var(--primary-light), #faf5ff);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    overflow: hidden;
}
[data-theme="dark"] .ai-panel {
    background: linear-gradient(135deg, #1e1b4b, #1a1035);
}
.ai-trigger {
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}
.ai-trigger small { color: var(--text-muted); font-weight: 400; font-size: 0.78rem; }
.ai-trigger:hover { background: rgba(79,70,229,0.05); }
.ai-body { padding: 0 16px 16px 16px; }
.ai-loading {
    margin-top: 10px;
    padding: 10px;
    color: var(--primary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ai-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-error {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--danger-light);
    color: var(--danger);
    border-radius: 4px;
    font-size: 0.82rem;
}

/* ----- 活动日志 ----- */
.activity-log { max-height: 300px; overflow-y: auto; }
.activity-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 0.9rem; flex-shrink: 0; }
.activity-detail { flex: 1; color: var(--text-secondary); }
.activity-time { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* ----- 标签云 ----- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 20px;
    background: var(--primary-light); color: var(--primary);
    cursor: pointer; font-size: 0.85rem; font-weight: 500;
    transition: all var(--transition);
}
.tag-pill:hover { transform: scale(1.05); box-shadow: var(--shadow); }
.tag-pill .tag-count { font-size: 0.72rem; opacity: 0.7; }

/* ----- 依赖关系 ----- */
.dep-section { margin-bottom: 20px; }
.dep-tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 4px; font-size: 0.8rem;
    margin: 2px 4px 2px 0;
    cursor: pointer;
}
.dep-blocks { background: var(--warning-light); color: var(--warning); }
.dep-blocked { background: var(--danger-light); color: var(--danger); }
.dep-remove { cursor: pointer; font-weight: 700; opacity: 0.5; }
.dep-remove:hover { opacity: 1; }
.blocked-badge { background: var(--danger); color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 0.7rem; font-weight: 600; }

/* ----- 内联编辑 ----- */
.inline-edit { cursor: pointer; padding: 4px 8px; border-radius: 4px; border: 1px solid transparent; transition: all var(--transition); }
.inline-edit:hover { background: var(--bg); border-color: var(--border); }
.inline-editing { background: var(--bg); border-color: var(--primary); cursor: text; }
.inline-edit textarea, .inline-edit input {
    width: 100%; border: none; outline: none; background: transparent;
    font-family: var(--font); font-size: inherit; color: var(--text);
    resize: vertical; min-height: 60px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2col { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .filter-bar { flex-direction: column; }
    .filter-search { min-width: auto; }
    .project-card-body { flex-direction: column; align-items: flex-start; }
    .project-card-body .progress-bar-wrap { max-width: 100%; }
    .modal { width: 95%; max-width: none; margin: 0 8px; }
    .detail-meta-grid { grid-template-columns: repeat(2, 1fr); }
    .main-content { padding: 16px; }
    .header { padding: 0 12px; }
    .tabs { padding: 0 8px; gap: 0; }
    .tab { padding: 10px 12px; font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 12px 16px; }
    .stat-value { font-size: 1.3rem; }
    .detail-meta-grid { grid-template-columns: 1fr; }
}
