/* ========== 全局重置 & 基础样式（复用DNS说明书） ========== */
* {
    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; /* DNS文档的绿色导航栏 */
    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; /* DNS文档的logo字体大小 */
    font-weight: 700;
}
.navbar-menu {
    display: flex;
    gap: 30px; /* DNS文档的菜单间距 */
}
.navbar-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 14px; /* DNS文档的菜单字体大小 */
    transition: opacity 0.3s;
}
.navbar-menu a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ========== 页脚样式（复用DNS说明书） ========== */
.footer {
    background-color: #333; /* DNS文档的黑色页脚 */
    color: #ccc;
    padding: 20px 15px;
    margin-top: 40px;
}
.footer-container {
    max-width: 1920px;
    margin: 0 auto;
}
.footer-copyright {
    text-align: center;
    font-size: 12px; /* DNS文档的页脚字体大小 */
    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: 22px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 600;
}
.tool-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ========== 表单区域样式（核心优化） ========== */
.query-form {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}
.form-group {
    flex: 1;
    min-width: 280px;
}
.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;
}
.form-control:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}
.submit-btn {
    padding: 12px 30px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 44px;
}
.submit-btn:hover {
    background-color: #218838;
    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;
}
.alert-icon {
    font-size: 18px;
}

/* ========== 结果展示区域 ========== */
.result-section {
    margin-top: 30px;
    display: none;
}
.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;
}
.result-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}
.ip-header {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ip-type-tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e8f4f8;
    color: #2d3748;
    font-weight: normal;
}

/* ========== 双列等高布局 ========== */
.two-column-layout {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.column {
    flex: 1;
    min-width: 300px;
}

/* ========== 信息网格样式 ========== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.info-item {
    padding: 12px 15px;
    background: #fff;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid #f0f0f0;
}
.info-label {
    color: #64748b;
    font-weight: 500;
    margin-right: 6px;
    display: inline-block;
    min-width: 70px;
}
.info-value {
    color: #1e293b;
    font-weight: 400;
}

/* ========== 地图容器样式 ========== */
.map-wrapper {
    background: #fff;
    border-radius: 6px;
    padding: 15px;
    height: 100%;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}
.map-tip {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin-bottom: 10px;
}
.map-container {
    flex: 1;
    min-height: 250px;
    border-radius: 4px;
    overflow: hidden;
}
.map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 250px;
    background: #f8fafc;
    border-radius: 6px;
    color: #666;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* ========== 历史记录区域 ========== */
.history-section {
    margin-top: 30px;
}
.history-header {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}
.history-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #f0f0f0;
}
.history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 8px;
}
.history-item {
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #e5e9f0;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.history-item:hover {
    background: #f0f8f2;
    border-color: #28a745;
    color: #28a745;
}
.history-ip {
    font-weight: 600;
    color: #28a745;
}
.history-location {
    color: #666;
    margin-left: 6px;
    font-size: 12px;
}
.history-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
    background: #fff;
    border-radius: 6px;
}

/* ========== 域名解析提示样式 ========== */
.domain-tip {
    background: #e8f4f8;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 13px;
    color: #2d3748;
    margin-bottom: 20px;
    border-left: 3px solid #3182ce;
}

/* ========== 响应式适配（仅对齐导航栏移动端样式） ========== */
@media only screen and (max-width: 768px) {
    body {
        min-width: unset;
        width: 100%;
        overflow-x: hidden;
    }
    /* 导航栏移动端样式完全对齐目标CSS */
    .navbar {
        padding: 10px 15px !important;
    }
    .navbar-container {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: flex-start !important;
    }
    .navbar-menu {
        gap: 10px !important;
        flex-wrap: wrap !important;
        width: 100% !important;
    }
    .navbar-menu a {
        font-size: 12px !important;
    }
    /* 其他移动端样式保持原有逻辑 */
    .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%;
    }
    .two-column-layout {
        flex-direction: column;
        gap: 15px;
    }
    .column {
        min-width: 100%;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
    .map-container {
        min-height: 200px;
    }
    .history-list {
        max-height: 150px;
    }
}