/* 📄 login.css —— 🎨 登录页样式 | 登录框、页签、按钮、背景 */

/* ========== 全局 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
    padding: 20px;
}

/* ========== 主卡片 ========== */
.login-container {
    width: 550px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========== 标题 ========== */
.title-box h1 {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ========== 分隔线 ========== */
.divider {
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    margin: 25px 0;
    border-radius: 1px;
}

/* ========== 标签页 ========== */
.tab-container {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.tab-header {
    display: flex;
    background: var(--bg-soft);
    border-bottom: 1px solid #e8e8e8;
}

.tab-btn {
    flex: 1;
    padding: 15px 25px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-family: inherit;
}

.tab-btn:hover {
    background: #e8e8e8;
    color: var(--text);
}

.tab-btn.active {
    color: var(--brand);
    background: var(--card-bg);
    font-weight: bold;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

/* ========== 面板 ========== */
.tab-panel {
    display: none;
    padding: 30px;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.panel-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--brand);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e8e8e8;
}

/* ========== 表单 ========== */
.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
}

.form-group label {
    width: 110px;
    font-size: 14px;
    color: #2d3748;
    font-weight: 600;
    flex-shrink: 0;
    text-align: right;
    padding-right: 12px;
    white-space: nowrap;
}

.form-group input {
    flex: 1;
    padding: 10px 15px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: #2d3748;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    border-color: var(--brand);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-group input::placeholder {
    color: #8892a0;
}

/* ========== 底部按钮区 ========== */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.register-link {
    color: #93c5fd;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.register-link:hover {
    color: #ffffff;
    text-decoration: underline;
    text-shadow: 0 0 10px rgba(147, 197, 253, 0.8);
}

.btn-group {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 30px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-login {
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text);
}

.btn-cancel:hover {
    background: var(--card-bg);
    color: #111111;
}

/* ========== 提示弹窗 ========== */
.toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #333333;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    max-width: 500px;
    text-align: center;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success { background: linear-gradient(90deg, #22c55e, #16a34a); }
.toast.error   { background: linear-gradient(90deg, var(--danger), var(--danger-hover)); }
.toast.warning { background: linear-gradient(90deg, #f59e0b, #d97706); }
.toast.info    { background: linear-gradient(90deg, var(--accent), var(--accent-hover)); }

/* ========== 响应式 ========== */
@media (max-width: 600px) {
    .login-container {
        width: 100%;
        padding: 25px;
    }
    .title-box h1 {
        font-size: 18px;
    }
    .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    .form-group label {
        width: 100%;
        text-align: left;
        margin-bottom: 5px;
        padding-right: 0;
    }
}

/* ============================================================ */
/* ==================== 记住账号复选框 ==================== */
/* ============================================================ */
.remember-group {
    margin-top: -6px;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #5a6b82;
    user-select: none;
    font-weight: normal !important;
    width: auto !important;
    text-align: left !important;
    padding-right: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #667eea;
    margin: 0;
    flex-shrink: 0;
}

.checkbox-label span {
    color: #5a6b82;
}

.checkbox-label:hover span {
    color: var(--brand);
}


/* ============================================================ */
/* ==================== ★ 自定义弹窗样式 ★ ==================== */
/* ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeInModal 0.15s ease;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    animation: slideInModal 0.18s ease;
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: var(--brand);
}

.modal-close {
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.15s;
    user-select: none;
}

.modal-close:hover {
    background: var(--bg-soft);
    color: var(--danger);
}

.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #eef0f5;
    background: var(--bg-soft);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-secondary {
    background: #9ca3af;
    color: #ffffff;
    border: none;
    height: 36px;
    padding: 0 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    font-family: inherit;
    transition: background 0.15s ease;
}

.btn-secondary:hover {
    background: #6b7280;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    height: 36px;
    padding: 0 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    font-family: inherit;
    transition: background 0.15s ease;
}

.btn-danger:hover {
    background: #c0392b;
}

/* ============================================================ */
/* ==================== ★ 弹窗表单样式 ★ ==================== */
/* ============================================================ */

/* 弹窗主体内容区 */
.modal-body {
    padding: 20px 25px;
}

/* 弹窗表单行 */
.modal-body p {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}

/* 弹窗表单 label */
.modal-body p label {
    width: 110px;
    font-size: 14px;
    color: #2d3748;
    font-weight: 600;
    text-align: right;
    padding-right: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* 弹窗表单 input */
.modal-body p input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: #2d3748;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.modal-body p input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.modal-body p input::placeholder {
    color: #8892a0;
}

/* 主按钮（蓝色） */
.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border: none;
    height: 36px;
    padding: 0 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: var(--accent);
}

.btn-primary:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================ */
/* ==================== ★ 弹窗悬浮提示条 ★ ==================== */
/* ============================================================ */

.modal-error {
    display: none;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 500;
}

.modal-error.show {
    display: block;
    animation: fadeInModal 0.2s ease;
}

.modal-error.error {
    background: #fef2f2;
    color: #dc2626;
    border-left: 3px solid #dc2626;
}

.modal-error.success {
    background: #f0fdf4;
    color: #16a34a;
    border-left: 3px solid #16a34a;
}

.modal-error.warning {
    background: #fffbeb;
    color: #d97706;
    border-left: 3px solid #d97706;
}

/* ============================================================ */
/* ==================== ★ 注册弹窗专用样式 ★ ==================== */
/* ============================================================ */

#server-register-overlay .modal-box {
    width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#server-register-overlay .modal-body {
    overflow-y: auto;
    max-height: calc(90vh - 130px);
}

/* 注册弹窗的提示框 */
.reg-warning-tip {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fff8e1;
    border-left: 3px solid #f39c12;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}


/* ============================================================ */
/* ==================== ★ 居中悬浮提示（不占位）★ ==================== */
/* ============================================================ */

.center-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);

    min-width: 260px;
    max-width: 420px;
    text-align: center;
    white-space: normal;       /* 允许换行：登录页提示可能较长 */
    word-break: break-word;

    background: #eff6ff;
    color: #2563eb;
    padding: 16px 28px;
    border-radius: 12px;
    border: 2px solid #2563eb;
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.5);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.5;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 100000;
}

.center-message.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.center-message.success {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #16a34a;
    box-shadow: 0 20px 60px rgba(22, 163, 74, 0.5);
}

.center-message.error {
    background: #fef2f2;
    color: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 20px 60px rgba(220, 38, 38, 0.5);
}

.center-message.warning {
    background: #fffbeb;
    color: #d97706;
    border-color: #d97706;
    box-shadow: 0 20px 60px rgba(217, 119, 6, 0.5);
}

.center-message.info {
    background: #eff6ff;
    color: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.5);
}