/* ===== 终极重置：清除一切边距、边框、空白 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #1a2f3f;
    transition: background-color 0.3s, color 0.3s;
}

/* ===== 浅色模式变量 ===== */
body.light-mode {
    background-color: #f5f5f5;
    color: #222;
}

body.light-mode .features {
    background: #e0e0e0;
}

body.light-mode .card {
    background: #ffffff;
    color: #333;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

body.light-mode .card i {
    color: #e67e22;
}

body.light-mode .card h3 {
    color: #2c3e50;
}

body.light-mode .copy-ip {
    background: #2980b9;
}

body.light-mode .server-status {
    background: rgba(40, 40, 40, 0.9);
    color: #333;
    border-color: #ccc;
}

body.light-mode .server-status .status-label {
    color: #555;
}

body.light-mode .sponsors {
    background: #b0c4de;
    color: #1a252f;
}

body.light-mode .footer {
    background: #2c3e50;
    color: #ecf0f1;
}

body.light-mode .footer a {
    color: #ecf0f1;
}

body.light-mode .top-bar {
    background: rgba(0, 0, 0, 0.2);
}

/* ===== 第一屏：背景图强制填满 ===== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* 顶部浅黑色半透明条 */
.top-bar {
    background: rgba(0, 0, 0, 0.35);
    height: 10vh;
    width: 100%;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    backdrop-filter: blur(2px);
    z-index: 1;
}

/* 左侧圆角logo图片 */
.logo .logo-img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: block;
}

/* 右侧联系方式 */
.contact a {
    color: white;
    text-decoration: none;
    margin-left: 2rem;
    font-size: 1.2rem;
    transition: opacity 0.2s;
}

.contact a:hover {
    opacity: 0.8;
}

.contact i {
    margin-right: 0.5rem;
}

/* 首屏文字（垂直居中） */
.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-shadow: 2px 2px 5px black;
    text-align: center;
    z-index: 1;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.5rem;
}

/* ===== 第二屏 ===== */
.features {
    padding: 5rem 2rem;
    background: #fff;
    text-align: center;
    transition: background-color 0.3s;
}

.features h2 {
    font-size: 3.2rem;
    margin-bottom: 3rem;
    color: #2c3e50;
}

.feature-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    max-width: 1300px;
    margin: 0 auto;
}

.card {
    background: #ecf0f1;
    border-radius: 25px;
    padding: 3rem 2rem;
    flex: 1 1 300px;
    max-width: 380px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, background-color 0.3s, color 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card i {
    font-size: 4rem;
    color: #e67e22;
    margin-bottom: 1rem;
}

.card h3 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #34495e;
}

.card p {
    font-size: 1.2rem;
    color: #7f8c8d;
}

/* 复制IP区域 */
.copy-ip {
    margin-top: 4rem;
    background: #3498db;
    color: white;
    padding: 2.5rem 3rem;
    border-radius: 60px;
    display: inline-block;
    text-align: center;
    transition: background-color 0.3s;
}

.copy-ip p {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

#server-ip {
    font-weight: bold;
    background: rgba(0,0,0,0.2);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    font-size: 1.8rem;
}

.copy-btn {
    background: white;
    border: none;
    color: #3498db;
    font-size: 1.5rem;
    padding: 1rem 3rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    border: 2px solid white;
}

.copy-btn:hover {
    background: transparent;
    color: white;
}

/* ===== 服务器状态监控 ===== */
.server-status {
    margin-top: 3rem;
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(5px);
    border-radius: 20px;
    padding: 1.5rem;
    color: white;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.status-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ffaa33;
}

.update-time {
    font-size: 0.9rem;
    color: #aaa;
}

.status-content {
    min-height: 80px;
}

.status-loading {
    text-align: center;
    color: #aaa;
    padding: 1rem;
}

.status-row {
    display: flex;
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.status-label {
    width: 90px;
    color: #ddd;
    font-weight: 500;
    flex-shrink: 0;
}

.status-value {
    color: white;
    flex: 1;
    word-break: break-word;
}

.status-online-text {
    color: #4caf50;
    font-weight: bold;
}

.status-offline-text {
    color: #f44336;
    font-weight: bold;
}

.motd {
    font-family: monospace;
    background: rgba(0,0,0,0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* 手动刷新按钮 */
.refresh-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.refresh-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(30deg);
}

body.light-mode .refresh-btn {
    border-color: #666;
    color: #333;
}

body.light-mode .refresh-btn:hover {
    background: rgba(0,0,0,0.1);
}

/* ===== 紧凑服务器状态卡片 ===== */
.server-info-compact {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    padding: 0.5rem 0;
}

.server-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.server-icon-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.server-details {
    flex: 1;
    min-width: 0;
}

.server-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.server-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: #ffaa33;
    word-break: break-word;
}

.server-metrics {
    font-size: 1rem;
    color: #aaa;
    white-space: nowrap;
}

.server-motd {
    font-size: 1rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    word-break: break-word;
    line-height: 1.5;
    color: white;
    background: linear-gradient(135deg, #ff7e5f, #feb47b, #ff6a6a, #a18cd1, #fbc2eb);
    background-size: 200% 200%;
    animation: gradient-shift 5s ease infinite;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    font-weight: 500;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body.light-mode .server-motd {
    color: #222;
    text-shadow: 0 1px 1px rgba(255,255,255,0.5);
    background: linear-gradient(135deg, #ffcc99, #ffaaaa, #c0a0ff, #b0e0e6);
    background-size: 200% 200%;
}

/* ===== 第三屏：赞助商（淡入动画 + 可点击） ===== */
.sponsors {
    padding: 5rem 2rem;
    background: #2c3e50;
    color: white;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}

.sponsors h2 {
    font-size: 3.2rem;
    margin-bottom: 3rem;
}

.sponsor-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.sponsor-item {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
    overflow: hidden;
    width: 100%;
    max-width: 500px;
}

.sponsor-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 3rem;
    text-decoration: none;
    color: inherit;
    width: 100%;
    height: 100%;
    position: relative;
}

.sponsor-name {
    display: block;
    font-weight: bold;
    font-size: 1.2rem;
    transition: opacity 0.3s ease;
    z-index: 2;
    color: white;
}

.sponsor-logo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 15px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    background-color: rgba(0,0,0,0.3);
    padding: 10px;
}

.sponsor-item:hover .sponsor-name {
    opacity: 0;
}

.sponsor-item:hover .sponsor-logo {
    opacity: 1;
    visibility: visible;
}

/* ===== 底部 ===== */
.footer {
    background: #1a252f;
    color: #b0c4de;
    text-align: center;
    padding: 2rem;
    font-size: 1.1rem;
    transition: background-color 0.3s, color 0.3s;
}

.footer a {
    color: #b0c4de;
    text-decoration: none;
    margin: 0 0.5rem;
}

.footer a:hover {
    text-decoration: underline;
}

/* ===== 复制成功通知 ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4caf50;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: none;
    z-index: 1000;
    font-size: 1.1rem;
    width: 380px;
    overflow: hidden;
    backdrop-filter: blur(2px);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.notification.fade-out {
    opacity: 0;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.notification .close-btn {
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0 5px;
    transition: opacity 0.2s;
}

.notification .close-btn:hover {
    opacity: 0.7;
}

.progress-bar {
    height: 4px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    transition: width 3s linear;
}

/* ===== 模式切换按钮（48x48） ===== */
.theme-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}

.theme-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(0,0,0,0.6);
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.theme-btn:hover {
    background: rgba(0,0,0,0.8);
    border-color: white;
}

.theme-menu {
    position: absolute;
    bottom: 58px;
    right: 0;
    background: rgba(30,30,30,0.9);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    padding: 8px 0;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

.theme-option {
    padding: 8px 16px;
    color: white;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.theme-option:hover {
    background: rgba(255,255,255,0.2);
}

body.light-mode .theme-btn {
    background: rgba(255,255,255,0.7);
    color: #333;
    border-color: #666;
}

body.light-mode .theme-menu {
    background: rgba(240,240,240,0.95);
    border-color: #ccc;
}

body.light-mode .theme-option {
    color: #333;
}

body.light-mode .theme-option:hover {
    background: rgba(0,0,0,0.1);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .top-bar {
        height: 10vh;
        padding: 0 1rem;
    }
    .logo .logo-img {
        width: 60px;
        height: 60px;
    }
    .contact a {
        margin-left: 1rem;
        font-size: 1rem;
    }
    .hero-content h1 {
        font-size: 2.8rem;
    }
    .hero-content p {
        font-size: 1.3rem;
    }
    .features h2, .sponsors h2 {
        font-size: 2.5rem;
    }
    .card {
        max-width: 90%;
    }
    .copy-ip p {
        font-size: 1.5rem;
    }
    #server-ip {
        font-size: 1.5rem;
    }
    .server-status {
        margin-top: 2rem;
        padding: 1rem;
    }
    .status-label {
        width: 70px;
    }
    .refresh-btn {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
    .server-info-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    .server-header {
        width: 100%;
    }
    .server-metrics {
        white-space: normal;
    }
    .notification {
        width: 90%;
        max-width: 380px;
        font-size: 1rem;
    }
    .notification-content {
        padding: 12px 15px;
    }
    .sponsor-link {
        padding: 1.5rem 2rem;
    }
    .theme-btn {
        width: 42px;
        height: 42px;
        font-size: 1.4rem;
    }
    .theme-menu {
        bottom: 52px;
    }
}

/* ===== 弹窗样式（修复滚动与换行） ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.modal-container {
    background-color: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    background-color: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #dc3545;
    text-align: center;
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    text-align: left;
}

.modal-content p {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
    word-break: break-word;
    white-space: normal;
    overflow-wrap: break-word;
}

.modal-content p:last-of-type {
    margin-bottom: 0;
}

.modal-message {
    color: #ffc107;
}

.modal-message[style*="color: #dc3545"] {
    color: #dc3545;
}

.modal-link {
    text-align: center;
    margin: 1.2rem 0;
}

.modal-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.modal-link a:hover {
    text-decoration: underline;
}

.modal-btn {
    background-color: #007bff;
    border: none;
    color: white;
    font-size: 1rem;
    padding: 0.7rem 2rem;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    margin-top: 0.5rem;
}

.modal-btn:hover {
    background-color: #0056b3;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.no-remind-label {
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.no-remind-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 浅色模式适配 */
body.light-mode .modal-container {
    background-color: #fff;
}

body.light-mode .modal-header {
    background-color: #f8f9fa;
}

body.light-mode .no-remind-label {
    color: #333;
}

/* 移动端进一步优化 */
@media (max-width: 600px) {
    .modal-container {
        width: 95%;
        max-width: 95%;
    }
    .modal-content p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    .modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }
    .modal-btn {
        width: 100%;
    }
}