/**
 * 主站微信登录弹窗 / 登录页 — 仅适配亮色 + .theme--dark 两套风格
 * 作用域：.wechat-auth-shell（弹窗与 /login 页共用）
 */

.dialog--signin[data-wechat-login-signin] .dialog__content {
    height: auto !important;
    min-height: 0;
    max-width: 420px;
    width: calc(100vw - 32px);
    margin: 0 auto;
}

.wechat-auth-shell {
    --wx-auth-bg: #ffffff;
    --wx-auth-panel: #f3f4f6;
    --wx-auth-border: #e5e7eb;
    --wx-auth-border-light: #eef2f7;
    --wx-auth-text: #1f2328;
    --wx-auth-text-secondary: #475569;
    --wx-auth-text-muted: #64748b;
    --wx-auth-accent: #1890ff;
    --wx-auth-accent-hover: #40a9ff;
    --wx-auth-accent-gradient: linear-gradient(135deg, #35b2ff 0%, #1182eb 100%);
    --wx-auth-accent-shadow: rgba(17, 130, 235, 0.28);
    --wx-auth-danger: #dc2626;
    --wx-auth-qr-bg: #ffffff;
    --wx-auth-shadow: 0 20px 48px rgba(15, 23, 42, 0.14);
    position: relative;
    border-radius: 14px;
    border: 1px solid var(--wx-auth-border);
    box-shadow: var(--wx-auth-shadow);
    padding: 22px 22px 20px;
    background: var(--wx-auth-bg);
    color: var(--wx-auth-text);
    overflow-y: auto;
}

.theme--dark .wechat-auth-shell {
    --wx-auth-bg: #161b22;
    --wx-auth-panel: #21262d;
    --wx-auth-border: #30363d;
    --wx-auth-border-light: #21262d;
    --wx-auth-text: #e6edf3;
    --wx-auth-text-secondary: #8b949e;
    --wx-auth-text-muted: #6e7681;
    --wx-auth-accent: #58a6ff;
    --wx-auth-accent-hover: #79c0ff;
    --wx-auth-accent-gradient: linear-gradient(135deg, #4dabf7 0%, #228be6 100%);
    --wx-auth-accent-shadow: rgba(34, 139, 230, 0.32);
    --wx-auth-danger: #f85149;
    --wx-auth-qr-bg: #ffffff;
    --wx-auth-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
}

.wechat-auth-shell__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.wechat-auth-shell__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--wx-auth-text);
}

.wechat-auth-shell__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--wx-auth-text-muted);
    font-size: 22px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.wechat-auth-shell__close:hover {
    color: var(--wx-auth-text);
    background: var(--wx-auth-panel);
    border-color: var(--wx-auth-border);
}

.wechat-auth-shell .auth-mode-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: var(--wx-auth-panel);
    border: 1px solid var(--wx-auth-border-light);
    box-shadow: none;
}

.wechat-auth-shell .auth-mode-tabs .tab-button {
    flex: 1;
    padding: 9px 14px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--wx-auth-text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.wechat-auth-shell .auth-mode-tabs .tab-button:hover:not(.active) {
    color: var(--wx-auth-text);
    background: color-mix(in srgb, var(--wx-auth-text) 4%, transparent);
}

.wechat-auth-shell .auth-mode-tabs .tab-button.active {
    color: #ffffff;
    background: var(--wx-auth-accent-gradient);
    box-shadow: 0 4px 14px var(--wx-auth-accent-shadow);
}

.wechat-auth-shell .wechat-auth__hint-main {
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
    color: var(--wx-auth-text-secondary);
}

.wechat-auth-shell .wechat-auth__hint-sub {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
    color: var(--wx-auth-text-muted);
}

.wechat-auth-shell .wechat-auth--qr-mount {
    margin-top: 4px;
}

.wechat-auth-shell .wechat-auth__qr-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wechat-auth-shell .wechat-auth__qr-frame {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 8px auto 4px;
    padding: 10px;
    box-sizing: border-box;
    background: var(--wx-auth-qr-bg);
    border: 1px solid var(--wx-auth-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.theme--dark .wechat-auth-shell .wechat-auth__qr-frame {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.wechat-auth-shell .wechat-auth__qr-frame #qrcode {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: block;
    object-fit: contain;
    border: none;
    border-radius: 8px;
    box-shadow: none;
    background: transparent;
}

.wechat-auth-shell .wechat-auth__qr-frame #qrcode[hidden] {
    visibility: hidden;
}

.wechat-auth-shell .wechat-auth__qr-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(3px);
}

.theme--dark .wechat-auth-shell .wechat-auth__qr-loading {
    background: rgba(22, 27, 34, 0.82);
}

.wechat-auth-shell .wechat-auth__qr-loading[hidden] {
    display: none !important;
}

.wechat-auth-shell .wechat-auth__qr-loading-spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--wx-auth-border);
    border-top-color: var(--wx-auth-accent);
    animation: wechat-auth-qr-spin 0.85s linear infinite;
}

.wechat-auth-shell .wechat-auth__qr-loading-text {
    font-size: 13px;
    color: var(--wx-auth-text-muted);
}

@keyframes wechat-auth-qr-spin {
    to { transform: rotate(360deg); }
}

.wechat-auth-shell .wechat-auth__qr-error,
.wechat-auth-shell #wechat-qr-load-hint {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--wx-auth-danger);
    text-align: center;
}

.wechat-auth-shell .wechat-auth__qr-error[hidden],
.wechat-auth-shell .wechat-auth__qr-retry[hidden],
.wechat-auth-shell #wechat-qr-load-hint[hidden],
.wechat-auth-shell #wechat-qr-retry[hidden] {
    display: none !important;
}

.wechat-auth-shell .wechat-auth__qr-retry,
.wechat-auth-shell #wechat-qr-retry {
    margin-top: 10px;
    padding: 7px 18px;
    border: 1px solid var(--wx-auth-border);
    border-radius: 8px;
    background: var(--wx-auth-bg);
    color: var(--wx-auth-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.wechat-auth-shell .wechat-auth__qr-retry:hover,
.wechat-auth-shell #wechat-qr-retry:hover {
    color: var(--wx-auth-accent);
    border-color: color-mix(in srgb, var(--wx-auth-accent) 45%, var(--wx-auth-border));
    background: var(--wx-auth-panel);
}

.wechat-auth-shell .wechat-auth--register-step1 .material.textbox {
    display: block;
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--wx-auth-text-secondary);
}

.wechat-auth-shell .wechat-auth--uname-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
}

.wechat-auth-shell .wechat-auth--uname-row input {
    flex: 1;
    min-width: 0;
    margin-top: 0;
}

.wechat-auth-shell .wechat-auth--random-uname {
    flex-shrink: 0;
    padding: 0 14px;
    border: 1px solid var(--wx-auth-border);
    border-radius: 8px;
    background: var(--wx-auth-bg);
    color: var(--wx-auth-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.theme--dark .wechat-auth-shell .wechat-auth--random-uname {
    background: var(--wx-auth-panel);
}

.wechat-auth-shell .wechat-auth--random-uname:hover {
    color: var(--wx-auth-accent);
    border-color: color-mix(in srgb, var(--wx-auth-accent) 45%, var(--wx-auth-border));
    background: var(--wx-auth-panel);
}

.wechat-auth-shell .wechat-auth--register-step1 input {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--wx-auth-border);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    background: var(--wx-auth-bg);
    color: var(--wx-auth-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme--dark .wechat-auth-shell .wechat-auth--register-step1 input {
    background: var(--wx-auth-panel);
}

.wechat-auth-shell .wechat-auth--register-step1 input:focus {
    outline: none;
    border-color: var(--wx-auth-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wx-auth-accent) 18%, transparent);
}

.wechat-auth-shell .wechat-auth-shell__primary-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: var(--wx-auth-accent-gradient);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px var(--wx-auth-accent-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wechat-auth-shell .wechat-auth-shell__primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px var(--wx-auth-accent-shadow);
}

.wechat-auth-shell .wechat-auth--password-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--wx-auth-border-light);
}

.wechat-auth-shell .wechat-auth--password-panel .material.textbox {
    display: block;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--wx-auth-text-secondary);
}

.wechat-auth-shell .wechat-auth--password-panel .material.textbox input {
    width: 100%;
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid var(--wx-auth-border);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    background: var(--wx-auth-bg);
    color: var(--wx-auth-text);
}

.theme--dark .wechat-auth-shell .wechat-auth--password-panel .material.textbox input {
    background: var(--wx-auth-panel);
}

.wechat-auth-shell .wechat-auth--password-panel .material.textbox input:focus {
    outline: none;
    border-color: var(--wx-auth-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wx-auth-accent) 18%, transparent);
}

.wechat-auth-shell .wechat-auth--password-panel label.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--wx-auth-text-secondary);
    cursor: pointer;
}

.wechat-auth-shell .wechat-auth--password-panel .supplementary a {
    color: var(--wx-auth-accent);
}

.wechat-auth-page .wechat-auth-shell {
    max-width: 420px;
    margin: 0 auto;
}

.wechat-auth-page .immersive--content h1 {
    margin-bottom: 20px;
}
