/* 基础样式 */
body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background: url('https://s2.loli.net/2023/12/25/o6xRjDd3FMqLVK1.webp') no-repeat center center fixed;
    background-size: cover;
    transition: background-color 0.5s, color 0.5s;
    color: #333;
}

/* 导航栏 */
nav {
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    width: 100%;
    padding: 5px 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dark-mode nav {
    background-color: #333;
    border-bottom: 1px solid #444;
}

.logo {
    margin-left: 10px;
}

.logo img {
    width: 50px;
    height: auto;
}

/* 汉堡按钮 */
.hamburger {
    display: none;
    font-size: 24px;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
}

.dark-mode .hamburger {
    color: #fff;
}

/* 导航菜单 */
nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0 5px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
}

.dark-mode nav ul li a {
    color: #fff;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 响应式导航 */
@media (max-width: 768px) {
    .hamburger {
        display: block;
        margin-left: 20px;
    }
    
    .logo {
        margin-left: 0;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .nav-left {
        order: 1;
    }
    
    .nav-right {
        order: 3;
    }
    
    .nav-menu {
        display: none;
        flex-direction: column;
        gap: 10px;
        background-color: #f8f8f8;
        position: absolute;
        top: 50px;
        left: 10px;
        padding: 5px;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .dark-mode .nav-menu {
        background-color: #333;
    }
}

/* 暗色模式 */
.dark-mode {
    background-color: #222;
    color: #fff;
}

.container {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    width: 90%;
    max-width: 800px;
    margin-top: 20px;
    margin-bottom: 100px;
    margin-left: auto;
    margin-right: auto;
}

.dark-mode .container {
    background-color: rgba(34, 34, 34, 0.8);
}

h1 {
    font-size: 2em;
    margin-bottom: 1em;
    padding-top: 50px;
    text-align: center;
    color: #000;
    text-shadow: 1px 1px 2px #fff, -1px -1px 2px #fff, -1px 1px 2px #fff, 1px -1px 2px #fff;
    transition: color 0.5s, text-shadow 0.5s;
}

.dark-mode h1 {
    color: #fff;
    text-shadow: 1px 1px 2px #000, -1px -1px 2px #000, -1px 1px 2px #000, 1px -1px 2px #000;
    transition: color 0.5s, text-shadow 0.5s;
}

/* 表格样式 */
table {
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    transition: background-color 0.5s;
}

.dark-mode table {
    background-color: #333;
}

table th, table td {
    font-weight: normal;
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
    transition: background-color 0.5s, color 0.5s;
}

.dark-mode table th,
.dark-mode table td {
    border: 1px solid #444;
    color: #fff;
}

/* 嵌套表格 */
.nested-table {
    width: 100%;
    border-collapse: collapse;
}

.nested-table th, .nested-table td {
    border: none;
    padding: 6px;
    text-align: left;
}

.nested-table th {
    background-color: #f9f9f9;
}

.dark-mode .nested-table th {
    background-color: #555;
}

/* 按钮样式 */
.toggle-button {
    padding: 5px 5px;
    font-size: 24px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.2s;
    margin-right: 75px;
}

.toggle-button:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

.copy-button, .ipinfo-button, .map-button {
    padding: 5px 10px;
    font-size: 14px;
    cursor: pointer;
    background-color: #008CBA;
    color: white;
    border: none;
    border-radius: 3px;
    margin-left: 10px;
    transition: background-color 0.3s;
}

.copy-button:hover, .ipinfo-button:hover, .map-button:hover {
    background-color: #007B9A;
}

.additional-button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background-color: #f0ad4e;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s, transform 0.2s;
    margin-top: 20px;
    margin-left: 10px;
}

.additional-button:hover {
    background-color: #ec971f;
    transform: scale(1.05);
}

/* 地图容器样式 */
.map {
    margin-top: 20px;
    width: 100%;
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
}

/* iframe 容器 */
.iframe-container {
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.8);
    transition: background-color 0.5s;
}

.dark-mode .iframe-container {
    background-color: rgba(34, 34, 34, 0.8);
}

.iframe-content {
    width: 100%;
    border: 0;
    height: 140px;
    transition: opacity 0.5s;
}

/* 通知样式 */
.notification {
    display: none;
    position: fixed;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.notification.show {
    display: block;
    opacity: 1;
}

/* 页脚 */
footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: rgba(76, 175, 80, 0.8);
    color: white;
    text-align: center;
    padding: 10px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5em;
    }
    
    table td {
        padding: 8px;
    }
    
    .toggle-button {
        padding: 2px 2px;
        font-size: 24px;
    }
    
    .copy-button, .ipinfo-button, .additional-button, .map-button {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    footer {
        padding: 5px 0;
        font-size: 14px;
    }
}

/* BGP View 容器 */
.bgp-view-container {
    margin-top: 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    transition: background-color 0.5s;
    overflow: hidden;
}

.dark-mode .bgp-view-container {
    background-color: #333;
}

.bgp-iframe {
    width: 100%;
    height: 600px;
    border: none;
    border-radius: 5px;
}

@media (max-width: 768px) {
    .bgp-iframe {
        height: 400px;
    }
}