/* =====================================================
 * BindWarning.css — v7.2.5+ 网页端风格
 * 核心原则：
 *  1. 严格对齐：所有 flex 容器用 align-items: center
 *  2. 角色卡 3 列：头像 | 信息（左对齐）| 战力（右对齐）
 *  3. 桌面 + 移动端双适配
 * ===================================================== */

.bind-warn-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    box-sizing: border-box;
}

.bind-warn-card {
    width: 100%;
    max-width: 560px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    color: #e5e7eb;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

/* =====================================================
 * 顶部工具栏：返回上一页 + 退出登录
 * 桌面端：左对齐两个小按钮（不抢戏）
 * ===================================================== */
.bind-warn-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -0.5rem 0 1.25rem 0;
    gap: 0.5rem;
}

.bw-tool-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    line-height: 1;
}

.bw-tool-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e5e7eb;
}

.bw-tool-exit {
    color: #6b7280;
    border-color: rgba(255, 255, 255, 0.06);
}

.bw-tool-exit:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* =====================================================
 * 角色预览卡
 * 结构：[头像 64px] [信息 左对齐] [战力 右对齐]
 * ===================================================== */
.role-card {
    display: flex;
    align-items: center;          /* 严格垂直居中 */
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    min-height: 88px;             /* 保证高度统一 */
}

.role-card-avatar {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(139, 92, 246, 0.4);
    flex-shrink: 0;
}

.role-card-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.role-card-avatar-emoji {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.06);
}

.role-card-info {
    flex: 1;
    min-width: 0;
    text-align: left;             /* 全部左对齐 */
}

.role-card-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f3f4f6;
    margin: 0 0 0.35rem 0;       /* 去掉默认外边距 */
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-card-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #9ca3af;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.role-card-meta-item {
    color: #9ca3af;
    white-space: nowrap;
}

.role-card-lv {
    color: #c7d2fe;
    font-weight: 600;
}

.role-card-meta-sep {
    color: #4b5563;
    user-select: none;
}

.role-card-power {
    flex: 0 0 auto;
    text-align: right;            /* 靠右对齐 */
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    line-height: 1.2;
}

.role-card-power-label {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.3rem;
    letter-spacing: 0.05em;
}

.role-card-power-value {
    font-size: 1.35rem;           /* 加大战力字号 */
    font-weight: 700;
    color: #fbbf24;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* =====================================================
 * 主按钮（直接进入游戏 / 进入游戏）
 * 放在角色卡下方，醒目位置
 * ===================================================== */
.warn-btn {
    width: 100%;
    padding: 0.95rem 1.5rem;
    border-radius: 10px;
    border: none;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    margin-bottom: 1.5rem;
    display: flex;                /* 文字严格居中 */
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.warn-btn.primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.warn-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.warn-btn.primary:active {
    transform: translateY(0);
}

.warn-btn.ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #9ca3af;
    margin: 0;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    width: auto;                  /* ghost 不强制 100% */
    min-width: 140px;
}

.warn-btn.ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e5e7eb;
}

/* =====================================================
 * 绑定微信区域
 * ===================================================== */
.bind-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.5rem;
}

/* =====================================================
 * 倒计时警告条（核心：剩余天数）
 * 结构：[倒计时大数字] [标题+副标题]
 * ===================================================== */
.bind-alert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-left: 4px solid #fbbf24;       /* 左侧色条 */
    border-radius: 10px;
    text-align: left;
}

/* 紧急态：≤ 7 天 → 红色 */
.bind-alert-urgent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.05));
    border-color: rgba(239, 68, 68, 0.35);
    border-left-color: #ef4444;
}

.bind-alert-countdown {
    flex: 0 0 auto;
    text-align: center;
    min-width: 70px;
    padding: 0.4rem 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    line-height: 1;
}

.bind-alert-num {
    font-size: 2rem;
    font-weight: 800;
    color: #fbbf24;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.bind-alert-urgent .bind-alert-num {
    color: #fca5a5;
}

.bind-alert-num.danger {
    color: #ef4444;
    font-size: 2.25rem;
}

.bind-alert-unit {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 0.2rem;
    letter-spacing: 0.05em;
}

.bind-alert-body {
    flex: 1;
    min-width: 0;
}

.bind-alert-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fef3c7;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.bind-alert-urgent .bind-alert-title {
    color: #fee2e2;
}

.bind-alert-sub {
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.4;
}

/* 已绑定状态 */
.bind-success {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 8px;
    text-align: left;
}

.bind-success-icon {
    font-size: 1.25rem;
    flex: 0 0 auto;
}

.bind-success-content {
    flex: 1;
    min-width: 0;
}

.bind-success-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #86efac;
    margin-bottom: 0.15rem;
}

.bind-success-desc {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* 绑定码 + 复制（一行，高度严格对齐） */
.bind-code-row {
    display: flex;
    align-items: stretch;         /* 高度拉伸对齐 */
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.bind-code-value {
    flex: 1;
    min-width: 0;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fbbf24;
    letter-spacing: 0.15em;
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 8px;
    user-select: all;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bind-copy-btn {
    flex: 0 0 auto;
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fbbf24;
    padding: 0 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.bind-copy-btn:hover {
    background: rgba(251, 191, 36, 0.25);
    border-color: rgba(251, 191, 36, 0.5);
}

/* 绑定区操作行（居中） */
.bind-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.regen-msg {
    font-size: 0.8rem;
    color: #c7d2fe;
    flex: 1 1 100%;
    text-align: center;
}

/* =====================================================
 * 无角色状态：bind-no-role（v7.2.7+）
 * 层次感：顶部图标+标题 → 三步卡片 → 绑定码 → 操作按钮
 * ===================================================== */
.bind-no-role {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 顶部区域 */
.bnr-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    padding: 1.25rem 1rem;
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 12px;
}

.bnr-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.bnr-headline {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f3f4f6;
    line-height: 1.3;
}

.bnr-desc {
    font-size: 0.85rem;
    color: #9ca3af;
    line-height: 1.5;
    max-width: 380px;
}

/* 三步卡片 */
.bnr-steps {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.bnr-step {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
}

.bnr-step-num {
    flex: 0 0 auto;
    font-size: 1.25rem;
    line-height: 1;
    padding-top: 0.05rem;
    color: #a5b4fc;
}

.bnr-step-body {
    flex: 1;
    min-width: 0;
    text-align: left;             /* 强制左对齐，贴近序号 */
}

.bnr-step-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.bnr-step-sub {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
}

/* code 标签（绑定指令示例） */
.bnr-step code {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.78rem;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.08);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

/* 操作按钮行 */
.bnr-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bnr-actions .warn-btn.ghost {
    flex: 1;
    min-width: 130px;
}

/* 冷却中按钮禁用态 */
.warn-btn.ghost:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* =====================================================
 * 移动端适配（<= 480px）
 * ===================================================== */
@media (max-width: 480px) {
    .bind-warn-page {
        padding: 1rem 0.75rem;
    }

    .bind-warn-card {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }

    /* 角色卡在窄屏：2 行布局（头像+信息 / 战力满宽） */
    .role-card {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.875rem 1rem;
        min-height: auto;
    }

    .role-card-avatar {
        flex: 0 0 56px;
        width: 56px;
        height: 56px;
        font-size: 1.75rem;
    }

    .role-card-info {
        flex: 1;
        min-width: 0;
    }

    /* 战力下移到第二行，左对齐 + 小标签在左 */
    .role-card-power {
        flex: 1 1 100%;
        text-align: left;
        border-left: none;
        border-top: 1px dashed rgba(255, 255, 255, 0.08);
        padding-left: 0;
        padding-top: 0.6rem;
        display: flex;
        align-items: baseline;
        gap: 0.5rem;
    }

    .role-card-power-label {
        margin-bottom: 0;
    }

    .role-card-power-value {
        font-size: 1.15rem;
    }

    /* 按钮在窄屏保持全宽 */
    .warn-btn {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }

    .warn-btn.ghost {
        width: 100%;
        min-width: 0;
    }

    /* 绑定码在窄屏：缩小字号 + 复制按钮缩小 */
    .bind-code-value {
        font-size: 1.05rem;
        letter-spacing: 0.1em;
        padding: 0.65rem 0.4rem;
    }

    .bind-copy-btn {
        padding: 0 0.75rem;
        font-size: 0.85rem;
        min-width: 70px;
    }

    /* 倒计时警告条：数字缩小 */
    .bind-alert {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .bind-alert-countdown {
        min-width: 60px;
        padding: 0.3rem 0.5rem;
    }

    .bind-alert-num {
        font-size: 1.65rem;
    }

    .bind-alert-num.danger {
        font-size: 1.85rem;
    }

    .bind-alert-title {
        font-size: 0.875rem;
    }

    .bind-alert-sub {
        font-size: 0.75rem;
    }

    .bind-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .regen-msg {
        flex: 0 0 auto;
    }

    /* 无角色区域移动端适配 */
    .bnr-header {
        padding: 1rem 0.75rem;
    }

    .bnr-icon {
        font-size: 2rem;
    }

    .bnr-headline {
        font-size: 1rem;
    }

    .bnr-desc {
        font-size: 0.8rem;
    }

    .bnr-step {
        padding: 0.75rem;
        gap: 0.7rem;
    }

    .bnr-step-num {
        font-size: 1.1rem;
    }

    .bnr-step-title {
        font-size: 0.875rem;
    }

    .bnr-step-sub {
        font-size: 0.775rem;
    }

    .bnr-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .bnr-actions .warn-btn.ghost {
        min-width: 0;
        width: 100%;
    }
}

/* =====================================================
 * 极窄屏适配（<= 360px，老手机）
 * ===================================================== */
@media (max-width: 360px) {
    .bind-warn-card {
        padding: 1.25rem 0.75rem;
    }

    .role-card-meta {
        font-size: 0.8rem;
    }

    .bind-code-value {
        font-size: 0.95rem;
        letter-spacing: 0.05em;
    }
}
