:root {
    font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 24px;
    font-weight: 400;

    color: #1f2937;
    background-color: #ffffff;

    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;

    /* 全局颜色变量 (源自登录页设计) */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #3b82f6;
    --color-primary-50: #eff6ff;
    --color-primary-100: #dbeafe;

    --gradient-start: #1e3a8a;
    --gradient-end: #3730a3;

    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;

    --color-text-primary: #111827;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    --color-border: #e5e7eb;
    --color-bg: #f9fafb;
    --color-card: #ffffff;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 20px;
    --spacing-xl: 40px;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-full: 50%;

    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-button: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
    --shadow-input-focus: 0 0 0 4px rgba(59, 130, 246, 0.15);

    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===================== 登录页面样式 ===================== */

.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: var(--color-card);
    font-family: var(--font-family-base);
    line-height: 1.5;
}

/* 左侧品牌区域 */
.brand-section {
    flex: 0 0 50%;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #ffffff;
    position: relative;
    overflow: hidden;
}

.brand-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(30px, 30px) rotate(180deg);
    }
}

.brand-content {
    position: relative;
    z-index: 1;
}

.brand-logo {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo svg {
    width: 48px;
    height: 48px;
}

.brand-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
}

.brand-subtitle {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 15px;
    opacity: 0.95;
}

.feature-list li svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* 展示区域 */
.showcase-area {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.showcase-title {
    font-size: 13px;
    opacity: 0.7;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.showcase-carousel {
    display: flex;
    gap: 16px;
    overflow: hidden;
}

.showcase-item {
    flex: 0 0 calc(50% - 8px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.showcase-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.showcase-item h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.showcase-item p {
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.5;
    margin: 0;
}

.showcase-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.showcase-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.showcase-dot.active {
    background: rgba(255, 255, 255, 0.9);
    width: 24px;
    border-radius: 4px;
}

/* 右侧登录区域 */
.login-section {
    flex: 1;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.login-header p {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

/* 登录 Tab */
.login-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--color-bg);
    padding: 4px;
    border-radius: var(--radius-md);
}

.login-tab {
    flex: 1;
    padding: 10px 6px;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    box-shadow: none;
}

.login-tab svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.login-tab:hover {
    color: var(--color-primary);
    border-color: transparent;
}

.login-tab.active {
    background: var(--color-card);
    color: var(--color-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 表单区域 */
.form-panel {
    animation: fadeIn 0.3s ease;
    min-height: 320px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

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

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--color-bg);
    box-sizing: border-box;
    box-shadow: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-input-focus);
    background: var(--color-card);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.input-group {
    display: flex;
    gap: 12px;
}

.input-group .form-input {
    flex: 1;
}

.code-button {
    padding: 12px 20px;
    background: var(--color-primary-50);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-shadow: none;
}

.code-button:hover {
    background: var(--color-primary-100);
    border-color: var(--color-primary);
}

.code-button:disabled {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 1;
    box-shadow: none;
}

.code-button:disabled:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: none;
}

/* 图片验证码 */
.captcha-group {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.captcha-group .captcha-input {
    flex: 2;
    width: auto;
}

.captcha-image {
    flex: 3;
    height: 50px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    cursor: pointer;
    object-fit: fill;
    background: #f9fafb;
    display: block;
}

.captcha-image:hover {
    opacity: 0.85;
}

/* 选项行 */
.options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.remember-me input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    padding: 0;
    box-shadow: none;
}

.remember-me span {
    color: var(--color-text-secondary);
}

.action-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.forgot-password {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--color-primary-hover);
}

/* 提交按钮 */
.submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-button);
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: linear-gradient(135deg, var(--color-primary-hover) 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -2px rgba(37, 99, 235, 0.4);
    border-color: transparent;
}

.submit-btn:active {
    transform: translateY(0);
}

/* 二维码区域 */
.qr-section {
    text-align: center;
    padding: 20px;
}

.qr-placeholder {
    width: 200px;
    height: 200px;
    background: var(--color-bg);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 14px;
}

.qr-hint {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

.qr-code-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.qr-code-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 发送成功提示 */
.send-success-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
    color: #16a34a;
    font-size: 14px;
}

.send-success-tip svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* 错误消息 */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    color: #dc2626;
    font-size: 14px;
}

.error-message svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* 后端未就绪等待态 */
.backend-loading-section {
    align-items: center;
    text-align: center;
    gap: 14px;
}

.backend-loading-spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid #dbeafe;
    border-top-color: var(--color-primary);
    animation: backend-spin 0.9s linear infinite;
}

@keyframes backend-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.backend-loading-section h2 {
    margin: 0;
    font-size: 22px;
    color: var(--color-text-primary);
}

.backend-loading-section p {
    margin: 0;
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* 登录成功反馈 */
.success-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    z-index: 100;
}

.success-content {
    text-align: center;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    margin-bottom: 16px;
    animation: bounce 1s infinite;
}

.success-icon svg {
    width: 32px;
    height: 32px;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.success-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.success-content p {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }

    .brand-section {
        padding: 30px;
        flex: none;
    }

    .brand-title {
        font-size: 22px;
    }

    .feature-list {
        display: none;
    }

    .showcase-area {
        display: none;
    }

    .login-section {
        padding: 30px 20px;
        max-width: none;
    }

    .login-tabs {
        gap: 2px;
    }

    .login-tab {
        font-size: 12px;
        padding: 8px 4px;
    }

    .login-tab svg {
        display: none;
    }
}

/* ===================== 异常弹窗样式 ===================== */
.error-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.error-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.error-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 28px 18px;
    border-bottom: 1px solid #f3f4f6;
}

.error-modal-header svg {
    width: 28px;
    height: 28px;
    color: #ef4444;
    flex-shrink: 0;
}

.error-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
}

.error-modal-body {
    padding: 24px 28px;
    min-height: 60px;
}

.error-modal-body p {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    word-break: break-word;
    white-space: pre-wrap;
}

.error-modal-footer {
    padding: 18px 28px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: flex-end;
}

.error-modal-footer button {
    padding: 10px 32px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.error-modal-footer button:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.error-modal-footer button:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .error-modal-content {
        width: 95%;
        margin: 0 16px;
    }

    .error-modal-header {
        padding: 20px 20px 14px;
    }

    .error-modal-body {
        padding: 18px 20px;
    }

    .error-modal-footer {
        padding: 14px 20px;
    }
}

/* ===================== 注册界面样式 ===================== */

/* 注册界面主体 */
.register-section {
    /* 继承 login-section 的所有样式 */
}

/* 注册方式选择标签 */
.register-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--color-bg);
    padding: 4px;
    border-radius: var(--radius-md);
}

.register-tabs .login-tab {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
}

.register-tabs .login-tab svg {
    width: 16px;
    height: 16px;
}

/* 返回登录链接 */
.back-to-login {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    font-size: 14px;
    color: var(--color-text-secondary);
}

.back-to-login a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
    transition: color 0.2s ease;
}

.back-to-login a:hover {
    color: var(--color-primary-hover);
}

/* 注册界面标题样式调整 */
.register-section .login-header h1 {
    color: var(--color-primary);
}
