/* 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; /* PC端最小宽度，保证布局稳定 */
}

/* 导航栏核心样式 - 仅保留基础横向导航，无分组冲突 */
.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;
    /* 关键修改1：将 justify-content: space-between 改为 center 实现整体居中 */
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    /* 关键修改2：form-group 内部元素也居中（兜底） */
    justify-content: center;
}
.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}
.target-input {
    width: 500px;
    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; }

/* 弹层样式 - 核心必要 */
#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;
}
/* 给发包参数行添加居中（如果需要） */
.packet-config {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}
/* 移动端自适应样式 (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;
    }
    /* ============ 新增：发包数/间隔/包大小 手机端样式优化 ============ */
    .packet-config {
        width: 100%;
    }
    .packet-config > div {
        display: flex;
        align-items: center;
        gap: 3px;
        flex-wrap: wrap; /* 允许文字和下拉框换行 */
    }
    .packet-config label {
        font-size: 11px !important; /* 缩小文字字号 */
        min-width: unset !important; /* 取消最小宽度限制 */
        white-space: normal !important; /* 允许文字换行 */
        line-height: 1.2; /* 行高适配小字号 */
    }
    .packet-config select {
        font-size: 11px !important; /* 下拉框文字同步缩小 */
        padding: 0 5px !important; /* 缩小内边距，节省空间 */
        height: 32px !important; /* 略缩小高度，适配手机 */
        flex: 1; /* 自动占满剩余空间 */
        min-width: 60px !important; /* 保证下拉框最小宽度 */
    }
    
    /* ============ 新增样式结束 ============ */
    .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;
    }
}
/* 新增：检测中提示样式，更醒目 */
        #loading {
            display: none;
            text-align: center;
            font-size: 16px;
            color: #007bff;
            padding: 12px;
            font-weight: 500;
            background: #e8f4fd;
            border-radius: 6px;
            margin: 10px 0;
            border: 1px solid #b8daff;
        }
.operator-filter {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}
.filter-tag {
  padding: 6px 12px;
  background: #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}
.filter-tag.active {
  background: #007bff;
  color: white;
}
/* 工具导航卡片移动端适配 */
@media only screen and (max-width: 767px) {
    /* 工具导航外层容器 */
    div[style*="margin: 20px 0; display: flex; gap: 15px; flex-wrap: wrap;"] {
        gap: 10px !important;
        margin: 15px 0 !important;
    }
    /* 每个卡片 */
    div[style*="flex: 1; min-width: 280px; padding: 20px; background: #fff; border: 1px solid #eee; border-radius: 8px;"] {
        min-width: 100% !important;
        padding: 15px !important;
    }
    /* 卡片标题 */
    div[style*="flex: 1; min-width: 280px; padding: 20px; background: #fff; border: 1px solid #eee; border-radius: 8px;"] h3 {
        font-size: 14px !important;
        margin-bottom: 10px !important;
    }
    /* 工具链接 */
    div[style*="display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; font-size: 14px; color: #4e5969;"] {
        gap: 10px !important;
        font-size: 13px !important;
    }
    /* 2折标签 */
    span[style*="position: absolute; top: -2px; right: -18px; display: inline-block; width: 22px; height: 16px; line-height: 14px; text-align: center; font-size: 10px; color: #f00; border: 1px solid #f00; border-radius: 2px;"] {
        right: -15px !important;
        width: 20px !important;
        height: 14px !important;
        line-height: 12px !important;
        font-size: 9px !important;
    }
}