/* ============================================================
   注册页面样式 — 简约深色风格
   参考：深色卡片 + 圆角 + 轻阴影
   ============================================================ */

/* ── 全局重置 ─────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── 全屏背景 ─────────────────────────────────────────────── */
body {
    min-height: 100vh;
    background-color: #0a0a12;
    background-image: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Microsoft YaHei', sans-serif;
    color: #e0e0e0;
}

/* ── 注册卡片容器 ─────────────────────────────────────────── */
.register-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    padding: 36px 32px;
    background: #1e1e2e;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* ── 游戏标题 ─────────────────────────────────────────────── */
.game-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

/* ── 副标题 ───────────────────────────────────────────────── */
.register-subtitle {
    text-align: center;
    font-size: 12px;
    color: #6b6b80;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

/* ── 注册警示提示 ─────────────────────────────────────────── */
.register-warning {
    text-align: center;
    font-size: 12px;
    color: #e06060;
    line-height: 1.8;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: rgba(220, 80, 80, 0.08);
    border: 1px solid rgba(220, 80, 80, 0.2);
    border-radius: 10px;
}

/* ── 全局消息提示区域 ─────────────────────────────────────── */
.global-message {
    display: none;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.8;
    text-align: center;
    white-space: pre-line; /* 支持 \n 换行 */
}

.global-message.error {
    background: rgba(220, 80, 80, 0.12);
    border: 1px solid rgba(220, 80, 80, 0.3);
    color: #f08080;
}

.global-message.success {
    background: rgba(80, 200, 120, 0.12);
    border: 1px solid rgba(80, 200, 120, 0.3);
    color: #80e0a0;
}

.global-message.info {
    background: rgba(80, 160, 220, 0.12);
    border: 1px solid rgba(80, 160, 220, 0.3);
    color: #80c0f0;
}

/* ── 表单组 ───────────────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}

/* ── 输入框容器（标签 + 输入框横排） ─────────────────────── */
.input-wrap {
    display: flex;
    align-items: center;
    background: #2a2a3e;
    border: 1px solid #2e2e42;
    border-radius: 25px;
    padding: 0 16px;
    transition: border-color 0.15s, background 0.15s;
}

.input-wrap:focus-within {
    border-color: #4a4a6a;
    background: #2e2e44;
}

.input-wrap.error-input {
    border-color: #c04040;
}

/* ── 左侧固定标签 ─────────────────────────────────────────── */
.input-label {
    font-size: 15px;
    color: #8080b0;
    white-space: nowrap;
    padding-right: 10px;
    border-right: 1px solid #3a3a54;
    line-height: 1;
    user-select: none;
}

/* ── 输入框本体 ───────────────────────────────────────────── */
.input-wrap input {
    flex: 1;
    padding: 12px 0 12px 12px;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 15px;
    outline: none;
    min-width: 0;
}

.input-wrap input::placeholder {
    color: #44445a;
}

/* ── 密码显示/隐藏按钮 ────────────────────────────────────── */
.toggle-password {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px 0 4px;
    color: #44445a;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    user-select: none;
    transition: color 0.15s;
}
.toggle-password:hover { color: #6b6b80; }
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #2a2a3e inset;
    -webkit-text-fill-color: #e0e0e0;
    caret-color: #e0e0e0;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── 错误提示文字 ─────────────────────────────────────────── */
.error-message {
    display: none;
    margin-top: 5px;
    font-size: 12px;
    color: #e06060;
    line-height: 1.4;
}

/* ── 检查中提示 ───────────────────────────────────────────── */
.checking-message {
    margin-top: 5px;
    font-size: 12px;
    color: #55556a;
    line-height: 1.4;
}

/* ── 账号可用提示 ─────────────────────────────────────────── */
.available-message {
    margin-top: 5px;
    font-size: 12px;
    color: #60c080;
    line-height: 1.4;
}

/* ── 注册按钮容器（居中，不撑满） ────────────────────────── */
.register-btn-wrap {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

/* ── 注册按钮 ─────────────────────────────────────────────── */
.register-btn {
    width: 200px;
    padding: 11px 0;
    background: #2e2e44;
    border: 1px solid #3a3a54;
    border-radius: 25px;
    color: #c0c0d8;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 3px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.register-btn:hover:not(:disabled) {
    background: #38384e;
    border-color: #4a4a6a;
    color: #e0e0f0;
}

.register-btn:active:not(:disabled) {
    background: #28283e;
}

.register-btn:disabled {
    background: #222230;
    border-color: #2a2a3a;
    color: #44445a;
    cursor: not-allowed;
}

/* ============================================================
   移动端适配（视口宽度 < 768px）
   ============================================================ */
@media (max-width: 767px) {
    body {
        align-items: flex-start;
        padding: 24px 16px 40px;
        background-attachment: scroll;
    }

    .register-container {
        max-width: 100%;
        padding: 28px 20px;
        margin-top: 24px;
        border-radius: 14px;
    }

    .game-title {
        font-size: 20px;
    }

    .form-group input {
        font-size: 16px; /* 防止 iOS 自动缩放 */
        padding: 13px 14px;
    }

    .register-btn {
        width: 160px;
        padding: 13px 0;
    }
}

/* ============================================================
   注册确认弹窗
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-box {
    width: 100%;
    max-width: 540px;
    background: #1e1e2e;
    border-radius: 16px;
    padding: 28px 24px 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.modal-warning {
    font-size: 15px;
    font-weight: 700;
    color: #e0e0e0;
    text-align: center;
    margin-bottom: 8px;
}

.modal-tip {
    font-size: 16px;
    color: #ff0000;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* 账号密码展示区 */
.modal-info {
    background: #2a2a3e;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
}

.modal-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
}

.modal-row + .modal-row {
    border-top: 1px solid #33334a;
}

.modal-label {
    font-size: 12px;
    color: #6b6b80;
    width: 40px;
    flex-shrink: 0;
}

.modal-value {
    font-size: 15px;
    font-weight: 600;
    color: #e0e0f0;
    letter-spacing: 1px;
    word-break: break-all;
}

/* 按钮区 */
.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 11px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
}

.modal-btn-cancel {
    background: #2a2a3e;
    color: #6b6b80;
}

.modal-btn-cancel:hover {
    background: #32324a;
    color: #a0a0b8;
}

.modal-btn-confirm {
    background: #38384e;
    color: #c0c0d8;
    border: 1px solid #4a4a6a;
}

.modal-btn-confirm:hover {
    background: #44445e;
    color: #e0e0f0;
}
