/**
 * 登录过期弹窗样式
 *
 * 类命名空间：.token-expired-*
 * 触发源：static/js/common/userIdentity.js 在 401 时调用
 *
 * 视觉说明（参照设计稿 - 横向紧凑型通知，整体放大版）：
 *   - 横向布局：顶部左侧 [红色 X 图标] + 标题，描述紧随其下，底部右侧两个按钮
 *   - 卡片较宽，元素尺寸放大，视觉更醒目
 *   - 右上角 X 关闭按钮；底部 [取消] + [重新登录]（蓝）双按钮
 *   - 整体感觉类似 Element UI / Ant Design 的 Modal 弹窗
 */

/* ===== 遮罩层 ===== */
.token-expired-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: tokenExpiredFadeIn 0.2s ease-out;
    box-sizing: border-box;
}

@keyframes tokenExpiredFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== 卡片（横向放大版） ===== */
.token-expired-modal {
    position: relative;
    /* 为右上角关闭按钮提供定位锚点 */
    width: 100%;
    max-width: 30rem;
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1rem 3rem -0.5rem rgba(15, 23, 42, 0.22),
        0 0.375rem 1rem -0.125rem rgba(15, 23, 42, 0.1);
    padding: 1.75rem 2rem 1.5rem;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
    animation: tokenExpiredPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tokenExpiredPop {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== 右上角关闭按钮 ===== */
.token-expired-close {
    position: absolute;
    top: 0.625rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    color: #9ca3af;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.6rem;
    text-align: center;
    transition: background-color 0.15s ease, color 0.15s ease;
    font-family: inherit;
    cursor: pointer;
}

.token-expired-close:hover {
    background: #f3f4f6;
    color: #374151;
    border-radius: 50%;
}

.token-expired-close:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 1px;
}

/* ===== 顶部行：图标 + 标题 ===== */
.token-expired-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
    /* 给右上角关闭按钮预留空间，避免与标题重叠 */
    padding-right: 2rem;
}

.token-expired-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #ff5e5e;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.6rem;
    text-align: center;
}

.token-expired-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2329;
    line-height: 1.2;
}

/* ===== 描述 ===== */
.token-expired-message {
    margin: 0 0 1.5rem;
    font-size: 0.9375rem;
    color: #6b7280;
    line-height: 1.5;
    padding-left: 2.625rem;
    /* 对齐标题起始位置（icon 2 + gap 0.625） */
}

/* ===== 底部操作区（双按钮） ===== */
.token-expired-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
}

/* 按钮公共样式 */
.token-expired-btn {
    padding: 0.625rem 1.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease,
        box-shadow 0.15s ease, border-color 0.15s ease;
    font-family: inherit;
    outline: none;
    min-width: 5.5rem;
}

/* 次要按钮（取消） */
.token-expired-btn-cancel {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.token-expired-btn-cancel:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.token-expired-btn-cancel:active {
    background: #f3f4f6;
}

/* 主按钮（重新登录） */
.token-expired-btn-primary {
    background: #3b82f6;
    color: #ffffff;
    border: 1px solid #3b82f6;
    box-shadow: 0 0.375rem 1rem -0.25rem rgba(59, 130, 246, 0.45);
}

.token-expired-btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 0.5rem 1.25rem -0.25rem rgba(59, 130, 246, 0.55);
}

.token-expired-btn-primary:active {
    transform: translateY(0);
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.token-expired-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}