/* ========== 公共页面基础样式 ========== */
body {
    display: block;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f1923 0%, #1a2a3a 50%, #1e3348 100%);
    background-attachment: fixed;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.page-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 20px 16px;
}

.page-title {
    color: #e2e8f0;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

/* ========== 卡片容器 ========== */
.card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.card-title {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ========== 通用表格样式 ========== */
.styled-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    color: #cbd5e1;
    font-size: 14px;
}

.styled-table thead th {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    font-weight: 500;
    font-size: 13px;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(99, 102, 241, 0.25);
    white-space: nowrap;
}

.styled-table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.styled-table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.styled-table tbody tr {
    transition: background 0.2s;
}

.styled-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.styled-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.styled-table tbody tr:last-child td {
    border-bottom: none;
}

/* 状态列强制不换行 */
.styled-table tbody td .status-tag {
    white-space: nowrap;
}

/* KV 表格（两列：属性名-属性值） */
.styled-table.kv-table tbody td:first-child {
    color: #94a3b8;
    font-weight: 500;
    white-space: nowrap;
    width: 130px;
}

.styled-table.kv-table tbody td:last-child {
    color: #e2e8f0;
}

/* ========== 信息网格（多指标展示） ========== */
.info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 8px 0;
}

.info-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    min-width: 120px; /* 保证每个项目有最小宽度 */
}

.info-grid .info-label {
    color: #94a3b8;
}

.info-grid .info-value {
    color: #e2e8f0;
    font-weight: 500;
}

/* ========== 状态标签 ========== */
.status-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap; /* 确保状态标签不换行 */
}

.status-tag.online { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.status-tag.offline { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.status-tag.normal { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.status-tag.error { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.status-tag.limited { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.status-tag.locked { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* ========== 链接样式 ========== */
.styled-table a, .card a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.2s;
}

.styled-table a:hover, .card a:hover {
    color: #93bbfc;
    text-decoration: underline;
}

/* ========== 按钮样式 ========== */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

/* 快捷入口按钮：四列均匀网格 */
.btn-row.shortcut-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 0;
}

.btn-action {
    padding: 8px 20px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    white-space: nowrap;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-action:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.6);
    color: #c7d2fe;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.btn-action.btn-primary {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
    color: #c7d2fe;
}

.btn-action.btn-danger {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.btn-action.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-action.btn-warning {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
}

.btn-action.btn-warning:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

/* 邮件未读徽标 */
.mail-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    padding: 0 4px;
}

/* ========== 复选框美化 ========== */
.styled-table input[type="checkbox"] {
    accent-color: #6366f1;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ========== 邮件图标 ========== */
.mail-icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: middle;
}

/* ========== 分页覆盖（bootstrap-table） ========== */
/* 自定义分页容器 */
#mail-pager {
    display: flex;
    justify-content: center; /* 居中分页按钮 */
    gap: 4px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.fixed-table-pagination .pagination a {
    color: #a5b4fc !important;
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: rgba(99, 102, 241, 0.25) !important;
}

.fixed-table-pagination .pagination .active a {
    background: rgba(99, 102, 241, 0.3) !important;
    color: #fff !important;
}

.fixed-table-pagination .page-list, .fixed-table-pagination .pagination-detail {
    color: #94a3b8 !important;
}

.fixed-table-container {
    border: none !important;
}

.fixed-table-body {
    border: none !important;
}

/* ========== 提示文本 ========== */
.hint-text {
    color: #64748b;
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
}

/* ========== 响应式 ========== */
@media (max-width: 600px) {
    .page-container {
        padding: 12px 10px;
    }

    .card {
        padding: 14px;
        overflow-x: auto; /* 表格横向滚动 */
    }

    .styled-table {
        font-size: 13px;
        min-width: 100%; /* 确保表格不会挤压 */
    }

    .styled-table thead th,
    .styled-table tbody td {
        padding: 8px 10px;
        white-space: nowrap; /* 手机端表格禁止换行，改为横向滚动 */
    }

    .btn-action {
        padding: 8px 14px;
        font-size: 13px;
    }

    .info-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px 12px;
    }
    
    .info-item {
        min-width: 0;
        width: auto;
    }
    
    /* 快捷入口手机端改为两列 */
    .btn-row.shortcut-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* 普通按钮行居中 */
    .btn-row {
        justify-content: center;
    }
}
