/* 代码编辑器风格主题 */
:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #2d2d30;
    --text-primary: #ffffff;
    --text-secondary: #ffffff;
    --text-accent: #569cd6;
    --border-color: #3e3e42;
    --success: #4ec9b0;
    --warning: #ffcc02;
    --error: #f44747;
}

* {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 导航栏样式 - 电脑版对齐优化 */
.header-four {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.nav_section {
    padding: 12px 0;
}

/* 导航栏容器布局优化 */
.navbar-expand-md.navbar-dark {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

.navbar-brand {
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
}

.navbar-brand img {
    height: 40px;
    width: auto;
}

/* 导航菜单容器 */
.navbar-collapse {
    flex-grow: 0;
}

/* 导航链接样式 - 电脑版 */
.main-menu {
    display: flex;
    align-items: center;
    margin: 0;
    list-style: none;
    padding: 0;
}

.main-menu .nav-link {
    color: var(--text-primary) !important;
    font-size: 16px;
    padding: 10px 18px !important;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 0 8px;
    transition: all 0.3s;
    white-space: nowrap;
    display: block;
    font-weight: bold;
    font-style: normal;
}

.main-menu .nav-link:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-accent) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.navbar-toggler {
    border-color: var(--border-color);
    order: 2;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 标题区域 */
.banner-area {
    background-color: var(--bg-secondary);
    padding: 40px 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.banner-text h1 {
    color: var(--text-accent);
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    font-style: normal;
}

.banner-text span {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: bold;
    font-style: normal;
}

/* 主要内容区域 */
.container-fluid {
    padding: 20px;
}

/* 加载指示器 */
#loading-notice {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-style: normal;
}

.progress {
    background-color: var(--bg-tertiary);
    border-radius: 3px;
    height: 6px;
    margin: 20px auto;
    max-width: 500px;
}

.progress-bar-warning {
    background-color: var(--text-accent);
}

.progress-striped .progress-bar {
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    background-size: 10px 10px;
}

/* 服务器状态表格 - 桌面版 */
.zh-table {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    table-layout: fixed;
    width: 100%;
}

.zh-table thead th {
    background-color: var(--bg-tertiary);
    color: var(--text-accent);
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    padding: 12px 8px;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
    font-style: normal;
}

/* 隐藏交换分区列 */
.zh-table thead th#expand_swap,
.zh-table tbody td:nth-child(12) {
    display: none;
}

/* 表格数据单元格 - 全部加粗 */
.zh-table tbody td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    text-align: center;
    vertical-align: middle;
    word-wrap: break-word;
    font-size: 13px;
    font-weight: bold;
    font-style: normal;
}

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

.zh-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* 进度条样式 - 统一设置为75%宽度并居中 */
.zh-table .progress {
    height: 20px;
    margin: 0 auto;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    width: 75%;
}

.zh-table .progress-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: width 0.6s ease;
    position: relative;
}

.zh-table .progress-bar small, 
.zh-table .progress-bar span {
    text-align: center;
    width: 100%;
    position: absolute;
    left: 0;
    color: #fff;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
    font-size: 12px;
    font-style: normal;
}

/* 进度条颜色 */
.zh-table .progress-bar-success {
    background-color: var(--success);
}

.zh-table .progress-bar-danger {
    background-color: var(--error);
}

.zh-table .progress-bar-warning {
    background-color: var(--warning);
}

/* 卡片区域 */
.zh-box {
    margin-top: 20px;
}

.page-padding {
    padding: 10px;
}

.panel-block {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s;
    height: 100%;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-style: normal;
}

.panel-block:hover {
    border-color: var(--text-accent);
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.location-header h3 {
    color: var(--text-accent);
    font-size: 18px;
    margin: 0;
    display: flex;
    align-items: center;
    text-align: center;
    font-weight: bold;
    font-style: normal;
}

.location-header h3 img {
    height: 24px;
    margin-right: 10px;
}

.text-success {
    color: var(--success) !important;
    font-weight: bold;
    font-style: normal;
}

.text-error {
    color: var(--error) !important;
    font-weight: bold;
    font-style: normal;
}

.location-progress {
    margin-bottom: 15px;
}

.location-progress .progress {
    height: 6px;
}

.location-info {
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--text-primary);
    text-align: center;
    font-style: normal;
}

.location-info li {
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    font-style: normal;
}

.list-label {
    color: var(--text-secondary);
    font-weight: bold;
    font-style: normal;
}

/* 页脚 */
footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    text-align: center;
    margin-top: 40px;
    color: var(--text-primary);
}

footer p {
    font-weight: bold;
    font-style: normal;
}

/* 手机版适配 - 修复导航菜单向下展开问题 */
@media (max-width: 768px) {
    .banner-text h1 {
        font-size: 24px;
    }
    
    .banner-text span {
        font-size: 14px;
        font-weight: bold;
        font-style: normal;
    }
    
    .container-fluid {
        padding: 10px;
    }
    
    /* 手机版只保留运行状态、名称、CPU、RAM、ROM */
    .zh-table thead th:not(#status4):not(#name):not(#cpu):not(#ram):not(#rom),
    .zh-table tbody td:not(:nth-child(1)):not(:nth-child(2)):not(:nth-child(14)):not(:nth-child(15)):not(:nth-child(16)) {
        display: none;
    }
    
    /* 调整手机版保留列的宽度分配 */
    .zh-table thead th#status4,
    .zh-table tbody td:nth-child(1) {
        width: 20%;
    }
    
    .zh-table thead th#name,
    .zh-table tbody td:nth-child(2) {
        width: 35%;
    }
    
    .zh-table thead th#cpu,
    .zh-table tbody td:nth-child(14) {
        width: 15%;
    }
    
    .zh-table thead th#ram,
    .zh-table tbody td:nth-child(15) {
        width: 15%;
    }
    
    .zh-table thead th#rom,
    .zh-table tbody td:nth-child(16) {
        width: 15%;
    }
    
    /* 调整表格列宽 */
    .zh-table thead th,
    .zh-table tbody td {
        padding: 8px 4px;
        font-size: 12px;
        font-weight: bold;
        font-style: normal;
    }
    
    /* 手机版进度条文本更小但保持加粗 */
    .zh-table .progress-bar small, 
    .zh-table .progress-bar span {
        font-size: 10px;
        font-weight: bold;
        font-style: normal;
    }
    
    /* 手机版导航菜单布局调整 - 确保向下展开 */
    .navbar-expand-md.navbar-dark {
        flex-wrap: wrap;
    }
    
    .navbar-collapse {
        flex-basis: 100%;
        flex-grow: 1;
        order: 3;
        margin-top: 15px;
        width: 100%;
        background-color: var(--bg-secondary);
        border-top: 1px solid var(--border-color);
        padding: 15px 0;
    }
    
    .main-menu {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }
    
    .main-menu .nav-item {
        width: 100%;
        margin-bottom: 12px;
        text-align: center;
    }
    
    .main-menu .nav-link {
        width: 100%;
        text-align: center;
        margin: 0;
        font-size: 16px !important;
        padding: 12px 16px !important;
        display: block;
        box-sizing: border-box;
        font-weight: bold;
        font-style: normal;
    }
    
    /* 确保汉堡菜单在右侧 */
    .navbar-toggler {
        order: 2;
        margin-left: auto;
    }
    
    /* 卡片在手机上单列显示 */
    .cards-container {
        grid-template-columns: 1fr;
    }
    
    .panel-block {
        padding: 12px;
        font-style: normal;
    }
    
    .location-header h3 {
        font-size: 16px;
        font-weight: bold;
        font-style: normal;
    }
    
    /* 手机版卡片数据无斜体 */
    .location-info li {
        font-weight: bold;
        font-style: normal;
    }
}

/* 小屏幕手机适配 */
@media (max-width: 576px) {
    .banner-text h1 {
        font-size: 20px;
    }
    
    .banner-text span {
        font-size: 12px;
        font-weight: bold;
        font-style: normal;
    }
    
    .zh-table thead th,
    .zh-table tbody td {
        padding: 6px 2px;
        font-size: 11px;
        font-weight: bold;
        font-style: normal;
    }
    
    /* 进度条更小 */
    .zh-table .progress {
        height: 16px;
    }
    
    .zh-table .progress-bar small, 
    .zh-table .progress-bar span {
        font-size: 9px;
        font-weight: bold;
        font-style: normal;
    }
    
    /* 小屏幕手机导航链接调整 */
    .main-menu .nav-link {
        font-size: 15px !important;
        padding: 10px 14px !important;
        font-weight: bold;
        font-style: normal;
    }
}

/* 超小屏幕适配 */
@media (max-width: 400px) {
    .banner-text h1 {
        font-size: 18px;
    }
    
    .banner-text span {
        font-size: 12px;
        font-weight: bold;
        font-style: normal;
    }
    
    .zh-table thead th,
    .zh-table tbody td {
        font-size: 10px;
        font-weight: bold;
        font-style: normal;
    }
    
    /* 超小屏幕导航链接调整 */
    .main-menu .nav-link {
        font-size: 14px !important;
        padding: 10px 12px !important;
        font-weight: bold;
        font-style: normal;
    }
}

/* 电脑版特定优化 */
@media (min-width: 769px) {
    /* 确保导航栏元素垂直居中对齐 */
    .navbar-expand-md.navbar-dark {
        align-items: center;
        flex-wrap: nowrap;
    }
    
    /* 导航菜单右对齐 */
    .navbar-collapse {
        justify-content: flex-end;
        flex-basis: auto;
        order: 2;
    }
    
    /* 导航链接间距优化 */
    .main-menu .nav-link {
        margin: 0 10px;
        font-weight: bold;
        font-style: normal;
    }
    
    /* 隐藏汉堡菜单 */
    .navbar-toggler {
        display: none;
    }
}