/* 全局样式 */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f9fafb;
    color: var(--gray-800);
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.main-header {
    background: white;
    border-radius: var(--radius);
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--gray-800);
}

.logo i {
    color: var(--primary);
    margin-right: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.welcome {
    color: var(--gray-600);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    background-color: white;
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.btn:hover {
    background-color: var(--gray-100);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* 部门筛选 */
.dept-filter {
    background: white;
    border-radius: var(--radius);
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-label {
    color: var(--gray-600);
    font-weight: 500;
}

.filter-btn {
    padding: 6px 16px;
    border-radius: 30px;
    background-color: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-btn:hover {
    background-color: var(--gray-200);
}

.filter-btn.active {
    background-color: var(--primary);
    color: white;
}

/* 项目网格 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.project-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.project-card.has-delay {
    border-left: 4px solid var(--danger);
}

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

.type-badge {
    padding: 4px 12px;
    border-radius: 30px;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

.stage {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.topic {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--gray-800);
}

.meta-row {
    display: flex;
    justify-content: space-between;
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* 进度条 */
.progress-area {
    margin-bottom: 16px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.progress-bar {
    height: 8px;
    background-color: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--success);
    border-radius: 4px;
    transition: width 0.3s;
}

/* 延误警告 */
.delay-warning {
    background-color: #fef2f2;
    color: var(--danger);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.remarks {
    background-color: var(--gray-100);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

.view-detail {
    margin-left: auto;
    color: var(--primary);
}

/* 状态颜色 */
.status-doing { color: var(--primary); }
.status-done { color: var(--success); }
.status-pending { color: var(--warning); }
.status-queuing { color: var(--gray-500); }

/* 项目详情页 */
.project-detail {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-600);
    text-decoration: none;
    margin-bottom: 20px;
}

.back-btn:hover {
    color: var(--primary);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.detail-header h2 {
    font-size: 2rem;
    color: var(--gray-800);
}

.header-meta {
    display: flex;
    gap: 12px;
}

.badge {
    padding: 6px 16px;
    border-radius: 30px;
    color: white;
    font-weight: 500;
}

.badge.stage {
    background-color: var(--gray-500);
}

.detail-info {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    background-color: var(--gray-100);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    flex-direction: column;
}

.info-row label {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.info-row span {
    font-size: 1rem;
    font-weight: 500;
}

.info-row.delay span {
    color: var(--danger);
}

/* 任务列表 */
.section-title {
    margin: 24px 0 16px;
    font-size: 1.5rem;
}

.task-actions {
    margin-bottom: 20px;
}

.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-card {
    background-color: var(--gray-100);
    border-radius: var(--radius);
    padding: 16px;
    border-left: 3px solid var(--gray-400);
}

.task-card.overdue {
    border-left-color: var(--danger);
    background-color: #fff5f5;
}

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

.task-header h4 {
    font-size: 1.1rem;
    color: var(--gray-800);
}

.task-status {
    padding: 2px 10px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    background-color: white;
}

.task-description {
    color: var(--gray-600);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.delay-reason {
    color: var(--danger);
    font-size: 0.85rem;
    margin: 8px 0;
    padding: 4px 8px;
    background-color: #fff0f0;
    border-radius: 4px;
}

.task-remarks {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin: 8px 0;
    padding: 8px;
    background-color: white;
    border-radius: 4px;
}

.task-images {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.task-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--gray-300);
}

.task-footer-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-300);
}

/* 评论区 */
.comment-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.comment-form {
    display: flex;
    gap: 12px;
    margin: 16px 0;
}

.comment-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
}

.comments-list {
    margin-top: 16px;
}

.comment-item {
    background-color: var(--gray-100);
    padding: 12px;
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.comment-time {
    color: var(--gray-500);
    font-size: 0.8rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state.small {
    padding: 30px;
}

/* 后台管理样式 */
.admin-body {
    background-color: var(--gray-100);
}

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

.sidebar {
    width: 260px;
    background-color: var(--gray-800);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--gray-700);
}

.sidebar-header h2 {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.sidebar-header p {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--gray-300);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    background-color: var(--gray-700);
    color: white;
}

.sidebar-nav a.active {
    background-color: var(--primary);
    color: white;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
}

.admin-header {
    background: white;
    padding: 20px 24px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 数据表格 */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    border-collapse: collapse;
    overflow: hidden;
}

.data-table th {
    background-color: var(--gray-100);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.data-table tr:hover {
    background-color: var(--gray-50);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    padding: 6px;
    border-radius: 4px;
    color: var(--gray-600);
    text-decoration: none;
}

.btn-icon:hover {
    background-color: var(--gray-200);
}

.btn-icon.delete:hover {
    background-color: #fee2e2;
    color: var(--danger);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary);
}

.stat-info h3 {
    font-size: 1.8rem;
    line-height: 1.2;
}

.stat-info p {
    color: var(--gray-500);
}

/* 表单样式 */
.form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* 登录页面 */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    color: var(--primary);
    margin-bottom: 16px;
}

.login-header h2 {
    margin-bottom: 8px;
    color: var(--gray-800);
}

.login-header p {
    color: var(--gray-500);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--gray-700);
}

.login-form input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
}

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

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 20px;
    border-radius: var(--radius);
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* 警告 */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.alert-error {
    background-color: #fee2e2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        display: none;
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
/* 项目表格样式 */
.projects-table-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.project-table {
    width: 100%;
    border-collapse: collapse;
}

.project-table th {
    text-align: left;
    padding: 12px 8px;
    background: #f9fafb;
    color: #4b5563;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 2px solid #e5e7eb;
}

.project-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

.project-table tbody tr:hover {
    background: #f9fafb;
}

.progress-small {
    width: 60px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-small .progress-bar {
    height: 100%;
    background: #2563eb;
    border-radius: 3px;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon.delete:hover {
    background: #fee2e2;
    color: #ef4444;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}
/* 通知图标 */
.notification-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    color: #a0aec0;
    font-size: 20px;
}

.notification-icon:hover {
    color: white;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* 通知面板 */
.notification-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.notification-panel.show {
    right: 0;
}

.notification-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.notification-header h3 {
    flex: 1;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.notification-header .mark-all-read {
    padding: 6px 12px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 10px;
}

.notification-header .mark-all-read:hover {
    background: #1d4ed8;
}

.notification-header .close-panel {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
}

.notification-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.notification-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f8fafc;
}

.notification-item.unread {
    background: #eff6ff;
}

.notification-icon-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.notification-icon-small.mention { background: #2563eb; }
.notification-icon-small.reply { background: #10b981; }
.notification-icon-small.comment { background: #8b5cf6; }
.notification-icon-small.update { background: #f59e0b; }

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 4px;
    font-size: 14px;
}

.notification-text {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 4px;
}

.notification-time {
    color: #94a3b8;
    font-size: 11px;
}

.loading {
    text-align: center;
    color: #64748b;
    padding: 30px;
}
/* 完成类型标签 */
.completion-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.completion-badge.archived {
    background: #10b981;
    color: white;
}
.completion-badge.archive-done {
    background: #f59e0b;
    color: white;
}

/* 表格行状态区分 */
tr.archive-completed-row td {
    background-color: #fffbeb; /* 浅黄色背景区分 */
}
tr.archive-completed-row:hover td {
    background-color: #fef3c7;
}
/* 项目简介大框样式 */
.project-description-box {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.description-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.description-header i {
    color: #2563eb;
    font-size: 18px;
}

.description-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.description-length {
    margin-left: auto;
    font-size: 12px;
    color: #64748b;
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 30px;
}

.description-content {
    padding: 20px;
    line-height: 1.6;
    color: #334155;
    font-size: 14px;
    max-height: 300px;
    overflow-y: auto;
}

/* 富文本内容样式 */
.description-content p {
    margin: 0 0 10px 0;
}

.description-content ul, 
.description-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.description-content h1, 
.description-content h2, 
.description-content h3 {
    margin: 15px 0 10px 0;
}

.description-content img {
    max-width: 100%;
    height: auto;
}

.description-empty {
    color: #94a3b8;
    text-align: center;
    padding: 30px;
    font-style: italic;
}

.description-empty i {
    margin-right: 8px;
}

/* 可选：添加展开/收起功能 */
.description-content.collapsed {
    max-height: 150px;
    overflow: hidden;
    position: relative;
}

.description-content.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, white);
}

.description-toggle {
    text-align: center;
    padding: 10px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    cursor: pointer;
    color: #2563eb;
    font-size: 13px;
}

.description-toggle:hover {
    background: #f1f5f9;
}