/* 工作事项管理系统 - 主样式文件 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 80px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
    min-width: 60px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
    min-width: 120px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.form-control.error {
    border-color: #dc3545;
}

.form-control.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220,53,69,0.25);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    height: 36px;
}

.form-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.form-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background-color: #f8f9fa;
    padding: 16px 20px;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background-color: #f8f9fa;
    padding: 12px 20px;
    border-top: 1px solid #dee2e6;
    text-align: right;
}

/* 表格样式 */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table tr:hover {
    background-color: #f5f5f5;
}

.table .text-center {
    text-align: center;
}

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    list-style: none;
    align-items: center;
}

.navbar-nav li {
    margin-left: 20px;
}

.navbar-nav a {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.navbar-nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

.navbar-user {
    display: flex;
    align-items: center;
    color: white;
}

.navbar-user .dropdown {
    position: relative;
    margin-left: 15px;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    background: white;
    min-height: calc(100vh - 70px);
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    position: fixed;
    left: 0;
    top: 70px;
    z-index: 1000;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex !important;
    align-items: center !important;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 14px;
    line-height: 1.5;
    min-height: 44px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: #f8f9fa;
    border-left-color: #007bff;
    color: #007bff;
}

.sidebar-menu .icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 20px !important;
    margin-right: 12px;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0 !important;
}

/* 主内容区域 */
.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: calc(100vh - 70px);
}

/* 面包屑导航 */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
    display: flex;
    list-style: none;
}

.breadcrumb li {
    color: #6c757d;
}

.breadcrumb li:not(:last-child):after {
    content: '/';
    margin: 0 8px;
    color: #ccc;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 警告框样式 */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    position: relative;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background-color: #cce7ff;
    border-color: #b8daff;
    color: #004085;
}

.alert-dismissible {
    padding-right: 40px;
}

.alert-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #dee2e6;
    text-align: right;
}

/* 标签样式 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    text-align: center;
    white-space: nowrap;
}

.badge-primary {
    background-color: #007bff;
    color: white;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

.badge-info {
    background-color: #17a2b8;
    color: white;
}

/* 进度条样式 */
.progress {
    background-color: #e9ecef;
    border-radius: 4px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    background-color: #007bff;
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 500;
}

.progress-bar.bg-success {
    background-color: #28a745;
}

.progress-bar.bg-warning {
    background-color: #ffc107;
    color: #212529;
}

.progress-bar.bg-danger {
    background-color: #dc3545;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 20px 0;
}

.pagination li {
    margin: 0 2px;
}

.pagination a {
    display: block;
    padding: 8px 12px;
    color: #007bff;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.pagination .active a {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.pagination .disabled a {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
}

/* 日历组件样式 */
.calendar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.calendar-header {
    background-color: #007bff;
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calendar-nav {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.calendar-nav:hover {
    background-color: rgba(255,255,255,0.1);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    aspect-ratio: 1;
    border: 1px solid #dee2e6;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.calendar-day:hover {
    background-color: #f8f9fa;
}

.calendar-day.today {
    background-color: #e3f2fd;
    font-weight: bold;
}

.calendar-day.has-events {
    background-color: #fff3e0;
}

.calendar-event {
    background-color: #007bff;
    color: white;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 10px;
    margin-top: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 任务列表 */
.task-list {
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

/* 任务卡片 */
.task-card {
    border-left: 4px solid #007bff;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.task-card:hover {
    transform: translateY(-2px);
}

.task-card.priority-high {
    border-left-color: #dc3545;
}

.task-card.priority-medium {
    border-left-color: #ffc107;
}

.task-card.priority-low {
    border-left-color: #28a745;
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.task-title {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.task-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 8px;
}

.task-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.task-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* 统计仪表板样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card.success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

.stat-label {
    font-size: 14px;
    opacity: 0.9;
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.login-subtitle {
    color: #666;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px 15px;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .navbar-nav {
        margin-top: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    .modal-dialog {
        width: 95%;
        margin: 20px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .btn {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .form-control {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .login-card {
        margin: 20px;
        padding: 30px 20px;
    }
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: #6c757d; }
.text-primary { color: #007bff; }
.text-success { color: #28a745; }
.text-warning { color: #ffc107; }
.text-danger { color: #dc3545; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-block { display: inline-block; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.ml-1 { margin-left: 8px; }
.ml-2 { margin-left: 16px; }
.mr-1 { margin-right: 8px; }
.mr-2 { margin-right: 16px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

.flex-1 { flex: 1; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 16px; }

.rounded { border-radius: 4px; }
.rounded-lg { border-radius: 8px; }
.shadow { box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.shadow-lg { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }

/* 时间冲突警告样式 */
.suggested-times {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.suggested-times .btn {
    font-size: 12px;
    padding: 4px 8px;
    margin: 0;
}

#conflictWarning,
#taskConflictWarning {
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
}

#conflictWarning h5,
#taskConflictWarning h5 {
    margin-bottom: 10px;
    font-size: 16px;
}

#conflictWarning ul,
#taskConflictWarning ul {
    margin-bottom: 10px;
    padding-left: 20px;
}

#conflictWarning li,
#taskConflictWarning li {
    margin-bottom: 5px;
} 