/* ========== 公共样式 - 所有页面共用 ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Alibaba PuHuiTi", "Microsoft YaHei", Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
}

/* 移除页面淡入动画，避免闪烁 */
/* .container 不再有动画 */

/* 头部导航栏 */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    flex-wrap: wrap;
    gap: 15px;
}

.logo h1 {
    font-size: 20px;
    margin-bottom: 4px;
    font-weight: 600;
}

.logo p {
    font-size: 12px;
    opacity: 0.85;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 6px 16px;
    border-radius: 30px;
    transition: 0.3s;
    font-size: 14px;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: rgba(255,255,255,0.25);
}

/* 登录区域 - 使用固定宽度避免布局重排 */
.auth-area {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 120px;
    justify-content: flex-end;
}

.welcome-text {
    font-size: 13px;
    background: rgba(255,255,255,0.15);
    padding: 6px 14px;
    border-radius: 30px;
    white-space: nowrap;
}

.login-btn, .logout-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: 0.3s;
    white-space: nowrap;
}

.login-btn:hover, .logout-btn:hover {
    background: rgba(255,255,255,0.35);
}

/* 页面容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 24px;
    min-height: 60vh;
}

/* 页脚 */
footer {
    background: #1e3c72;
    color: white;
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    font-size: 13px;
}

/* 弹窗遮罩 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

/* 登录弹窗内容 */
.modal .modal-content {
    background: white;
    border-radius: 28px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 35px rgba(0,0,0,0.2);
}

.modal .modal-content h3 {
    margin-bottom: 12px;
    color: #1e3c72;
    font-size: 20px;
}

.modal .modal-content p {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.modal .modal-content input {
    width: 100%;
    padding: 12px;
    margin: 12px 0;
    border: 1px solid #ddd;
    border-radius: 40px;
    font-size: 16px;
    font-family: inherit;
    text-align: center;
}

.modal .modal-content input:focus {
    outline: none;
    border-color: #ff9800;
}

.modal .modal-content .hint {
    font-size: 12px;
    color: #999;
    margin-top: -8px;
    margin-bottom: 12px;
}

.modal .modal-content button {
    background: #ff9800;
    color: white;
    border: none;
    padding: 10px 26px;
    border-radius: 40px;
    cursor: pointer;
    margin: 6px;
    font-family: inherit;
    font-weight: 500;
    transition: 0.2s;
}

.modal .modal-content button:hover {
    background: #e68900;
}

.modal .modal-content .close-modal {
    background: #aaa;
}

.modal .modal-content .close-modal:hover {
    background: #888;
}

.modal .modal-content .switch-mode {
    margin-top: 12px;
    font-size: 13px;
    color: #ff9800;
    cursor: pointer;
    display: inline-block;
}

.modal .modal-content .switch-mode:hover {
    text-decoration: underline;
}

/* 访问受限页面 */
.access-denied {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 24px;
    margin: 40px auto;
    max-width: 500px;
}

.access-denied h2 {
    color: #e74c3c;
    margin-bottom: 16px;
}

.access-denied a {
    color: #ff9800;
    text-decoration: none;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        text-align: center;
    }
    .container {
        padding: 20px 16px;
    }
    .modal .modal-content {
        padding: 20px;
    }
    .auth-area {
        min-width: auto;
    }
    .welcome-text, .login-btn, .logout-btn {
        white-space: normal;
    }
}