/* ========================================
   弹窗登录样式 — 对齐 /login 页面大卡片
   ======================================== */

.gsage-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 桌面弹窗容器 ===== */
.gsage-modal-desktop {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: gsageModalFadeIn 0.25s ease;
}

/* ===== 手机弹窗卡片（flex item，父级居中） ===== */
.gsage-mmodal {
    display: none;
    width: 82%;
    max-width: 360px;
    background: #fff;
    border-radius: 0.8rem;
    overflow: hidden;
    position: relative;
    animation: gsageModalScaleIn 0.25s ease;
}

.gsage-modal-inner {
    position: relative;
    width: 100%;
    max-width: 840px;
    padding: 20px;
    box-sizing: border-box;
}

.gsage-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    line-height: 36px;
    color: #161823;
    opacity: 0.55;
    cursor: pointer;
    text-align: center;
    padding: 0;
    transition: opacity 0.2s;
}

.gsage-modal-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}

/* ===== 大卡片 ===== */
.gsage-modal-card {
    display: flex;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    animation: gsageModalScaleIn 0.25s ease;
}

.gsage-modal-card--has-side {
    max-width: 800px;
}

.gsage-modal-card:not(.gsage-modal-card--has-side) {
    max-width: 440px;
}

/* ===== 左侧配图 ===== */
.gsage-modal-card-left {
    flex: 1 1 50%;
    min-height: 480px;
    position: relative;
    overflow: hidden;
}

.gsage-modal-sideimg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 60% center;
}

.gsage-modal-sideimg-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent 0%, transparent 35%, #fff 100%);
    pointer-events: none;
}

/* ===== 右侧表单 ===== */
.gsage-modal-card-right {
    flex: 0 0 400px;
    width: 400px;
    display: flex;
    flex-direction: column;
}

.gsage-modal-card:not(.gsage-modal-card--has-side) .gsage-modal-card-right {
    flex: 1 1 auto;
    width: auto;
}

/* ===== Tab 切换 ===== */
.gsage-modal-tabs {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
    padding: 0 24px;
    flex-shrink: 0;
}

.gsage-modal-tab {
    position: relative;
    padding: 18px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #8590a6;
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
    background: none;
    border: none;
}

.gsage-modal-tab:hover {
    color: #1a1a1a;
}

.gsage-modal-tab.active {
    color: #1a1a1a;
    font-weight: 600;
}

.gsage-modal-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: #0066cc;
    border-radius: 2px;
}

/* ===== 表单面板 ===== */
.gsage-modal-panel {
    display: none;
}

.gsage-modal-panel.active {
    display: block;
}

.gsage-modal-panels {
    padding: 24px;
    flex: 1;
}

.gsage-modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gsage-modal-input-group {
    position: relative;
}

.gsage-modal-input {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    color: #1a1a1a;
    background: #fafafa;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s;
}

.gsage-modal-input:focus {
    border-color: #0066cc;
    background: #fff;
}

.gsage-modal-input::placeholder {
    color: #bbb;
}

/* ===== 选项行 ===== */
.gsage-modal-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.gsage-modal-remember {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #8590a6;
    cursor: pointer;
}

.gsage-modal-remember input[type="checkbox"] {
    accent-color: #0066cc;
}

.gsage-modal-switch-link {
    color: #0066cc;
    text-decoration: none;
    font-size: 13px;
}

.gsage-modal-switch-link:hover {
    text-decoration: underline;
}

/* ===== 错误/成功提示 ===== */
.gsage-modal-error {
    padding: 10px 14px;
    background: #fff2f0;
    border: 1px solid #ffccc7;
    border-radius: 6px;
    color: #cf1322;
    font-size: 13px;
    line-height: 1.5;
}

.gsage-modal-success {
    padding: 10px 14px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 6px;
    color: #389e0d;
    font-size: 13px;
    line-height: 1.5;
}

/* ===== 提交按钮 ===== */
.gsage-modal-submit {
    width: 100%;
    height: 46px;
    background: #0066cc;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}

.gsage-modal-submit:hover {
    background: #0052a3;
}

.gsage-modal-submit:disabled {
    background: #a0c4e8;
    cursor: not-allowed;
}

/* ===== 社交登录分割线 ===== */
.gsage-modal-divider {
    display: flex;
    align-items: center;
    margin: 0 24px 16px;
    color: #8590a6;
    font-size: 13px;
}

.gsage-modal-divider::before,
.gsage-modal-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #f0f0f0;
}

.gsage-modal-divider span {
    margin: 0 16px;
    white-space: nowrap;
}

/* ===== 社交登录按钮 ===== */
.gsage-modal-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 0 24px 12px;
}

.gsage-modal-social .gsage-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f6f6f6;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.gsage-modal-social .gsage-social-btn:hover {
    background: #ebebeb;
}

.gsage-modal-social .gsage-social-btn svg {
    width: 24px;
    height: 24px;
}

/* ===== 协议文本 ===== */
.gsage-modal-agreement {
    padding: 14px 24px;
    text-align: center;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #f6f6f6;
    line-height: 1.6;
}

.gsage-modal-agreement a {
    color: #8590a6;
    text-decoration: none;
}

.gsage-modal-agreement a:hover {
    color: #0066cc;
}

/* ===== 视口切换 ===== */
@media (max-width: 768px) {
    .gsage-modal-desktop {
        display: none;
    }
    .gsage-mmodal {
        display: block;
    }
}

/* ========================================
    手机弹窗 — 36kr 极简风格，fixed+transform 居中
    ======================================== */

.gsage-mmodal-close {
    position: absolute;
    top: 0.8rem;
    right: 1rem;
    z-index: 10;
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    -webkit-appearance: none;
}

.gsage-mmodal-body {
    padding: 0 1.6rem 1.33rem;
    box-sizing: border-box;
    max-height: 65vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 标签页 */
.gsage-mmodal-tabs {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2.4rem;
    margin-bottom: 1.2rem;
}

.gsage-mmodal-tab {
    font-size: 0.9rem;
    color: #a7a7a7;
    cursor: pointer;
    padding-bottom: 0.4rem;
    position: relative;
    user-select: none;
}

.gsage-mmodal-tab.active {
    color: #111;
    font-weight: 500;
}

.gsage-mmodal-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #206cff;
    border-radius: 1px;
}

/* 面板 */
.gsage-mmodal-panels {
    position: relative;
}

.gsage-mmodal-panel {
    display: none;
}

.gsage-mmodal-panel.active {
    display: block;
}

/* 输入行 */
.gsage-mmodal-row {
    height: 2.67rem;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 1.34rem;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    margin-bottom: 0.67rem;
    background: #f7f8fa;
}

.gsage-mmodal-inp {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.85rem;
    color: #111;
    background: transparent;
    -webkit-appearance: none;
}

.gsage-mmodal-inp::placeholder {
    color: #a7a7a7;
}

/* 选项行 */
.gsage-mmodal-extra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0.8rem 0 1.2rem;
    font-size: 0.75rem;
}

.gsage-mmodal-remember {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #a7a7a7;
    cursor: pointer;
}

.gsage-mmodal-remember input {
    accent-color: #206cff;
    margin: 0;
}

.gsage-mmodal-switch {
    color: #206cff;
    text-decoration: none;
}

/* 提示 */
.gsage-mmodal-err {
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: #f95355;
}

.gsage-mmodal-ok {
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: #31c27c;
}

/* 按钮 */
.gsage-mmodal-btn {
    width: 100%;
    height: 2.53rem;
    line-height: 2.53rem;
    font-size: 0.9rem;
    color: #fff;
    background: #206cff;
    border: none;
    border-radius: 1.27rem;
    cursor: pointer;
    text-align: center;
    -webkit-appearance: none;
}

.gsage-mmodal-btn:active {
    opacity: 0.85;
}

.gsage-mmodal-btn:disabled {
    background: rgba(32,108,255,0.5);
    cursor: default;
}

/* 协议 */
.gsage-mmodal-agree {
    margin-top: 1.6rem;
    font-size: 0.69rem;
    color: #a7a7a7;
    text-align: center;
    line-height: 1.17rem;
}

.gsage-mmodal-agree a {
    color: #a7a7a7;
    text-decoration: none;
    position: relative;
}

.gsage-mmodal-agree a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 1px;
    background: #a7a7a7;
}

@media (max-width: 360px) {
    .gsage-mmodal-body {
        padding: 0 1.33rem 1.33rem;
    }
}

/* ===== 动画 ===== */
@keyframes gsageModalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes gsageModalScaleIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}
