/* 组件样式 */

/* 仪表盘头部 */
.dashboard-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    color: var(--white);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-lg);
}

.dashboard-header h1 {
    font-size: 2.5em;
    margin-bottom: var(--space-sm);
}

.dashboard-header p {
    font-size: 1.1em;
    opacity: 0.95;
}

/* 统计卡片 */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2.5em;
    margin-bottom: var(--space-sm);
}

.stat-label {
    color: var(--text-lighter);
    font-size: 0.9em;
    margin-bottom: var(--space-sm);
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.stat-sub {
    color: var(--text-light);
    font-size: 0.9em;
}

/* 项目卡片 */
.project-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border);
}

.project-title {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text);
}

.project-description {
    color: var(--text-light);
    margin-bottom: var(--space-md);
    line-height: 1.6;
}

/* 任务卡片 */
.task-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    border-left: 4px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}

.task-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(5px);
}

.task-card.completed {
    border-left-color: var(--success);
    opacity: 0.7;
}

.task-card.in-progress {
    border-left-color: var(--warning);
    background: #fff3e0;
}

.task-card.pending {
    border-left-color: var(--border);
}

.task-title {
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.task-meta {
    display: flex;
    gap: var(--space-md);
    color: var(--text-light);
    font-size: 0.9em;
}

/* Kanban看板 */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.kanban-column {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}

.kanban-header {
    font-weight: bold;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kanban-count {
    background: var(--white);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85em;
}

/* 时间线 */
.timeline {
    position: relative;
    padding-left: var(--space-lg);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--space-lg);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--primary);
}

.timeline-item.completed::before {
    background: var(--success);
    border-color: var(--success);
}

.timeline-date {
    color: var(--text-lighter);
    font-size: 0.85em;
    margin-bottom: var(--space-xs);
}

.timeline-content {
    background: var(--white);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* 团队成员卡片 */
.member-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.member-avatar {
    font-size: 3em;
    margin-bottom: var(--space-sm);
}

.member-name {
    font-weight: bold;
    margin-bottom: var(--space-xs);
}

.member-role {
    color: var(--text-light);
    font-size: 0.9em;
    margin-bottom: var(--space-sm);
}

.member-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.member-stat {
    text-align: center;
}

.member-stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary);
}

.member-stat-label {
    font-size: 0.85em;
    color: var(--text-lighter);
}

/* 图表容器 */
.chart-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-md);
}

.chart-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: var(--space-md);
    color: var(--text);
}

/* 阶段进度 */
.stage-item {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
}

.stage-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    margin-right: var(--space-md);
    flex-shrink: 0;
}

.stage-icon.completed {
    background: var(--success);
    color: var(--white);
}

.stage-icon.in-progress {
    background: var(--warning);
    color: var(--white);
}

.stage-icon.pending {
    background: var(--border);
    color: var(--text-lighter);
}

.stage-content {
    flex: 1;
}

.stage-name {
    font-weight: bold;
    margin-bottom: var(--space-xs);
}

.stage-progress {
    color: var(--text-light);
    font-size: 0.9em;
}

/* 里程碑 */
.milestone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-sm);
}

.milestone-item {
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
}

.milestone-date {
    font-size: 0.85em;
    color: var(--text-lighter);
    margin-bottom: var(--space-xs);
}

.milestone-name {
    font-weight: bold;
    color: var(--primary);
}

/* 警告框 */
.alert {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    border-left: 4px solid;
}

.alert-success {
    background: #e8f5e9;
    border-left-color: var(--success);
    color: #2e7d32;
}

.alert-warning {
    background: #fff3e0;
    border-left-color: var(--warning);
    color: #e65100;
}

.alert-danger {
    background: #ffebee;
    border-left-color: var(--danger);
    color: #c62828;
}

.alert-info {
    background: #e3f2fd;
    border-left-color: var(--info);
    color: #1565c0;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-lighter);
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: var(--space-md);
}

.empty-state-text {
    font-size: 1.1em;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text);
}

.modal-body {
    padding: var(--space-lg);
}

/* 表单控件 */
.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 任务筛选 */
.task-filters {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-light);
    border-radius: 12px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-group label {
    font-weight: 600;
    white-space: nowrap;
}

.filter-group .form-control {
    width: auto;
    min-width: 150px;
}

/* 响应式 */
@media (max-width: 768px) {
    .task-filters {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group .form-control {
        width: 100%;
    }
}

/* 导出按钮 */
.export-buttons {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

/* 打印样式 */
@media print {
    .sidebar, .export-buttons, .task-filters {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* 刷新通知 */
.refresh-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.refresh-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* 刷新按钮 */
.refresh-btn {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    margin-left: 10px;
}

.refresh-btn:hover {
    background: var(--bg-light);
    transform: scale(1.1);
}

.refresh-btn.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 加载动画 */
.loading {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
