/* style.css - 多节点Ping检测系统样式文件 */

/* 全局样式 - 电脑端保持原样 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
    background-color: #f5f7fa;
    padding: 0;
    min-width: 1200px; /* 电脑端保留最小宽度 */
}

/* 导航栏样式 - 电脑端保持原样 */
.navbar {
    background-color: #28a745;
    color: #fff;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}
.navbar-container {
    max-width: 1920px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar-logo {
    font-size: 20px;
    font-weight: 700;
}
.navbar-menu {
    display: flex;
    gap: 30px;
}
.navbar-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s;
}
.navbar-menu a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* 简化页脚样式：只保留版权 */
.footer {
    background-color: #333;
    color: #ccc;
    padding: 20px 15px;
    margin-top: 40px;
}
.footer-copyright {
    text-align: center;
    font-size: 12px;
    color: #999;
    line-height: 1.6;
}

/* 容器样式 - 电脑端保持原样 */
.container {
    width: 98%;
    max-width: 1920px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    padding: 30px;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* 检测表单样式 - 电脑端保持原样 */
.ping-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.target-input {
    width: 400px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.select-control {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 80px;
}

.operator-checkboxes {
    display: flex;
    align-items: center;
    gap: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.detect-btn {
    padding: 10px 30px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.detect-btn:hover {
    background: #218838;
}

.detect-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* 文字说明区域样式 - 电脑端保持原样 */
.info-section {
    margin-bottom: 15px;
    padding: 15px 20px;
    background: #e8f4f8;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

.info-section p {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    margin: 5px 0;
}

/* 历史记录区域样式 - 电脑端保持原样 */
.history-section {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.history-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clear-history {
    font-size: 12px;
    color: #007bff;
    cursor: pointer;
    background: none;
    border: none;
    padding: 2px 8px;
}

.clear-history:hover {
    color: #0056b3;
    text-decoration: underline;
}

.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    padding-right: 5px;
}

.history-item {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.history-item:hover {
    background: #e8f4f8;
    border-color: #28a745;
    color: #28a745;
}

.history-empty {
    color: #999;
    font-size: 13px;
    padding: 10px 0;
}

/* 结果区域样式 - 电脑端保持原样 */
.result-section {
    display: none;
    margin-top: 20px;
}

/* 强制标题显示 - 电脑端保持原样 */
#resultTitle {
    display: block !important;
    font-size: 28px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin-bottom: 20px !important;
    padding-left: 8px !important;
    border-left: 4px solid #28a745 !important;
}

/* 地图+排名父容器 - 电脑端保持原样 */
.map-rank-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
}

/* 地图容器 - 电脑端保持原样 */
.map-container {
    flex: 1;
    height: 550px !important;
    width: 100% !important;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    position: relative;
    min-width: 400px;
}

.map-progress {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255,255,255,0.9);
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

/* 排名榜容器 - 电脑端保持原样 */
.rank-container {
    flex: 1;
    height: 550px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-width: 400px;
}

/* 排名标签 - 电脑端保持原样 */
.rank-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.rank-tab {
    padding: 15px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
}

.rank-tab.active {
    color: #28a745;
    border-bottom: 2px solid #28a745;
}

/* 排名内容 - 电脑端保持原样 */
.rank-content {
    padding: 15px;
    flex: 1;
    max-height: none;
    overflow-y: auto;
    overflow-x: auto;
}

.rank-table {
    width: 100%;
    border-collapse: collapse;
}

.rank-table th {
    text-align: left;
    padding: 10px 8px;
    font-size: 13px;
    color: #333;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
}

.rank-table td {
    padding: 10px 8px;
    font-size: 13px;
    color: #555;
    border-bottom: 1px dashed #eee;
    white-space: nowrap;
    font-weight: normal !important;
}

/* 数据表格样式 - 电脑端保持原样 */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.ping-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ping-table th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #eee;
    font-size: 14px;
    white-space: nowrap;
}

.ping-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #555;
    white-space: nowrap;
    font-weight: normal !important;
}

.ping-table tr:hover {
    background: #f8f9fa;
}

.operator-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

.delay-bar {
    height: 8px;
    border-radius: 4px;
    width: 100%;
    background: #eee;
    overflow: hidden;
}

.delay-progress {
    height: 100%;
    border-radius: 4px;
}

/* 加载状态 - 电脑端保持原样 */
.loading {
    text-align: center;
    padding: 50px;
    font-size: 16px;
    color: #666;
    display: none;
}

/* 网速档次颜色类 - 保持原样 */
.speed-level-1 { color: #10b981 !important; font-weight: normal !important; }
.speed-level-2 { color: #34d399 !important; font-weight: normal !important; }
.speed-level-3 { color: #f59e0b !important; font-weight: normal !important; }
.speed-level-4 { color: #f97316 !important; font-weight: normal !important; }
.speed-level-5 { color: #ef4444 !important; font-weight: normal !important; }
.speed-level-6 { color: #991b1b !important; font-weight: normal !important; }

/* 耗时/状态码样式 - 保持原样 */
.speed-value {
    font-weight: 600;
    color: #28a745;
}
.status-2xx { color: #10b981; font-weight: 600; }
.status-3xx { color: #f59e0b; font-weight: 600; }
.status-4xx { color: #ef4444; font-weight: 600; }
.status-5xx { color: #991b1b; font-weight: 600; }
.time-value { color: #1E90FF; font-weight: 600; }

/* 高级选项样式 - 电脑端保持原样 */
.advanced-options-section {
    width: 100%;
    margin-top: 15px;
}
.advanced-toggle-btn {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #28a745;
    font-size: 14px;
    font-weight: 600;
}
.advanced-options-content {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.advanced-form-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}
.advanced-form-group label {
    font-weight: 600;
    color: #333;
    font-size: 13px;
}
.advanced-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

/* 弹层样式 - 电脑端保持原样 */
#infoModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
#modalInner {
    background: #fff;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}
#closeModal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
}
#closeModal:hover {
    color: #ff0000;
}
#modalContent {
    font-size: 13px;
    line-height: 1.8;
    color: #555;
    white-space: pre-wrap;
}
.view-info-btn {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}
.view-info-btn:hover {
    background: #218838;
}

/* ============ 仅手机端自适应样式 (768px以下) ============ */
@media only screen and (max-width: 767px) {
    /* 基础样式重置 */
    body {
        min-width: unset;
        width: 100%;
        overflow-x: hidden;
    }

    /* 容器适配 */
    .container {
        width: 100%;
        padding: 15px;
        margin: 10px auto;
        border-radius: 8px;
    }
    
    /* 导航栏适配 - 完全替换为目标样式 */
    .navbar {
        padding: 10px 15px;
    }
    .navbar-container {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .navbar-menu {
        gap: 10px;
        flex-wrap: wrap;
        width: 100%;
    }
    .navbar-menu a {
        font-size: 12px;
    }

    /* 表单适配 */
    .ping-form-section {
        padding: 12px;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 12px;
    }
    .form-group {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .form-group label {
        min-width: 70px;
        font-size: 13px;
    }
    .target-input {
        width: 100%;
        font-size: 13px;
        padding: 8px 12px;
    }
    .select-control {
        flex: 1;
        min-width: unset;
    }
    .operator-checkboxes {
        width: 100%;
        padding-left: 70px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .checkbox-item {
        flex: 0 0 calc(50% - 8px);
        max-width: calc(50% - 8px);
        font-size: 13px;
    }
    .detect-btn {
        width: 100%;
        padding: 12px 30px;
        margin-top: 10px;
    }

    /* 说明区域适配 */
    .info-section {
        padding: 12px 15px;
    }
    .info-section p {
        font-size: 13px;
    }

    /* 结果区域适配 */
    #resultTitle {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }
    .map-rank-container {
        flex-wrap: wrap;
        gap: 15px;
    }
    .map-container {
        height: 300px !important;
        min-width: unset;
        width: 100% !important;
    }
    .rank-container {
        height: 300px;
        min-width: unset;
        width: 100%;
    }
    .map-legend {
        padding: 10px 12px;
        font-size: 11px;
        bottom: 15px;
        left: 15px;
    }
    .legend-item {
        gap: 6px;
        margin: 4px 0;
    }
    .legend-color {
        width: 16px;
        height: 16px;
    }
    .rank-tabs {
        overflow-x: auto;
    }
    .rank-tab {
        padding: 12px 15px;
        font-size: 13px;
    }
    .rank-content {
        padding: 12px;
    }
    .rank-table th, .rank-table td {
        padding: 8px 6px;
        font-size: 12px;
    }

    /* 表格适配 */
    .ping-table th, .ping-table td {
        padding: 10px 12px;
        font-size: 12px;
    }
    .operator-tag {
        padding: 2px 6px;
        font-size: 11px;
    }

    /* 高级选项适配 */
    .advanced-options-content {
        gap: 12px;
    }
    .advanced-form-group {
        width: 100%;
        min-width: unset;
    }
    .advanced-form-group label {
        min-width: 70px;
        font-size: 12px;
    }
    .advanced-input {
        font-size: 12px;
    }

    /* 弹层适配 */
    #infoModal {
        padding: 15px;
    }
    #modalInner {
        width: 100%;
        padding: 15px;
    }
    #closeModal {
        top: 10px;
        right: 10px;
        font-size: 18px;
        width: 25px;
        height: 25px;
        line-height: 25px;
    }
    #modalContent {
        font-size: 12px;
    }

    /* 加载状态适配 */
    .loading {
        padding: 30px;
        font-size: 14px;
    }
}
/* 完全复用图2的标题样式 */
.title-btn-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}
.title-btn-container h2 {
    margin: 0;
    color: #2c3e50; /* 深灰色文字 */
    font-size: 20px;
    padding-left: 10px;
    border-left: 4px solid #28a745; /* 绿色竖线 */
    font-weight: 700;
}