/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 主体样式 */
body {
    font-family: 'Noto Sans SC', sans-serif;
    color: #333;
    min-height: 100vh;
    background-color: #ffffff;
    transition: background-color 0.3s, color 0.3s;
}

/* 浅色模式样式 */
body.light-mode {
    background-color: #ffffff;
    color: #333;
}

/* 深色模式样式 */
body.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* 在小屏幕上移除最大宽度限制以实现真正的响应式 */
@media (max-width: 1200px) {
    .container {
        max-width: none;
        padding: 0 1rem;
    }
}

/* 头部样式 */
.header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    background-color: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    /* 移除max-width限制，让头部真正占据全屏宽度 */
    max-width: none;
    margin: 0;
}

.header.light-mode {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* 移除max-width限制，让内容区域可以扩展 */
    max-width: none;
    margin: 0 auto;
    gap: 2rem;
    width: 100%;
    flex-wrap: wrap;
    /* 添加最大宽度但允许在大屏幕上扩展 */
    max-width: 100%;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    color: #000000;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo.light-mode {
    color: #000000;
}

.logo.dark-mode {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link.light-mode {
    color: #333;
}

.nav-link.dark-mode {
    color: #ffffff;
}

.nav-link:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.nav-link.light-mode:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.nav-link.dark-mode:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.2);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #667eea;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 70%;
}

/* 模式切换按钮 */
.theme-toggle {
    background: none;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.theme-toggle:hover::before {
    opacity: 0.1;
}

.theme-toggle.light-mode {
    background-color: #f5f5f5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.theme-toggle.dark-mode {
    background-color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 主题图标 */
.theme-icon {
    font-size: 20px;
    transition: color 0.3s;
}

.theme-icon.light-mode {
    color: #333;
}

.theme-icon.dark-mode {
    color: #ffffff;
}

/* 主要内容区域 */
.main {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* 英雄区域 */
.hero {
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 16px;
    background-color: #f5f5f5;
    transition: background-color 0.3s;
}

.hero.light-mode {
    background-color: #f5f5f5;
}

.hero.dark-mode {
    background-color: #1e1e1e;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
    transition: color 0.3s;
}

.hero-title.light-mode {
    color: #333;
}

.hero-title.dark-mode {
    color: #ffffff;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    transition: color 0.3s;
}

.hero-subtitle.light-mode {
    color: #666;
}

.hero-subtitle.dark-mode {
    color: #cccccc;
}

/* 统计区域 */
.stats {
    padding: 1rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.stat-card {
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s, border-color 0.3s;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
}

.stat-card.light-mode {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
}

.stat-card.dark-mode {
    background-color: #1e1e1e;
    border: 1px solid #333;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background-color: #f5f5f5;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

.stat-icon.light-mode {
    background-color: #f5f5f5;
    color: #333;
}

.stat-icon.dark-mode {
    background-color: #333;
    color: #ffffff;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.stat-value.light-mode {
    color: #333;
}

.stat-value.dark-mode {
    color: #ffffff;
}

.stat-label {
    font-size: 1rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.stat-label.light-mode {
    color: #666;
}

.stat-label.dark-mode {
    color: #cccccc;
}

/* 使用说明区域 */
.instructions {
    border-radius: 16px;
    padding: 2rem;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    transition: background-color 0.3s, border-color 0.3s;
}

.instructions.light-mode {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
}

.instructions.dark-mode {
    background-color: #1e1e1e;
    border: 1px solid #333;
}

.section-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
    transition: color 0.3s;
}

.section-title.light-mode {
    color: #333;
}

.section-title.dark-mode {
    color: #ffffff;
}

.instruction-content p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
    transition: color 0.3s;
}

.instruction-content p.light-mode {
    color: #666;
}

.instruction-content p.dark-mode {
    color: #cccccc;
}

.proxy-url {
    background: #333;
    color: #ffffff;
    padding: 1rem;
    border-radius: 8px;
    font-family: monospace;
    margin: 1rem 0;
    overflow-x: auto;
    transition: background-color 0.3s, color 0.3s;
}

.proxy-url.light-mode {
    background: #333;
    color: #ffffff;
}

.proxy-url.dark-mode {
    background: #cccccc;
    color: #333;
}

code {
    background: #333;
    color: #ffcc00;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    transition: background-color 0.3s, color 0.3s;
}

code.light-mode {
    background: #333;
    color: #ffcc00;
}

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

/* 页脚样式 */
.footer {
    padding: 2rem;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    background-color: #f5f5f5;
    transition: background-color 0.3s, border-color 0.3s;
    width: 100%;
    /* 移除max-width限制，让页脚真正占据全屏宽度 */
    max-width: none;
    margin: 0;
}

.footer.light-mode {
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
}

.footer.dark-mode {
    background-color: #1e1e1e;
    border-top: 1px solid #333;
}

.footer-content {
    max-width: none;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

.footer-content p {
    color: #666;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.footer-content p.light-mode {
    color: #666;
}

.footer-content p.dark-mode {
    color: #cccccc;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
        /* 确保头部在小屏幕上也占据全屏宽度 */
        width: 100vw;
        max-width: none;
        margin: 0;
    }
    
    .header-content {
        flex-direction: column;
        align-items: center;
        padding: 10px;
        width: 100%;
    }
    
    .nav {
        margin-top: 10px;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-link {
        font-size: 16px;
        padding: 0.5rem;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: 16px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-icon {
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 14px;
    }
    
    .instructions {
        padding: 15px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .proxy-url {
        font-size: 14px;
        padding: 8px;
        word-break: break-all; /* 在小屏幕上允许长URL换行 */
    }
    
    .footer {
        padding: 1rem;
        /* 确保页脚在小屏幕上也占据全屏宽度 */
        width: 100vw;
        max-width: none;
        margin: 0;
    }
    
    .footer-content {
        padding: 15px;
        font-size: 14px;
        width: 100%;
    }
    
    /* 为手机UI添加额外的优化 */
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 10px; /* 减少容器的左右padding */
        max-width: none;
    }
    
    .hero {
        padding: 20px 10px; /* 调整英雄区域的padding */
    }
    
    .instructions {
        padding: 15px 10px; /* 调整使用说明区域的padding */
    }
    
    code {
        word-break: break-all; /* 代码块中的长URL换行 */
    }
}

/* 针对更小屏幕的额外优化 */
@media (max-width: 480px) {
    .header {
        padding: 0.5rem;
        /* 确保头部在超小屏幕上也占据全屏宽度 */
        width: 100vw;
        max-width: none;
        margin: 0;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 0.25rem 0.5rem;
    }
    
    .hero-title {
        font-size: 20px;
    }
    
    .hero-subtitle {
        font-size: 14px;
    }
    
    .stat-card {
        padding: 10px;
        flex-direction: column;
        text-align: center;
    }
    
    .stat-icon {
        margin-bottom: 10px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .footer {
        padding: 0.5rem;
        /* 确保页脚在超小屏幕上也占据全屏宽度 */
        width: 100vw;
        max-width: none;
        margin: 0;
    }
    
    .footer-content p {
        font-size: 12px;
    }
    
    .footer-content {
        width: 100%;
    }
}

/* 后端不可用提示信息样式 */
.backend-offline-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.backend-offline-message.light-mode {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.backend-offline-message.dark-mode {
    background-color: #331e1e;
    color: #f44336;
    border: 1px solid #5c2e2e;
}

.backend-offline-message.hidden {
    display: none;
}