/* ========== 登录页样式 ========== */
#loginPage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

/* 登录页左上角Logo */
.login-page-logo {
    position: absolute;
    top: 35px;
    left: 35px;
    width: 50px;
    height: 50px;
    z-index: 10;
}

/* 登录页背景 */
.login-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: -1;
}

/* 背景图片层 */
.login-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/bg_login.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* 登录框 */
#loginBox {
    width: 90%;
    max-width: 380px;
    padding: 28px 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.login-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--theme-color);
    margin: 0 0 5px 0;
}

/* 登录框头部布局 */
.login-header {
    text-align: center;
    margin-bottom: 18px;
}

/* 登录副标题 */
.login-subtitle {
    font-size: 18px;
    font-weight: 500;
    color: #555;
    margin: 0;
}

#loginBox .form-group {
    margin-bottom: 20px;
}

#loginBox .form-control {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#loginBox .form-control:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 4px rgba(211, 91, 126, 0.1);
}

#loginBox .form-control::placeholder {
    color: #aaa;
}

/* 登录链接区 */
.login-links {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.login-links a {
    color: var(--theme-color);
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.2s;
}

.login-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* 管理员入口 */
#adminEntry {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

#adminEntry a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s;
}

#adminEntry a:hover {
    color: rgba(255, 255, 255, 1);
}

/* 隐藏登录页 */
#loginPage.hidden {
    display: none;
}


/* ========== 注册/管理员弹窗样式 ========== */
#registerModal .modal-content,
#adminLoginModal .modal-content {
    width: 400px;
    max-width: 90%;
}

#adminPanelModal .modal-content {
    width: 550px;
    max-width: 95%;
}


/* ========== 管理员面板样式 ========== */
.admin-section {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
}

.admin-section:last-child {
    margin-bottom: 0;
}

.admin-section h4 {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* 注册码生成区域 */
.code-generate-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.batch-code-select {
    width: 160px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

/* 注册码统计 */
.code-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 15px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
}

.code-stats strong {
    color: var(--theme-color);
    font-weight: 600;
}

.ml-20 {
    margin-left: 20px;
}

/* 注册码列表 */
.code-list {
    max-height: 200px;
    overflow-y: auto;
}

.code-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
}

.code-item:last-child {
    margin-bottom: 0;
}

.code-item .code-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.code-item .code-text {
    color: var(--theme-color);
    font-weight: 500;
    font-family: 'Consolas', 'Monaco', monospace;
}

.code-item .code-time {
    font-size: 12px;
    color: #999;
}

.code-item .code-actions {
    display: flex;
    gap: 8px;
}

.code-item .btn-copy,
.code-item .btn-delete {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.code-item .btn-copy {
    background: #e3f2fd;
    color: #1976d2;
}

.code-item .btn-copy:hover {
    background: #bbdefb;
}

.code-item .btn-delete {
    background: #ffebee;
    color: #c62828;
}

.code-item .btn-delete:hover {
    background: #ffcdd2;
}

/* 用户列表 */
.user-list {
    max-height: 200px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.user-item:last-child {
    margin-bottom: 0;
}

.user-item .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-item .user-name {
    font-weight: 500;
    color: #333;
}

.user-item .user-status {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.user-item .user-status.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.user-item .user-status.disabled {
    background: #ffebee;
    color: #c62828;
}

.user-item .user-actions {
    display: flex;
    gap: 8px;
}

.user-item .btn-disable,
.user-item .btn-enable,
.user-item .btn-delete-user {
    padding: 4px 10px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-item .btn-disable {
    background: #fff3e0;
    color: #e65100;
}

.user-item .btn-disable:hover {
    background: #ffe0b2;
}

.user-item .btn-enable {
    background: #e8f5e9;
    color: #2e7d32;
}

.user-item .btn-enable:hover {
    background: #c8e6c9;
}

.user-item .btn-delete-user {
    background: #ffebee;
    color: #c62828;
}

.user-item .btn-delete-user:hover {
    background: #ffcdd2;
}


/* ========== 忘记密码弹窗样式 ========== */
#forgotPasswordModal .modal-content {
    width: 400px;
    max-width: 90%;
}

.forgot-password-tip {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #f5f5f5;
    border-radius: 6px;
    border-left: 3px solid var(--theme-color);
}


/* ========== 登录页响应式 ========== */
@media (max-width: 480px) {
    #loginBox {
        padding: 30px 20px;
    }
    
    .login-title {
        font-size: 24px;
        margin-bottom: 25px;
    }
    
    #loginBox .form-control {
        height: 44px;
    }
    
    .btn-block {
        height: 44px;
    }
    
    .admin-section {
        padding: 12px;
    }
    
    .code-item,
    .user-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .code-item .code-actions,
    .user-item .user-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .login-links {
        flex-direction: column;
        gap: 10px;
    }
}
