/* 全局样式 */
:root {
    --primary-color: #1a73e8;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    --info-color: #909399;
    --bg-color: #f0f2f5;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

/* 全局表格满铺 — 保持 Element Plus fixed 布局确保表头表身对齐，强制表格宽度100% */
.el-table {
    width: 100% !important;
}
.el-table__body-wrapper table,
.el-table__header-wrapper table,
.el-table__footer-wrapper table {
    width: 100% !important;
}
/* 所有单元格内容居中 + 多行内容增加上下间距避免压抑 */
.el-table .el-table__cell {
    text-align: center !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}
/* 单元格内容不换行，长文本自动省略，行距加宽 */
.el-table .cell {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.8 !important;
}

/* 全局字体调大 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: #333;
    font-size: 15px;
}
.el-table {
    font-size: 15px !important;
}
.el-table th.el-table__cell {
    font-size: 15px !important;
    font-weight: 600;
}
.el-button {
    font-size: 14px;
}
.el-input__inner,
.el-select .el-input__inner,
.el-date-editor .el-input__inner {
    font-size: 14px;
}

#app { height: 100vh; overflow: hidden; }

/* 登录页 */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
    position: relative;
    overflow: hidden;
}
.login-container::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: pulse 8s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.5; }
}
.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 1;
}
.login-title {
    text-align: center;
    margin-bottom: 6px;
    font-size: 30px;
    color: #1a73e8;
    font-weight: 800;
    letter-spacing: 4px;
}
.login-subtitle {
    text-align: center;
    margin-bottom: 30px;
    font-size: 13px;
    color: #999;
    letter-spacing: 1px;
}
.login-demo {
    margin-top: 20px;
    padding: 12px;
    background: #f5f7fa;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
    line-height: 1.8;
}

/* 布局 */
.main-layout { height: 100vh; display: flex; }
.sidebar {
    width: 220px;
    background: #001529;
    color: white;
    overflow-y: auto;
    transition: width 0.3s;
    flex-shrink: 0;
}
.sidebar.collapsed { width: 64px; }
.sidebar-logo {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 16px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-logo .el-icon { margin-right: 8px; font-size: 24px; color: #4fc3f7; }
.sidebar-logo svg { margin-right: 8px; }
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
    height: 60px;
    background: white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.content-area { flex: 1; overflow-y: auto; padding: 20px; }

/* 卡片 */
.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-num { font-size: 24px; font-weight: 600; margin-top: 2px; }
.page-container .stat-card { flex-direction: column; align-items: flex-start; gap: 0; padding: 14px 16px; }
.page-container { padding: 20px; }
.stat-icon {
    width: 56px; height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: #999; margin-top: 4px; }

.chart-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}
.chart-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

/* 表格页 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.page-title { font-size: 18px; font-weight: 600; }

/* 居中页面标题 */
.page-header-center {
    text-align: center;
    margin-bottom: 20px;
}
.page-title-center {
    font-size: 22px;
    font-weight: 700;
    color: #1a73e8;
    letter-spacing: 2px;
    display: inline-block;
    position: relative;
    padding-bottom: 8px;
}
.page-title-center::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #1a73e8, #4fc3f7);
    border-radius: 2px;
}

/* 提醒统计卡片 */
.alert-stat-card {
    background: white;
    border-radius: 10px;
    padding: 16px 14px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.25s;
    border: 2px solid transparent;
}
.alert-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.alert-stat-card.active {
    border-color: #1a73e8;
    background: #f0f7ff;
}
.alert-stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}
.alert-stat-body { flex: 1; min-width: 0; }
.alert-stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.alert-stat-label { font-size: 12px; color: #999; margin-top: 2px; }
.filter-bar {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--card-shadow);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.table-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--card-shadow);
}
.pagination-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

/* 状态标签 */
.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.status-online { background: #52c41a; }
.status-offline { background: #d9d9d9; }
.status-fault { background: #ff4d4f; }
.status-maintenance { background: #faad14; }

/* 视频巡检 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.video-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s;
}
.video-card:hover { transform: translateY(-4px); }
.video-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}
.video-thumbnail .play-icon {
    font-size: 48px;
    color: rgba(255,255,255,0.8);
}
.video-info { padding: 12px; }
.video-device { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.video-meta { font-size: 12px; color: #999; }

/* 进度条 */
.battery-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}
.battery-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

/* 响应式 */
@media (max-width: 768px) {
    .sidebar { width: 64px; }
    .sidebar .el-menu-item span { display: none; }
    .content-area { padding: 12px; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d9d9d9; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #bfbfbf; }

/* Element Plus 覆盖 */
.el-menu { border-right: none !important; }

/* 页面容器 */
.page-container { min-height: 100%; }

/* 财务看板 */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-left: 10px;
    border-left: 3px solid #1a73e8;
}
.dashboard-label {
    font-size: 14px;
    color: #909399;
    margin-bottom: 8px;
}
.dashboard-value {
    font-size: 24px;
    font-weight: 700;
}

/* 录像调度统计卡片 */
.rec-stat {
    text-align: center;
    padding: 10px 0;
}
.rec-num {
    font-size: 28px;
    font-weight: 700;
    color: #303133;
    line-height: 1.2;
}
.rec-label {
    font-size: 13px;
    color: #909399;
    margin-top: 4px;
}
