/* ========== 全局样式 ========== */
body {
    margin: 0; /* 移除默认的 body margin */
    padding: 0; /* 移除默认的 body padding */
    font-family: Arial, sans-serif;
    display: block; /* 使用块级布局，避免 flex 导致的上下居中 */
}
.container {
    padding-top: 20px; /* 为内容顶部留出间距 */
    padding-bottom: 30px; /* 为 footer 留出空间 */
}

/* 页眉样式 */
h2 {
    margin-top: 0; /* 取消默认的 h2 顶部 margin */
    padding-top: 0px; /* 为标题添加合适的顶部间距 */
    font-size: 24px; /* 设置标题字体大小 */
    text-align: center; /* 居中标题 */
}

/* ========== 页脚样式 ========== */
.footer {
    width: 100%;
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 0; /* 移除内边距 */
    height: 50px; /* 设置与顶部导航栏相同的高度 */
    line-height: 15px; /* 垂直居中文本 */
    position: fixed; /* 固定在页面底部 */
    bottom: 0;
    left: 0;
    font-size: 14px;
}

/* 顶部导航栏样式 */
.navbar {
    width: 100%;
    background-color: #2c3e50;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    padding: 10px 0;
    z-index: 1000;
    height: 40px; /* 设置导航栏的高度 */
    line-height: 40px; /* 垂直居中文本 */
}

.navbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.navbar ul li {
    margin: 0 15px;
}

.navbar ul li a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    font-size: 16px;
    transition: background 0.3s;
}

.navbar ul li a:hover {
    background-color: #1a252f;
    border-radius: 5px;
}

.navbar ul li strong,
.navbar ul li span {
    color: white;
}

/* 主体内容区域 */
.content {
    margin-top: 70px; /* 适应固定顶部导航栏 */
    padding: 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* 标题样式 */
h1, h2 {
    color: #333;
    text-align: center;
    margin-top: 20px;
}

/* 表单样式 */
form {
    max-width: 600px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

label {
    display: block;
    font-weight: bold;
    margin: 10px 0 5px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 8px;
    margin: 5px 0 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 100px;
}

/* 按钮样式 */
button {
    width: 100%;
    background-color: #3498db;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: #2980b9;
}

.btn {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
}

.btn.danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-warning {
    background-color: #ffc107;
    color: #333;
}

.btn:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.btn.danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.data-table th,
.data-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.data-table th {
    background-color: #007bff;
    color: white;
    font-weight: 500;
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    max-width: 500px; /* 根据100个字符的平均宽度设置（可根据实际情况调整） */
    word-wrap: break-word; /* 允许长单词换行 */
    vertical-align: top; /* 内容顶部对齐，避免换行后布局错乱 */
}

/* 新增列分隔线样式 */
.table th,
.table td {
    border-right: 1px solid #e0e0e0; /* 列分隔线 */
    padding: 12px 15px; /* 增加单元格内边距 */
}

/* 最后一列不需要右边框 */
.table th:last-child,
.table td:last-child {
    border-right: none;
}

/* 保持原有行分隔线 */
.table tbody tr {
    border-bottom: 1px dashed #ddd; /* 保留原有行分隔虚线 */
}

/* 表头底部实线分隔 */
.table thead tr {
    border-bottom: 2px solid #666;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #34495e;
    color: white;
}

tr:hover {
    background-color: #f5f5f5;
}

/* 到期宽带账号高亮显示 */
.expired {
    background-color: #ffdddd !important;
}

/* 机房租约即将到期高亮 */
.due-soon {
    background-color: #fff3cd !important;
}

/* 响应式布局 */
@media (max-width: 768px) {
   .navbar {
        flex-direction: column;
        text-align: center;
    }

   .navbar ul {
        flex-direction: column;
    }

   .navbar ul li {
        margin-bottom: 10px;
    }

   .content {
        padding: 10px;
        margin-top: 80px; /* 适配移动端 */
    }
}

/* 状态颜色样式 */
.expired {
    background-color: #ffcccc !important; /* 已到期（红色） */
    color: #b30000;
}

.warning {
    background-color: #fff3cd !important; /* 一周内到期（黄色） */
    color: #856404;
}

.active {
    background-color: #d4edda !important; /* 未到期（绿色） */
    color: #155724;
}

/* 管理机房列表状态的颜色 */
table tr.expired {
    background-color: #ffcccc; /* 红色背景，表示已到期 */
}

table tr.warning {
    background-color: #fff4cc; /* 黄色背景，表示一周内到期 */
}

table tr.active {
    background-color: #ccffcc; /* 绿色背景，表示未到期 */
}

table td, table th {
    padding: 8px 12px;
    text-align: center;
}

table th {
    background-color: #007bff;
}

table td a {
    padding: 5px 10px;
    margin: 0 5px;
    text-decoration: none;
    border-radius: 5px;
}

table td a.btn-primary {
    background-color: #4CAF50;
    color: white;
}

table td a.btn-warning {
    background-color: #ff9800;
    color: white;
}

table td a.btn-danger {
    background-color: #f44336;
    color: white;
}

/* 操作栏统一样式 */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    gap: 10px;
}

/* 列控制样式 */
.column-control {
    position: relative;
    display: inline-block;
    margin: 10px 0;
}

.column-menu {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    padding: 10px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    min-width: 150px;
    top: 100%;
    right: 0;
}

.column-menu.show {
    display: block;
}

.column-menu label {
    display: block;
    margin: 5px 0;
    white-space: nowrap;
}

.hidden-column {
    display: none !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
   .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
   .column-control {
        justify-content: flex-start;
    }
    
   .column-menu {
        right: auto;
        left: 0;
    }
}

/* 成功状态提示样式 */
.success-message {
    color: green;
    padding: 10px;
    background-color: #e8f5e9;
    border: 1px solid #c3e6cb;
    margin-bottom: 15px;
}

/* 错误状态提示样式 */
.error-message {
    color: red;
    padding: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    margin-bottom: 15px;
}

.error-alert {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.logical_id {
    text-transform: uppercase;
}

/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    justify-content: center;
}

.pagination a,
.pagination.records-per-page select {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #007bff;
    background: #fff;
    transition: all 0.2s;
}

.pagination a:hover,
.pagination.records-per-page select:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination.records-per-page {
    position: relative;
    display: inline-block;
    border: none; /* 去除外层框的边框 */
    padding: 0; /* 去除内边距 */
    margin: 0; /* 去除外边距 */
}

.pagination.records-per-page select {
    appearance: none;
    padding-right: 30px;
}

.pagination.records-per-page::after {
    content: "▼";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #007bff;
    pointer-events: none;
}

/* 统计栏样式 */
.stats-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin: 15px 0;
    justify-content: center;
}

.stats-bar a {
    padding: 8px 12px;
    border-radius: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.2s;
}

.stats-bar a:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 详情相关样式 */
.container.view-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.detail-card {
    max-width: 600px;  /* 控制卡片最大宽度 */
    width: 100%;
    margin: 20px 0;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 15px; /* 控制按钮间距 */
    width: 100%;
    max-width: 300px; /* 控制按钮容器宽度 */
    margin-top: 20px;
}

/* 移动端适配 */
@media (max-width: 480px) {
   .detail-actions {
        gap: 12px;
        max-width: 100%;
    }
}

/* 复制按钮动态效果 */
.copy-btn {
    transition: all 0.3s ease;
    margin-right: 10px;
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

.copy-btn:hover {
    background-color: #218838 !important;
}

.copy-btn:active {
    transform: scale(0.95);
}

/* 成功状态 */
.copy-btn[data-copied="true"] {
    background-color: #17a2b8 !important;
}

/* 修改返回按钮样式 */
.detail-actions {
    text-align: center;
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
}

/* 详情卡片样式开始 */
.detail-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.detail-row {
    margin: 15px 0;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.detail-label {
    font-weight: bold;
    color: #666;
    min-width: 120px;
    display: inline-block;
}
/* 详情卡片样式结束 */
/*详情按钮样式开始*/
/* 详情按钮颜色 */
.btn.info {
    background-color: #17a2b8; /* 青色 */
    border-color: #17a2b8;
}
.btn.info:hover {
    background-color: #138496;
}
/*详情按钮样式结束*/
.status-expired { background-color: #ffcccc; }
.status-near-expiry { background-color: #fff3cd; }
.status-active { background-color: #d4edda; }
.status-limited { background-color: #f8d7da; }

/* 添加以下样式到CSS文件 */
tr.status-faulty {
    background-color: #ffcccc;
}

/* 其他状态样式 */
tr.status-limited { background-color: #f8d7da; }
tr.status-expired { background-color: #ffe6cc; }
tr.status-active { background-color: #d4edda; }

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    justify-content: center;
}

.pagination a, .pagination .records-per-page select {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #007bff;
    background: #fff;
    transition: all 0.2s;
}

.pagination a:hover, .pagination .records-per-page select:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .records-per-page {
    position: relative;
    display: inline-block;
    border: none; /* 去除外层框的边框 */
    padding: 0; /* 去除内边距 */
    margin: 0; /* 去除外边距 */
}

.pagination .records-per-page select {
    appearance: none;
    padding-right: 30px;
}

.pagination .records-per-page::after {
    content: "▼";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #007bff;
    pointer-events: none;
}

.stats-bar {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin: 15px 0;
    justify-content: center;
}

.stats-bar a {
    padding: 8px 12px;
    border-radius: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    text-decoration: none;
    transition: all 0.2s;
}

.stats-bar a:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
}

.btn.danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn:hover {
    background-color: #0056b3;
    border-color: #004085;
}

.btn.danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.data-table th, .data-table td {
    padding: 8px 12px;
    text-align: center;
    border: 1px solid #ddd;
}    