/* ============================================
 * Auth Pages - 腾讯云风格
 * 动态云服务背景 + 专业登录界面
 * ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --auth-primary: #0052D9;
    --auth-primary-hover: #003CAB;
    --auth-primary-light: rgba(0, 82, 217, 0.08);
    --auth-text: #1a1a1a;
    --auth-text-secondary: #666666;
    --auth-text-muted: #999999;
    --auth-border: #d9d9d9;
    --auth-border-hover: #b0b0b0;
    --auth-bg: #f0f4f8;
    --auth-card-bg: #ffffff;
    --auth-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    --auth-card-radius: 12px;
    --auth-input-height: 44px;
    --auth-card-width: 420px;
}

/* --- 全局重置，修复白条问题 --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden !important;
    height: 100%;
}

body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    min-height: 100%;
    /* 与登录页背景一致，防止白条 */
    background: #0a1628;
}

/* 确保 auth 页面撑满全屏 */
.main.auth-main {
    width: 100%;
}

/* --- Page Layout --- */
.main.auth-main {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', STHeiti, 'Microsoft Yahei', sans-serif;
    /* 动态渐变背景 */
    background: linear-gradient(135deg, #0a1628 0%, #0d2137 25%, #0f3460 50%, #16537e 75%, #1a6fa0 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}

/* --- 动态云服务背景容器 --- */
.auth-bg-cloud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* 浮动光点/粒子 */
.cloud-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
    animation: floatParticle linear infinite;
}

.cloud-particle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -5%;
    animation-duration: 25s;
    animation-delay: 0s;
    background: radial-gradient(circle, rgba(0, 82, 217, 0.12) 0%, transparent 70%);
}

.cloud-particle:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 60%;
    right: -3%;
    animation-duration: 20s;
    animation-delay: -5s;
    background: radial-gradient(circle, rgba(0, 110, 255, 0.1) 0%, transparent 70%);
}

.cloud-particle:nth-child(3) {
    width: 250px;
    height: 250px;
    bottom: 5%;
    left: 30%;
    animation-duration: 22s;
    animation-delay: -10s;
    background: radial-gradient(circle, rgba(0, 168, 112, 0.08) 0%, transparent 70%);
}

.cloud-particle:nth-child(4) {
    width: 180px;
    height: 180px;
    top: 30%;
    right: 20%;
    animation-duration: 18s;
    animation-delay: -3s;
    background: radial-gradient(circle, rgba(0, 82, 217, 0.1) 0%, transparent 70%);
}

.cloud-particle:nth-child(5) {
    width: 350px;
    height: 350px;
    top: -10%;
    right: -10%;
    animation-duration: 30s;
    animation-delay: -8s;
    background: radial-gradient(circle, rgba(26, 111, 160, 0.1) 0%, transparent 70%);
}

.cloud-particle:nth-child(6) {
    width: 150px;
    height: 150px;
    bottom: 20%;
    left: 10%;
    animation-duration: 15s;
    animation-delay: -12s;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
}

@keyframes floatParticle {
    0% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(30px, 40px) scale(1.05); }
    100% { transform: translate(0, 0) scale(1); }
}

/* 网格线条效果 */
.cloud-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridMove 60s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* 连接线条动画 */
.cloud-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
}

.cloud-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 82, 217, 0.3), transparent);
    animation: lineFloat linear infinite;
}

.cloud-line:nth-child(1) {
    width: 40%;
    top: 20%;
    left: -10%;
    animation-duration: 15s;
}

.cloud-line:nth-child(2) {
    width: 35%;
    top: 50%;
    right: -10%;
    animation-duration: 18s;
    animation-delay: -5s;
}

.cloud-line:nth-child(3) {
    width: 45%;
    bottom: 30%;
    left: 10%;
    animation-duration: 20s;
    animation-delay: -10s;
}

.cloud-line:nth-child(4) {
    width: 30%;
    top: 70%;
    left: -5%;
    animation-duration: 12s;
    animation-delay: -3s;
}

@keyframes lineFloat {
    0% { transform: translateX(-100%); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateX(200%); opacity: 0; }
}

/* 数据流光点 */
.data-dots {
    position: absolute;
    width: 100%;
    height: 100%;
}

.data-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(0, 110, 255, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 110, 255, 0.4);
    animation: dotMove linear infinite;
}

.data-dot:nth-child(1) { top: 15%; left: 20%; animation-duration: 8s; animation-delay: 0s; }
.data-dot:nth-child(2) { top: 45%; left: 70%; animation-duration: 10s; animation-delay: -2s; }
.data-dot:nth-child(3) { top: 75%; left: 40%; animation-duration: 12s; animation-delay: -4s; }
.data-dot:nth-child(4) { top: 25%; left: 85%; animation-duration: 9s; animation-delay: -6s; }
.data-dot:nth-child(5) { top: 60%; left: 15%; animation-duration: 11s; animation-delay: -3s; }
.data-dot:nth-child(6) { top: 85%; left: 60%; animation-duration: 7s; animation-delay: -5s; }

@keyframes dotMove {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translate(80px, -60px); opacity: 0; }
}

/* --- Simplified Auth Header Bar --- */
.auth-header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-header-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #ffffff;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.3px;
    transition: opacity 0.2s;
}

.auth-header-logo a:hover {
    opacity: 0.85;
}

.auth-header-logo img {
    height: 28px;
    width: auto;
}

.auth-header-logo svg {
    flex-shrink: 0;
}

.auth-header-logo svg path,
.auth-header-logo svg circle {
    stroke: #ffffff;
}

.auth-header-back {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.auth-header-back:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

/* --- Auth Card --- */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--auth-card-width);
    margin: 0 auto;
    padding: 40px 36px 32px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--auth-card-radius);
    box-shadow: var(--auth-card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

/* --- Card Header --- */
.auth-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--auth-text-muted);
    line-height: 1.5;
}

.auth-subtitle-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
}

.auth-subtitle-row .auth-subtitle {
    margin: 0;
}

.oauth-policy-help-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #0052d9;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-family: inherit;
}

.oauth-policy-help-btn:hover {
    color: #0034a5;
}

.oauth-policy-help-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.2);
    border-radius: 2px;
}

/* --- Plugin Hooks --- */
.plugin-login-hook {
    margin: 12px 0;
}

.plugin-login-before {
    margin-bottom: 16px;
}

.plugin-login-after {
    margin-top: 16px;
}

/* --- Form --- */
.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--auth-text);
    margin-bottom: 8px;
}

.form-label .required {
    color: #e34d59;
    margin-left: 2px;
}

/* --- Form Inputs --- */
.auth-card .form-control {
    width: 100%;
    min-width: 0;
    height: var(--auth-input-height);
    padding: 0 14px;
    background: #ffffff;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--auth-text);
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.auth-card .form-control:hover {
    border-color: var(--auth-border-hover);
}

.auth-card .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 2px var(--auth-primary-light);
}

.auth-card .form-control::placeholder {
    color: #bfbfbf;
}

/* Autofill overrides */
.auth-card .form-control:-webkit-autofill,
.auth-card .form-control:-webkit-autofill:hover,
.auth-card .form-control:-webkit-autofill:focus,
.auth-card .form-control:-webkit-autofill:active {
    -webkit-text-fill-color: var(--auth-text) !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    background-image: none !important;
    border: 1px solid var(--auth-border);
    caret-color: var(--auth-text);
    transition: background-color 5000s ease-in-out 0s;
}

.auth-card .form-control:-webkit-autofill:focus {
    border-color: var(--auth-primary);
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset, 0 0 0 2px var(--auth-primary-light) !important;
    box-shadow: 0 0 0 1000px #ffffff inset, 0 0 0 2px var(--auth-primary-light) !important;
}

.auth-card .form-control:-moz-autofill {
    box-shadow: 0 0 0 1000px #ffffff inset;
    -moz-text-fill-color: var(--auth-text);
}

.auth-card .form-control.error {
    border-color: #e34d59;
    box-shadow: 0 0 0 2px rgba(227, 77, 89, 0.1);
}

/* --- Form Hint --- */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--auth-text-muted);
    line-height: 1.5;
}

.form-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #e34d59;
    line-height: 1.5;
}

/* --- Password Input Group --- */
.password-input-group {
    position: relative;
}

.auth-card .password-input-group .form-control {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #bfbfbf;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    border-radius: 4px;
}

.password-toggle:hover {
    color: var(--auth-text-secondary);
}

/* --- Captcha --- */
.captcha-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-input {
    flex: 1;
    min-width: 0;
    height: var(--auth-input-height) !important;
}

.captcha-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.captcha-actions .captcha-image,
.captcha-actions .captcha-refresh {
    flex-shrink: 0;
}

.captcha-image {
    width: 100px;
    height: var(--auth-input-height);
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid var(--auth-border);
    transition: border-color 0.2s ease;
    object-fit: cover;
    background: #fafafa;
}

.captcha-image:hover {
    border-color: var(--auth-primary);
}

.captcha-refresh {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    color: var(--auth-text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.captcha-refresh:hover {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
    background: var(--auth-primary-light);
}

/* --- Form Options (remember / forgot) --- */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.form-checkbox {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--auth-text-secondary);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--auth-primary);
    border-radius: 3px;
}

.checkbox-text {
    line-height: 1;
}

.form-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.form-link:hover {
    color: var(--auth-primary-hover);
}

/* --- Agreement --- */
.form-agreement {
    margin-bottom: 24px;
}

.form-agreement .checkbox-text a {
    color: var(--auth-primary);
    text-decoration: none;
}

.form-agreement .checkbox-text a:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* --- Buttons --- */
.form-actions {
    margin-bottom: 16px;
}

.auth-card .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    height: var(--auth-input-height);
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    background: #ffffff;
    color: var(--auth-text-secondary);
}

.auth-card .btn-primary {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
    color: #ffffff;
    font-weight: 500;
}

.auth-card .btn-primary:hover {
    background: var(--auth-primary-hover);
    border-color: var(--auth-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 82, 217, 0.3);
}

.auth-card .btn-primary:active {
    background: #002A7D;
    border-color: #002A7D;
    transform: translateY(0);
    box-shadow: none;
}

.auth-card .btn-primary:disabled {
    background: #c0c4cc;
    border-color: #c0c4cc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-card .btn-block {
    width: 100%;
}

.auth-card .btn-outline {
    background: #ffffff;
    border-color: var(--auth-border);
    color: var(--auth-text-secondary);
}

.auth-card .btn-outline:hover {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
    background: var(--auth-primary-light);
}

.auth-card .btn-link {
    background: none;
    border: none;
    color: var(--auth-primary);
    padding: 4px 8px;
    height: auto;
    font-size: 13px;
}

.auth-card .btn-link:hover {
    color: var(--auth-primary-hover);
    background: none;
    border: none;
}

.auth-card .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.auth-card .btn-loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
}

.alert-error svg {
    color: #cf1322;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}

.alert-success svg {
    color: #389e0d;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-info {
    background: #e8f3ff;
    border: 1px solid #91caff;
    color: #0052d9;
}

.alert-info svg {
    color: #0052d9;
    flex-shrink: 0;
    margin-top: 1px;
}

/* 三方登录说明弹窗（与 .cursorrules 模态框规范对齐） */
.login-oauth-policy-modal.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.login-oauth-policy-modal.modal.active {
    display: flex;
}

.login-oauth-policy-modal .modal-content {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.login-oauth-policy-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e7e7e7;
    min-height: 56px;
    box-sizing: border-box;
}

.login-oauth-policy-modal .modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2329;
}

.login-oauth-policy-modal .modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #86909c;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-oauth-policy-modal .modal-close:hover {
    background: #f0f0f0;
    color: #1f2329;
}

.login-oauth-policy-modal .modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.login-oauth-policy-modal .modal-body::-webkit-scrollbar {
    width: 6px;
}

.login-oauth-policy-modal .modal-body::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.login-oauth-policy-modal .modal-body::-webkit-scrollbar-thumb {
    background: #dcdcdc;
    border-radius: 3px;
}

.oauth-policy-modal-body {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.login-oauth-policy-modal .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e7e7e7;
    background: #fafbfc;
    display: flex;
    justify-content: flex-end;
}

/* --- Auth Divider --- */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #e8e8e8;
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e8e8e8;
}

.auth-divider span {
    padding: 0 16px;
    color: var(--auth-text-muted);
}

/* --- OAuth Buttons --- */
.oauth-login-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.oauth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 20px;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 400;
    color: var(--auth-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    background: #ffffff;
    min-width: 130px;
}

.oauth-btn:hover {
    border-color: var(--auth-border-hover);
    background: #fafafa;
    color: var(--auth-text);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.oauth-btn svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.oauth-btn-wechat:hover {
    border-color: #07c160;
    color: #07c160;
    background: rgba(7, 193, 96, 0.04);
}

.oauth-btn-wechat svg {
    color: #07c160;
}

.oauth-btn-qq:hover {
    border-color: #12b7f5;
    color: #12b7f5;
    background: rgba(18, 183, 245, 0.04);
}

.oauth-btn-qq svg {
    color: #12b7f5;
}

.oauth-btn-github:hover {
    border-color: #24292f;
    color: #24292f;
}

.oauth-btn-github svg {
    color: #24292f;
}

/* --- Auth Links (bottom) --- */
.auth-links {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: var(--auth-text-muted);
}

.auth-link-text {
    color: var(--auth-text-muted);
}

.auth-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--auth-primary-hover);
}

/* --- Tab Group (forgot-password) --- */
.tab-group {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.tab-btn {
    flex: 1;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ffffff;
    color: var(--auth-text-secondary);
}

.tab-btn:hover {
    border-color: var(--auth-primary);
    color: var(--auth-primary);
}

.tab-btn.active {
    background: var(--auth-primary);
    border-color: var(--auth-primary);
    color: #ffffff;
}

/* --- Security Question Display --- */
.security-question-display {
    display: flex;
    align-items: center;
    min-height: var(--auth-input-height);
    padding: 0 14px;
    background: #fafafa;
    border: 1px solid var(--auth-border);
    border-radius: 6px;
    color: var(--auth-text);
    font-size: 14px;
}

/* ============================================
 * Responsive Design - 多终端自适应
 * ============================================ */

/* 大屏幕 (>= 1200px) */
@media (min-width: 1200px) {
    .auth-card {
        padding: 44px 40px 36px;
    }
}

/* 中等屏幕 (768px - 1199px) */
@media (max-width: 1199px) {
    :root {
        --auth-card-width: 400px;
    }
}

/* 平板 (768px - 1023px) */
@media (max-width: 1023px) {
    .main.auth-main {
        padding: 76px 24px 32px;
    }

    .auth-card {
        padding: 36px 32px 28px;
    }
}

/* 小平板/大手机 (max-width: 768px) */
@media (max-width: 768px) {
    :root {
        --auth-card-width: 100%;
    }

    .main.auth-main {
        padding: 72px 16px 24px;
        align-items: flex-start;
    }

    .auth-card {
        padding: 32px 24px 24px;
        border-radius: 10px;
        max-width: 100%;
    }

    .auth-title {
        font-size: 20px;
    }

    .auth-header-bar {
        padding: 0 16px;
    }

    .tab-group {
        flex-direction: column;
        gap: 8px;
    }

    .oauth-login-buttons {
        flex-direction: column;
    }

    .oauth-btn {
        width: 100%;
        justify-content: center;
    }

    .login-oauth-policy-modal .modal-content {
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
    }
}

/* 手机 (max-width: 480px) */
@media (max-width: 480px) {
    .main.auth-main {
        padding: 64px 10px 16px;
        min-height: 100vh;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }

    .auth-card {
        padding: 28px 18px 20px;
        border-radius: 8px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
        max-width: 100%;
        overflow: hidden;
    }

    .auth-title {
        font-size: 18px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .auth-card .form-control {
        font-size: 16px; /* prevent iOS zoom */
        height: 42px;
    }

    .captcha-input {
        height: 42px !important;
    }

    .captcha-image {
        height: 42px;
    }

    .captcha-refresh {
        padding: 6px 10px;
        font-size: 12px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .auth-header-logo a {
        font-size: 15px;
    }

    .auth-header-bar {
        height: 50px;
    }

    .main.auth-main {
        padding-top: 66px;
    }

    .auth-card .btn {
        height: 42px;
    }

    .oauth-btn {
        min-width: auto;
    }

    /* 移动端简化背景动画 */
    .cloud-grid,
    .cloud-lines {
        display: none;
    }

    .cloud-particle:nth-child(n+4) {
        display: none;
    }
}

/* 超小屏幕 (max-width: 360px) */
@media (max-width: 360px) {
    .auth-card {
        padding: 24px 16px 16px;
        border-radius: 6px;
    }

    .auth-title {
        font-size: 17px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .oauth-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* 横屏手机 */
@media (max-height: 600px) and (orientation: landscape) {
    .main.auth-main {
        padding: 68px 20px 16px;
        align-items: flex-start;
    }

    .auth-card {
        padding: 24px 28px 20px;
    }

    .auth-card-header {
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 14px;
    }
}

/* --- Print --- */
@media print {
    .main.auth-main {
        background: #ffffff !important;
    }

    .auth-bg-cloud {
        display: none !important;
    }

    .auth-card {
        box-shadow: none !important;
        border: 1px solid #e8e8e8 !important;
        background: #ffffff !important;
    }
}

/* --- Reduce motion --- */
@media (prefers-reduced-motion: reduce) {
    .auth-card .form-control,
    .auth-card .btn,
    .auth-card .tab-btn,
    .captcha-image,
    .captcha-refresh,
    .auth-header-back,
    .oauth-btn {
        transition: none !important;
    }

    .main.auth-main {
        animation: none !important;
    }

    .cloud-particle,
    .cloud-grid,
    .cloud-lines,
    .cloud-line,
    .data-dot {
        animation: none !important;
    }
}

/* --- 低性能设备优化 --- */
@media (hover: none) {
    .auth-card .btn-primary:hover {
        transform: none;
        box-shadow: none;
    }

    .oauth-btn:hover {
        transform: none;
        box-shadow: none;
    }
}
