/* Candy Account — 第三方登录布局 */
.gate-oauth-section {
    box-sizing: border-box;
    width: 100%;
    margin: 20px 0 4px;
    padding: 0;
    clear: both;
}

.gate-oauth-section *,
.gate-oauth-section *::before,
.gate-oauth-section *::after {
    box-sizing: border-box;
}

.gate-oauth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.04em;
    color: currentColor;
    opacity: 0.55;
    white-space: nowrap;
}

.gate-oauth-divider::before,
.gate-oauth-divider::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    min-width: 16px;
    background: currentColor;
    opacity: 0.28;
}

.gate-oauth-divider span {
    flex: 0 0 auto;
}

/* 圆形：等分图标 + 文字 */
.gate-oauth-section.gate-oauth-circle .gate-oauth-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
    gap: 10px 8px;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    justify-items: center;
}

.gate-oauth-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    max-width: 88px;
    padding: 4px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.gate-oauth-item:hover {
    transform: translateY(-2px);
    opacity: 0.92;
}

.gate-oauth-item:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 8px;
}

.gate-oauth-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.gate-oauth-avatar img,
.gate-oauth-avatar svg {
    display: block;
    width: 22px;
    height: 22px;
}

.gate-oauth-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gate-oauth-label {
    display: block;
    width: 100%;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
    opacity: 0.75;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gate-oauth-item:hover .gate-oauth-label {
    opacity: 1;
}

/* 矩形芯片 */
.gate-oauth-section.gate-oauth-rect .gate-oauth-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.gate-oauth-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: inherit;
    background: rgba(127, 127, 127, 0.1);
    border: 1px solid rgba(127, 127, 127, 0.16);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.gate-oauth-chip:hover {
    transform: translateY(-1px);
    background: rgba(127, 127, 127, 0.16);
}

.gate-oauth-chip img {
    width: 76px;
    height: 24px;
    object-fit: contain;
    display: block;
}

.gate-oauth-chip .gate-oauth-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.gate-oauth-chip .gate-oauth-icon svg {
    width: 16px;
    height: 16px;
}

/* 按钮列表：一行横排 */
.gate-oauth-section.gate-oauth-button .gate-oauth-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.gate-oauth-btn {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    border: none;
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.gate-oauth-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

.gate-oauth-btn .gate-oauth-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.gate-oauth-btn .gate-oauth-icon svg {
    width: 16px;
    height: 16px;
}

.gate-oauth-btn span {
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 品牌色 */
.gate-oauth-qq .gate-oauth-avatar,
.gate-oauth-btn.gate-oauth-qq {
    background: #2F88FF;
    color: #fff;
}

.gate-oauth-wechat .gate-oauth-avatar,
.gate-oauth-btn.gate-oauth-wechat {
    background: #07C160;
    color: #fff;
}

.gate-oauth-github .gate-oauth-avatar,
.gate-oauth-btn.gate-oauth-github {
    background: #24292f;
    color: #fff;
}

.gate-oauth-chip.gate-oauth-qq {
    color: #2F88FF;
    border-color: rgba(47, 136, 255, 0.28);
    background: rgba(47, 136, 255, 0.08);
}

.gate-oauth-chip.gate-oauth-wechat {
    color: #07C160;
    border-color: rgba(7, 193, 96, 0.28);
    background: rgba(7, 193, 96, 0.08);
}

.gate-oauth-chip.gate-oauth-github {
    color: inherit;
    border-color: rgba(36, 41, 47, 0.2);
    background: rgba(36, 41, 47, 0.06);
}

.gate-oauth-fallback {
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

/* 与各模板底部链接的间距 */
.gate-oauth-section + .card-footer,
.gate-oauth-section + .form-footer {
    margin-top: 16px;
}

/* 有 OAuth 时弱化模板自带「或」类分隔，避免双线 */
body.has-gate-oauth .footer-divider,
body.has-gate-oauth .form-footer > .divider,
.has-gate-oauth .footer-divider,
.has-gate-oauth .form-footer > .divider {
    display: none !important;
}

body.has-gate-oauth .card-footer,
body.has-gate-oauth .form-footer,
.has-gate-oauth .card-footer,
.has-gate-oauth .form-footer {
    margin-top: 12px;
    padding-top: 0;
}

@media (max-width: 420px) {
    .gate-oauth-section.gate-oauth-circle .gate-oauth-list {
        max-width: 100%;
        grid-template-columns: repeat(3, 1fr);
    }

    .gate-oauth-avatar {
        width: 40px;
        height: 40px;
    }

    .gate-oauth-section.gate-oauth-button .gate-oauth-list {
        gap: 6px;
    }

    .gate-oauth-btn {
        min-height: 38px;
        padding: 0 6px;
        font-size: 12px;
        border-radius: 8px;
    }

    .gate-oauth-btn .gate-oauth-icon,
    .gate-oauth-btn .gate-oauth-icon svg {
        width: 14px;
        height: 14px;
    }
}
