/* 全局样式 */
* {
    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;
}

/* 标题容器 */
.title-btn-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}
.title-btn-container h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    padding-left: 10px;
    border-left: 4px solid #28a745;
    font-weight: 700;
}

/* 检测表单样式 */
.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: 0 6px 6px 0;
    font-size: 14px;
    height: 40px;
}
.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;
}

/* 页面切换下拉框 */
.page-switch-wrapper {
    display: flex;
    align-items: center;
}
.page-switch-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 14px;
    background-color: #f8f9fa;
    cursor: pointer;
    height: 40px;
    min-width: 160px;
}

/* 加载状态 */
#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;
}
.loading {
    text-align: center;
    padding: 50px;
    font-size: 16px;
    color: #666;
    display: none;
}

/* 结果区域 */
.result-section {
    display: none;
    margin-top: 20px;
}
#resultTitle {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-left: 8px;
    border-left: 4px solid #28a745;
}

/* 表格样式 */
.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;
}
.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;
}

/* DNS质量等级颜色 */
.dns-level-1 { color: #10b981; font-weight: bold; }
.dns-level-2 { color: #34d399; font-weight: bold; }
.dns-level-3 { color: #f59e0b; font-weight: bold; }
.dns-level-4 { color: #ef4444; font-weight: bold; }
.dns-level-5 { color: #991b1b; font-weight: bold; }

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

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

/* -------------------- 移动端自适应 -------------------- */
@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;
    }
    .page-switch-wrapper {
        width: 100%;
    }
    .page-switch-select {
        min-width: 120px;
        width: 30%;
        padding: 8px 12px;
        height: 38px;
    }
    .target-input {
        width: 70%;
        padding: 8px 12px;
        height: 38px;
    }
    .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;
    }
    .ping-table th, .ping-table td {
        padding: 10px 12px;
        font-size: 12px;
    }
    .operator-tag {
        padding: 2px 6px;
        font-size: 11px;
    }
    .loading {
        padding: 30px;
        font-size: 14px;
    }
}
