/**
 * 子比 OAuth 绑定登录 - 前端样式
 * 尽量复用主题 CSS 变量，未定义时使用中性回退值，保证深浅色主题都能正常显示。
 */

.zob-app,
.zob-bind-panel,
.zob-bind-list,
.zob-inline-buttons {
    --zob-color: var(--main-color, #3b82f6);
    --zob-border: var(--main-border-color, rgba(0, 0, 0, .08));
    --zob-muted: var(--muted-color, #888);
    --zob-text: var(--main-color, #333);
    --zob-bg: var(--main-bg-color, #fff);
    --zob-radius: 10px;
}

/* ---------------------------------------------------------------
 * 登录按钮
 * ------------------------------------------------------------ */
.zob-inline-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
}

.zob-buttons-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.social-login-item.zob-app {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    padding: 9px 16px;
    border-radius: var(--zob-radius);
    border: 1px solid var(--zob-border);
    background: var(--zob-bg);
    color: var(--zob-text);
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease;
    -webkit-tap-highlight-color: transparent;
    flex: 0 0 auto;
}

.social-login-item.zob-app:hover {
    border-color: var(--zob-color);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .07);
    transform: translateY(-1px);
    color: var(--zob-text);
    text-decoration: none;
}

.social-login-item.zob-app:active {
    transform: translateY(0);
}

.social-login-item.zob-app.is-loading {
    opacity: .6;
    pointer-events: none;
}

.zob-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex: 0 0 auto;
    display: inline-block;
}

.zob-icon-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--zob-color);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

/* 仅图标 */
.social-login-item.zob-app.zob-style-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
}

.social-login-item.zob-app.zob-style-icon .zob-name {
    display: none;
}

/* 整行大按钮 */
.social-login-item.zob-app.zob-style-block {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    font-size: 15px;
}

.social-login-item.zob-app.zob-style-block .zob-name {
    flex: 1 1 auto;
    text-align: left;
}

/* 子比原生按钮容器内的排版 */
.social-login .zob-inline-buttons,
.oauth-login .zob-inline-buttons {
    justify-content: center;
}

/* ---------------------------------------------------------------
 * 绑定面板
 * ------------------------------------------------------------ */
.zob-bind-panel {
    width: 100%;
}

.zob-bind-head h4 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 600;
}

.zob-bind-head p {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--zob-muted);
    line-height: 1.7;
}

.zob-bind-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.zob-bind-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--zob-border);
    border-radius: var(--zob-radius);
    background: var(--zob-bg);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.zob-bind-item:hover {
    border-color: rgba(0, 0, 0, .14);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}

.zob-bind-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.zob-bind-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.zob-bind-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--zob-text);
    line-height: 1.4;
}

.zob-bind-sub {
    font-size: 12px;
    color: var(--zob-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.zob-bind-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.zob-bind-status {
    font-size: 12px;
    color: var(--zob-muted);
    white-space: nowrap;
}

.zob-bind-status.is-bound {
    color: #16a34a;
}

.zob-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: opacity .16s ease, background-color .16s ease;
    white-space: nowrap;
}

.zob-btn:hover {
    text-decoration: none;
    opacity: .88;
}

.zob-btn-bind {
    background: var(--zob-color);
    color: #fff;
}

.zob-btn-unbind {
    background: transparent;
    border-color: var(--zob-border);
    color: var(--zob-muted);
}

.zob-btn-unbind:hover {
    border-color: #ef4444;
    color: #ef4444;
}

.zob-btn.is-loading {
    opacity: .5;
    pointer-events: none;
}

/* ---------------------------------------------------------------
 * 提示
 * ------------------------------------------------------------ */
.zob-alert {
    padding: 10px 14px;
    border-radius: var(--zob-radius);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 14px;
}

.zob-alert-success {
    background: rgba(22, 163, 74, .08);
    border: 1px solid rgba(22, 163, 74, .22);
    color: #15803d;
}

.zob-alert-error {
    background: rgba(239, 68, 68, .08);
    border: 1px solid rgba(239, 68, 68, .22);
    color: #b91c1c;
}

.zob-tip {
    font-size: 13px;
    color: var(--zob-muted);
}

/* ---------------------------------------------------------------
 * 浮动提示
 * ------------------------------------------------------------ */
.zob-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    z-index: 999999;
    max-width: calc(100% - 32px);
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
    color: #fff;
    background: #16a34a;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
    transform: translate(-50%, -18px);
    opacity: 0;
    transition: opacity .28s ease, transform .28s ease;
    word-break: break-word;
}

.zob-toast.is-show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.zob-toast-error {
    background: #dc2626;
}

/* ---------------------------------------------------------------
 * 响应式
 * ------------------------------------------------------------ */
@media (max-width: 480px) {
    .social-login-item.zob-app {
        flex: 1 1 calc(50% - 10px);
        padding: 9px 10px;
        font-size: 13px;
    }

    .social-login-item.zob-app.zob-style-icon {
        flex: 0 0 auto;
        width: 42px;
        padding: 0;
    }
    .zob-bind-item {
        padding: 10px 12px;
    }

    .zob-bind-sub {
        max-width: 140px;
    }
}
