/* ========================================
   PHP 登录系统 - 全局样式文件
   版本：1.0
   ======================================== */

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

/* 🔥 修改这里：去掉 display:flex，恢复普通布局 */
body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
    color: #333;
    
}
/* 🆕 新增：专门用于登录/注册页的居中包装器 */
.center-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}
/* ---------------- 容器样式 ---------------- */
.container {
    max-width: 420px;
    width: 100%; /* 改为 100% 适应小屏幕，最大不超过 max-width */
    padding: 40px 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    
    /* ✅ 确保容器内部正常显示 */
    position: relative; 
    z-index: 10;
}

.container-wide {
    max-width: 800px;
    margin: 50px auto;
    padding: 20px 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* ---------------- 标题样式 ---------------- */
h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
}

h1 {
    color: #333;
    font-size: 20px;
}

/* ---------------- 表单样式 ---------------- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.form-group input.error {
    border-color: #dc3545;
}

.form-group input.success {
    border-color: #28a745;
}

.form-group input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

/* ---------------- 按钮样式 ---------------- */
button, .btn {
    padding: 14px 25px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    border: none;
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

button:disabled, .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 按钮颜色变体 */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #fff;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 14px;
}

/* ---------------- 消息提示框 ---------------- */
.message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start; /* ✅ 改为 flex-start，允许内容换行 */
    gap: 10px;
    font-size: 14px;
    
    /* ✅ 新增：确保内容可以换行 */
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.5;
}

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

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

.message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ✅ 新增：消息内容样式，确保换行 */
.message-content {
    flex: 1;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ---------------- 用户信息框 ---------------- */
.user-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.user-info span {
    color: #667eea;
    font-weight: 600;
}

/* ---------------- 信息展示框 ---------------- */
.info-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-box h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.info-box p {
    color: #666;
    margin-bottom: 10px;
}

/* ---------------- 安全提示框 ---------------- */
.security-tips, .security-notice {
    background: #e7f3ff;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #0c5460;
}

.security-notice {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    margin-top: 20px;
}

.security-tips ul, .security-notice ul {
    margin-left: 20px;
    margin-top: 8px;
}

.security-tips li, .security-notice li {
    margin-bottom: 5px;
}

/* ---------------- 密码强度条 ---------------- */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 8px;
    transition: all 0.3s;
}

.strength-weak {
    background: #dc3545;
    width: 33%;
}

.strength-medium {
    background: #ffc107;
    width: 66%;
}

.strength-strong {
    background: #28a745;
    width: 100%;
}

.strength-text {
    font-size: 12px;
    margin-top: 5px;
    color: #666;
}

/* ---------------- 页脚链接 ---------------- */
.footer, .back-link {
    text-align: center;
    margin-top: 25px;
    color: #666;
    font-size: 14px;
}

.footer a, .back-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover, .back-link a:hover {
    text-decoration: underline;
}

/* ---------------- 导航栏 ---------------- */
.navbar {
    background: rgba(255,255,255,0.95);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar h1 {
    color: #333;
    font-size: 20px;
}

.navbar .user-menu {
    display: flex;
    gap: 15px;
    align-items: center;
}

.navbar .user-menu span {
    color: #667eea;
    font-weight: 600;
}

/* ---------------- 按钮组 ---------------- */
.btn-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* ---------------- 欢迎区域 ---------------- */
.welcome {
    text-align: center;
    margin-bottom: 30px;
}

.welcome h2 {
    color: #333;
    margin-bottom: 10px;
}

.welcome p {
    color: #666;
}

/* ---------------- 成功页面 ---------------- */
.success-box {
    background: #fff;
    padding: 50px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 90%;
}

.success-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.countdown {
    color: #999;
    font-size: 14px;
    margin-top: 20px;
}

/* ---------------- 工具类 ---------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }

/* ---------------- 响应式设计 ---------------- */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }
    
    .container-wide {
        margin: 20px auto;
        padding: 20px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}

/* ---------------- 打印样式 ---------------- */
@media print {
    body {
        background: #fff;
    }
    
    .container, .container-wide {
        box-shadow: none;
    }
    
    button, .btn {
        display: none;
    }
}