body {
    background: #f5f6fa;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    min-height: 100vh;
}

/* ===== 兜底：彻底禁止整页横向滚动 =====
   不同浏览器/缩放/字体渲染下，个别元素可能把页面撑宽几像素到几百像素，
   出现整页横向滚动条；顶栏是 sticky 定位，横向一拉就跟着滚出视野。
   真正需要横向滚动的表格已由 .table-responsive 在卡片内部自行滚动，
   不受此限制。 */
html, body {
    overflow-x: hidden;
}

/* ===== 导航栏 ===== */
.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1px;
}
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.nav-link {
    padding: 0.6rem 1rem !important;
    border-radius: 6px;
    margin: 0 2px;
    transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.15);
}
.nav-link i {
    margin-right: 4px;
}

/* ===== 导航栏防撑宽（修复：拖动页面底部横向滚动条时顶栏被移出视野） =====
   原因：导航项较多且不允许换行时，顶栏把整个页面撑宽，
   出现整页横向滚动条；顶栏是 sticky 定位，横向一拉就跟着滚走了。
   处理：允许导航项换行 + 收紧水平间距，页面不再被撑宽。 */
@media (min-width: 992px) {
    .navbar .navbar-nav { flex-wrap: wrap; }
    .navbar > .container-fluid { row-gap: 2px; }
}
.navbar .nav-link {
    padding-left: .5rem !important;
    padding-right: .5rem !important;
    white-space: nowrap;
}
.navbar .d-flex.align-items-center.text-white {
    flex-wrap: wrap;
    row-gap: 4px;
    justify-content: flex-end;
}
.navbar-brand { white-space: nowrap; }

/* ===== 卡片 ===== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 1rem 1.25rem;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}

/* ===== 统计卡片 ===== */
.stat-card {
    border-left: 4px solid;
    padding: 1.25rem;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}
.stat-card .stat-label {
    color: #888;
    font-size: 0.85rem;
}

/* ===== 登录页 ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a237e 0%, #283593 40%, #3949ab 100%);
}
.login-card {
    width: 420px;
    border-radius: 16px;
    overflow: hidden;
}
.login-header {
    background: linear-gradient(135deg, #3949ab, #1a237e);
    color: #fff;
    padding: 2rem;
    text-align: center;
}
.login-header h3 {
    margin-bottom: 0.3rem;
    font-weight: 700;
}
.login-header p {
    opacity: 0.8;
    font-size: 0.9rem;
    margin: 0;
}
.login-body {
    padding: 2rem 2rem 1.5rem;
}

/* ===== 任务状态 ===== */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}
.status-pending { background: #fff3e0; color: #e65100; }
.status-done { background: #e8f5e9; color: #2e7d32; }
.status-overdue { background: #ffebee; color: #c62828; }
.priority-urgent { background: #ffebee; color: #c62828; }
.priority-important { background: #fff3e0; color: #e65100; }
.priority-normal { background: #e3f2fd; color: #1565c0; }

/* ===== 表格 ===== */
.table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}
.table td {
    vertical-align: middle;
}
.table-hover tbody tr:hover {
    background: #f0f4ff;
}

/* ===== 搜索框 ===== */
.search-box {
    position: relative;
}
.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}
.search-box input {
    padding-left: 35px;
    border-radius: 8px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .login-card { width: 95%; }
    .stat-card .stat-value { font-size: 1.5rem; }
}

/* 文件上传区域 */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafbfc;
}
.upload-area:hover {
    border-color: #3949ab;
    background: #f0f2ff;
}
.upload-area.drag-over {
    border-color: #3949ab;
    background: #e8eaf6;
}
.upload-area i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 0.5rem;
}

/* 进度条 */
.progress-thin {
    height: 6px;
    border-radius: 3px;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 2px;
    background: #e3f2fd;
    color: #1565c0;
}

/* 页脚 */
.app-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    background: #fff;
    border-top: 1px solid #eee;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
}

/* Toast */
.toast-container {
    z-index: 9999;
}
