/* 多节点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-main-title {
    position: relative;
    padding-left: 12px;
    display: inline-block;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}
.ping-main-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #10b981;
    border-radius: 2px;
}

/* 检测表单区域 */
.ping-form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}
.ping-form-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}
.detect-type-label {
    display: none;
}
.target-input {
    width: 500px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}
.form-select {
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* TCP端口输入框 */
.port-input-container {
    display: none;
    align-items: center;
    gap: 5px;
}
.port-input {
    width: 80px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 检测按钮 */
.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;
}

/* 发包参数配置 */
.packet-config {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
    padding-left: 70px;
}
.packet-config-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 加载状态 */
.loading-container, .loading {
    display: none;
}
.loading {
    padding: 20px;
    text-align: center;
}
.loading-text {
    font-size: 16px;
    margin-bottom: 10px;
}
.progress-container {
    width: 80%;
    margin: 0 auto;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
}
.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #10b981;
    transition: width 0.3s ease;
}
.progress-text {
    margin-top: 8px;
    font-size: 14px;
    color: #666;
}
#loading {
    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;
}

/* ICMP / TCP 列显隐控制 */
.icmp-col {
    display: none;
}

/* 信息说明区域 */
.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;
}

/* 结果区域 */
.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;
}

/* 运营商筛选 */
.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;
}

/* 详细结果表格 */
.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;
}

/* 状态颜色等级 */
.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;
}

/* 公告 + 新闻 */
.notice-news-container {
    display: flex;
    gap: 10px;
    margin: 0 0 15px 0;
    flex-wrap: wrap;
}
.notice-news-item {
    flex: 1;
    min-width: 300px;
    width: 100%;
}
.notice-news-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

/* 工具导航卡片 */
.tool-nav-card {
    margin: 20px 0;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #eee;
}
.tool-nav-card h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

/* ==================== 移动端适配 ==================== */
@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;
    }
    .detect-btn {
        width: 100%;
        padding: 12px 30px;
        margin-top: 10px;
    }

    /* 发包参数手机端优化 */
    .packet-config {
        width: 100%;
        padding-left: 0;
    }
    .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;
    }
    #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;
    }

    /* 公告新闻移动端 */
    .notice-news-container {
        gap: 5px;
        margin: 0 0 10px 0;
    }
    .notice-news-item {
        min-width: 100%;
        margin-bottom: 8px;
        flex: unset;
    }
    .notice-news-title {
        font-size: 13px;
        margin-bottom: 4px;
    }
}
