/* ========== 全局基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
    background-color: #f5f7fa;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* ========== 导航栏（必须保留） ========== */
.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-container {
    max-width: 1920px;
    margin: 0 auto;
}
.footer-copyright {
    text-align: center;
    font-size: 12px;
    color: #999;
    line-height: 1.6;
}

/* ========== 工具导航（必须保留） ========== */
.tool-nav-wrapper {
    margin: 20px 0 !important;
    display: flex !important;
    gap: 15px !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}
.tool-nav-card {
    flex: 1 !important;
    min-width: 280px !important;
    padding: 20px !important;
    background: #fff !important;
    border: 1px solid #eee !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
}
.tool-nav-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin: 0 0 15px 0 !important;
    padding-bottom: 8px !important;
    position: relative !important;
}
.tool-nav-title::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 40px !important;
    height: 2px !important;
    background: #007bff !important;
}
.tool-nav-links {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 15px !important;
    font-size: 14px !important;
    color: #4e5969 !important;
}
.tool-nav-links a {
    color: #4e5969 !important;
    text-decoration: none !important;
    line-height: 1.5 !important;
    transition: color 0.2s !important;
}
.tool-nav-links a:hover {
    color: #007bff !important;
}
.tool-nav-tag {
    position: absolute !important;
    top: -2px !important;
    right: -18px !important;
    display: inline-block !important;
    width: 22px !important;
    height: 16px !important;
    line-height: 14px !important;
    text-align: center !important;
    font-size: 10px !important;
    color: #f00 !important;
    border: 1px solid #f00 !important;
    border-radius: 2px !important;
}

/* ========== 页面容器 ========== */
.page-container {
    width: 98%;
    max-width: 1920px;
    margin: 0 auto;
    padding: 0 15px;
}
.container-inner {
    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 {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}
.title-btn-container h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    padding-left: 10px;
    border-left: 4px solid #28a745;
}

/* ========== 模块通用 ========== */
.module {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

/* ========== 表单样式 ========== */
.search-box {
    margin: 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end; /* 核心：保持和输入框底部对齐 */
    align-content: center; /* 新增：确保整体垂直居中 */
}

/* 给按钮单独加样式，强制和输入框对齐 */
#checkBtn, #resetBtn {
    flex-shrink: 0; /* 防止按钮被压缩 */
    margin-bottom: 15px !important; /* 和输入框的margin-bottom保持一致 */
}
.form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

/* 协议下拉框 + 网址输入框组合样式（合并原行内CSS） */
.url-input-group {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.proto-select {
    min-width: 110px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}
.proto-select:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}
.url-input {
    border-radius: 0 4px 4px 0 !important;
}

/* ========== 按钮 ========== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: #28a745;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.btn:hover {
    background-color: #218838;
}
.btn-reset {
    background-color: #6c757d;
    margin-left: 10px;
}
.btn-reset:hover {
    background-color: #5a6268;
}

/* ========== 状态卡片 ========== */
.status-card {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}
.status-item {
    flex: 1;
    min-width: 150px;
    padding: 20px;
    border-radius: 8px;
    background-color: #f8f9fa;
    text-align: center;
}
.status-item.success {
    background-color: #e8f4f8;
    border: 1px solid #48bb78;
}
.status-item.error {
    background-color: #fdf2f8;
    border: 1px solid #e53e3e;
}
.status-item.warning {
    background-color: #fef7fb;
    border: 1px solid #ed8936;
}
.status-item .title {
    font-size: 13px;
    color: #718096;
    margin-bottom: 8px;
}
.status-item .value {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
}
.status-item.success .value { color: #48bb78; }
.status-item.error .value { color: #e53e3e; }
.status-item.warning .value { color: #ed8936; }
.status-time {
    font-size: 12px;
    color: #718096;
}

/* ========== 结果展示区域 ========== */
.debug-result {
    background-color: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}
.result-header {
    padding: 12px 15px;
    background-color: #28a745;
    color: #fff;
    font-weight: 500;
}
.result-body {
    padding: 15px;
}
.loading {
    text-align: center;
    padding: 20px;
    color: #718096;
}

/* ========== 结果详情 ========== */
.result-section {
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    background-color: #fff;
}
.result-section.error { border-color: #feb2b2; }
.result-label {
    padding: 10px 15px;
    background-color: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 1px solid #eee;
    font-size: 15px;
}
.result-section.error .result-label {
    background-color: #fed7d7;
    color: #c53030;
}
.result-content {
    padding: 15px;
    font-size: 14px;
}
.info-row {
    margin-bottom: 8px;
    line-height: 1.8;
}
.info-row span {
    font-weight: 500;
    color: #28a745;
    min-width: 100px;
    display: inline-block;
}
.code-box {
    background-color: #f8f9fa;
    border-radius: 4px;
    overflow: auto;
    max-height: 400px;
    padding: 10px;
}
.code-box pre {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #2d3748;
}

/* ========== 状态码说明 ========== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    padding: 10px 0;
}
.info-item {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}
.info-label {
    font-weight: 500;
    color: #28a745;
    margin-right: 8px;
}

/* ========== 温馨提示 ========== */
.note {
    margin-top: 15px;
    padding: 10px;
    background-color: #f5fafe;
    border-radius: 4px;
    font-size: 13px;
    color: #4a5568;
}

/* ========== 移动端适配 ========== */
@media only screen and (max-width: 767px) {
    .container-inner {
        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;
    }
    .title-btn-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .module {
        padding: 15px;
        margin-bottom: 15px;
    }
    .search-box {
        flex-direction: column;
        align-items: stretch;
    }
    .form-group {
        width: 100%;
        min-width: unset;
    }
    .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 15px;
        margin-bottom: 10px;
    }
    .btn-reset {
        margin-left: 0;
    }
    .status-card {
        flex-direction: column;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }

    /* 工具导航移动端 */
    .tool-nav-wrapper {
        gap: 10px !important;
        margin: 15px 0 !important;
    }
    .tool-nav-card {
        min-width: 100% !important;
        padding: 15px !important;
    }
    .tool-nav-title {
        font-size: 14px !important;
        margin-bottom: 10px !important;
    }
    .tool-nav-links {
        gap: 10px !important;
        font-size: 13px !important;
    }
    .tool-nav-tag {
        right: -15px !important;
        width: 20px !important;
        height: 14px !important;
        line-height: 12px !important;
        font-size: 9px !important;
    }

    /* 移动端协议输入框适配 */
    .url-input-group {
        flex-direction: column;
    }
    .proto-select {
        min-width: 100%;
        border-right: 1px solid #ddd;
        border-radius: 4px 4px 0 0;
        border-bottom: none;
    }
    .url-input {
        border-radius: 0 0 4px 4px !important;
    }
}
/* 新增：工具导航独立容器样式（和页面原有卡片风格统一） */
.tool-nav-card {
    margin: 20px auto;
    padding: 15px;
    width: 100%;
    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;
}