/* ========== 全局重置 & 基础样式 ========== */
* {
    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;
}

/* ========== 主容器样式 ========== */
.page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.page-container {
    margin-top: 30px;
}
.main-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 30px;
    margin-bottom: 20px;
}

/* ========== 标题区域样式 ========== */
.tool-header {
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}
.tool-title {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 700;
}
.tool-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ========== 表单区域样式 ========== */
.query-form {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 25px;
    flex-wrap: wrap;
}
/* IP检测专用表单样式（水平居中对齐） */
.domain-query-form {
    align-items: center;
}
.form-group {
    flex: 1;
    min-width: 280px;
    margin: 0;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e5e9f0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    height: 44px;
    box-sizing: border-box;
}
.form-control:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}
/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 0;
}
.submit-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 44px;
    box-sizing: border-box;
}
.primary-btn {
    background-color: #28a745;
    color: #fff;
}
.primary-btn:hover {
    background-color: #218838;
    transform: translateY(-1px);
}
.secondary-btn {
    background-color: #6c757d;
    color: #fff;
}
.secondary-btn:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}
.submit-btn:active {
    transform: translateY(0);
}

/* ========== 提示信息样式 ========== */
.alert {
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { 
    background: #ECFDF5; 
    color: #065F46; 
    border: 1px solid #D1FAE5;
}
.alert-error { 
    background: #FEF2F2; 
    color: #DC2626; 
    border: 1px solid #FEE2E2;
}

/* ========== 结果展示区域（保留核心背景色修改） ========== */
.result-section {
    margin-top: 30px;
    display: none;
    background-color: #F5F5F5; /* 核心：结果区域浅灰背景 */
    padding: 20px;
    border-radius: 8px;
}
.result-section.show {
    display: block;
}
.result-header {
    font-size: 18px;
    color: #28a745;
    margin-bottom: 20px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f8f2;
}
/* IP查询结果表格样式 */
.result-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background-color: #fff; /* 表格白色背景 */
    border-radius: 8px;
    overflow: hidden;
}
.result-table th, .result-table td {
    padding: 12px 15px;
    border: 1px solid #e5e9f0;
    text-align: left;
}
.result-table th {
    background-color: #f0f8f4;
    color: #28a745;
    font-weight: 600;
}
.result-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* ========== 使用说明区域 ========== */
.use-desc-container {
    background: #f0f8fb;
    border-left: 4px solid #10b981;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 0 4px 4px 0;
    line-height: 1.8;
    color: #333;
}
.use-desc-container h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}
.use-desc-container p {
    margin: 5px 0;
    font-size: 14px;
}

/* ========== 加载 & 进度条样式 ========== */
.loading-container {
    display: none;
}
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 22px;
    font-size: 15px;
    color: #28a745;
    background: rgba(40, 167, 69, 0.05);
    border-radius: 8px;
    margin: 10px 0;
}
.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #28a745;
    border-top-color: transparent;
    border-radius: 50%;
    animation: loading-rotate 0.8s linear infinite;
}
@keyframes loading-rotate {
    to { transform: rotate(360deg); }
}
.progress-bar-container {
    width: 80%;
    margin:15px auto; 
    height: 10px; 
    border: 1px solid #ccc; 
    border-radius: 5px; 
    overflow: hidden;
}
.progress-bar {
    width: 0%; 
    height: 100%; 
    background-color: #4CAF50; 
    transition: width 0.3s ease;
}
.progress-text {
    text-align:center; 
    margin-top: 10px; 
    font-size: 14px;
}

/* ========== IP输入框 & 数量提示样式 ========== */
.domain-textarea {
    resize: none;
}
.domain-textarea-single {
    height: 44px !important;
}
.domain-textarea-multi {
    height: 140px !important;
}
.domain-count-tip {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}
.count-warning {
    color: #DC2626;
    font-weight: 500;
}

/* ========== 工具导航容器样式 ========== */
.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;
}

/* ========== 响应式适配 ========== */
@media only screen and (max-width: 768px) {
    body {
        min-width: unset;
        width: 100%;
        overflow-x: hidden;
    }
    /* 导航栏移动端 */
    .navbar {
        padding: 10px 15px;
    }
    .navbar-container {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    .navbar-menu {
        gap: 15px;
        flex-wrap: wrap;
        width: 100%;
    }
    .navbar-menu a {
        font-size: 14px;
        padding: 2px 0;
    }
    /* 主容器移动端 */
    .main-card {
        padding: 20px 15px;
    }
    .tool-title {
        font-size: 18px;
    }
    .query-form {
        flex-direction: column;
        gap: 15px;
    }
    .form-group {
        min-width: 100%;
    }
    .submit-btn {
        width: 100%;
    }
    /* 表格移动端 */
    .result-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        font-size: 12px;
        -webkit-overflow-scrolling: touch;
    }
    .result-table th,
    .result-table td {
        padding: 8px 10px;
        white-space: pre-wrap;
        word-break: break-all;
        min-width: 100px;
    }
    /* 移动端结果区域适配 */
    .result-section {
        padding: 15px;
    }
}
.submit-btn:disabled {
    background-color: #cccccc !important;
    cursor: not-allowed;
    opacity:0.7;
}