body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1400px; 
    margin: 0 auto;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.content-wrapper {
    display: flex;
    flex-direction: column; /* 改为垂直布局 */
    gap: 20px;
    height: auto; /* 自适应高度 */
}

#ip-info {
    width: 100%; /* 占满整个宽度 */
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: visible; /* 移除溢出隐藏 */
    display: flex;
    flex-direction: column;
}

.ip-address {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* 改为左对齐 */
    font-size: 1.5em;
    color: #2c3e50;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #ecf0f1;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.country-flag {
    margin-right: 10px;
}

.ip-label {
    font-weight: bold;
    margin-right: 5px;
}

.copy-button {
    margin-left: auto; /* 将复制按钮推到右侧 */
    background-color: #3498db;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.copy-button:hover {
    background-color: #2980b9;
}

.ip-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.ip-info-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-left: 4px solid; /* 移除默认颜色 */
}

/* 为每一列设置不同的边框颜色 */
.ip-info-item:nth-child(3n+1) {
    border-left-color: #3498db; /* 蓝色 */
}

.ip-info-item:nth-child(3n+2) {
    border-left-color: #2ecc71; /* 绿色 */
}

.ip-info-item:nth-child(3n+3) {
    border-left-color: #e74c3c; /* 红色 */
}

.ip-info-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.ip-info-item strong {
    display: block;
    color: #2c3e50;
    font-size: 0.9em;
    text-transform: uppercase;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}

.ip-info-item span {
    display: block;
    font-size: 1.1em;
    color: #34495e;
    word-break: break-word;
}

#map {
    width: 100%; /* 占满整个宽度 */
    height: 500px; /* 增加地图高度 */
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 600px; /* 增加最小高度 */
}

/* 移除滚动条样式 */

header {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    color: white;
    padding: 0.5rem 0;
    margin-bottom: 50px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-title {
    display: flex;
    align-items: center;
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

header h1 {
    margin: 0;
    font-size: 1.2em;
    color: white;
}

nav ul {
    list-style-type: none;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 1rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
}

main {
    flex-grow: 1;
}

footer {
    background: linear-gradient(135deg, #2c3e50, #3498db); /* 更改为渐变色 */
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

@media (max-width: 1200px) {
    .ip-info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
        height: auto;
    }

    #ip-info, #map {
        width: 100%;
    }

    #map {
        height: 300px; /* 在小屏幕上调整地图高度 */
    }

    .ip-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        height: auto;
    }

    #ip-info, #map {
        height: 400px;
    }

    .ip-info-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    header .container {
        flex-direction: column;
        text-align: center;
    }

    .logo-title {
        margin-bottom: 0.5rem;
    }

    nav ul {
        margin-top: 0.5rem;
    }

    nav ul li {
        margin: 0 0.5rem;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2em;
    }

    #ip-info {
        padding: 15px;
    }

    .ip-info-table td {
        padding: 8px;
    }
}

@media (min-width: 992px) {
    .content-wrapper {
        flex-direction: row; /* 在大屏幕上使用水平布局 */
    }

    #ip-info {
        flex: 2; /* 减小 IP 信息区域的宽度比例 */
        max-height: none; /* 移除最大高度限制 */
        overflow: visible; /* 确保内容完全显示 */
    }

    #map {
        flex: 3; /* 增加地图区域的宽度比例 */
        height: auto;
        min-height: 600px; /* 增加最小高度 */
    }
}

@media (max-width: 991px) {
    .ip-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 576px) {
    .ip-info-grid {
        grid-template-columns: 1fr;
    }
}