/* 统一的CSS样式文件 */

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

/* 页面基础样式 */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.header {
    background: #4CAF50;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.header h1 {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.user-info {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.8em;
    background: rgba(255,255,255,0.2);
    padding: 3px 8px;
    border-radius: 10px;
}

/* 通用按钮样式 */
.btn {
    width: 100%;
    padding: 15px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
    transition: background 0.3s;
}

.btn:hover {
    background: #45a049;
}

.btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* 输入框样式 */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.input-group input[type="password"],
.input-group input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1.1em;
}

.input-group input:focus {
    outline: none;
    border-color: #4CAF50;
}

/* 结果展示区域样式 */
.result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.result.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.result.wrong {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 返回按钮样式 */
.back-btn {
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 0.8em;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 配置按钮样式 */
.config-btn {
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 0.8em;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.config-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 导航栏样式 - 极简设计 */
.navbar {
    background: #333;
    color: white;
    padding: 10px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #555;
    position: relative; /* 添加相对定位 */
    z-index: 1000; /* 确保导航栏在顶层 */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: normal;
}

/* 弹出按钮导航栏样式 */
.nav-popup-container {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 1001;
}

.nav-popup-btn {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    background: transparent;
    border: none;
    outline: none;
}

.nav-popup-btn span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* 弹出按钮动画效果 */
.nav-popup-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-popup-btn.active span:nth-child(2) {
    opacity: 0;
}

.nav-popup-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.nav-popup-menu {
    position: fixed;
    right: -300px;
    top: 0;
    width: 280px;
    height: 100vh;
    background-color: #333;
    transition: 0.3s;
    padding: 60px 0 20px 0;
    border-left: 1px solid #555;
    text-align: center;
    z-index: 1000;
}

.nav-popup-menu-active {
    right: 0;
}

.nav-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #ccc;
    font-size: 1.5em;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.nav-popup-close:hover {
    background: #555;
}

.nav-popup-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.nav-popup-item {
    margin: 5px 0;
    width: 100%;
}

.nav-popup-link {
    color: #ccc;
    text-decoration: none;
    padding: 12px;
    display: block;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 1.1em;
    width: 80%;
    margin: 0 auto;
}

.nav-popup-link:hover {
    background: #555;
    color: white;
}

.nav-popup-link.active {
    background: #555;
    color: white;
}

.nav-popup-user {
    font-size: 0.9em;
    color: #ccc;
    margin-top: 15px;
    padding: 8px 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        padding: 0 15px;
    }
    
    .navbar {
        padding: 12px 0;
    }
    
    .nav-logo a {
        font-size: 1.5em;
    }
    
    /* 移动端导航栏优化 */
    .nav-popup-menu {
        width: 250px;
        padding: 50px 0 15px 0;
    }
    
    .nav-popup-link {
        font-size: 1em;
        padding: 10px;
    }
    
    .nav-popup-user {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .header {
        padding: 15px 10px;
        position: relative; /* 确保弹出按钮定位正确 */
    }
    
    .user-info {
        position: static;
        margin-top: 10px;
        display: inline-block;
    }
    
    .nav-popup-container {
        top: 15px;
        right: 10px;
    }
    
    .nav-popup-btn span {
        width: 20px;
        height: 2px;
        margin: 2px 0;
    }
    
    .nav-popup-link {
        padding: 12px;
        font-size: 1.1em;
    }
    
    .nav-popup-user {
        font-size: 0.85em;
        padding: 6px 12px;
    }
    
    /* 小屏幕设备导航栏优化 */
    .nav-popup-menu {
        width: 220px;
    }
    
    .nav-popup-link {
        font-size: 0.9em;
        padding: 8px;
    }
}