/* Bootstrap + 自定义样式 */

:root {
    /* 自定义颜色 - Claude风格 */
    --primary-color: #EF5A29;
    --primary-hover: #D94820;
    --primary-active: #C33E18;
    --bg-page: #F7F7F5;
    --bg-card: #FFFFFF;

    /* 文字颜色 */
    --text-primary: #1A1A1A;
    --text-secondary: #6B6B6B;
    --text-tertiary: #9B9B9B;
    --text-placeholder: #AFAFAF;

    /* 边框颜色 */
    --border-light: #E8E8E8;
    --border-medium: #D1D1D6;
    --border-focus: #EF5A29;

    /* 状态颜色 */
    --error-color: #DC3545;
    --success-color: #28A745;

    /* 圆角大小 - 更圆润 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body {
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 使用Claude官方字体 */
    font-family: "Söhne", "ui-sans-serif", "system-ui", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-primary);
}

/* ========== 右上角工具栏 ========== */
.login-toolbar {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 1000;
}

/* 主题切换按钮 - 统一样式 */
.theme-toggle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: static !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.theme-toggle:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.theme-toggle-icon {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6B7280;
}

.theme-toggle:hover .theme-toggle-icon {
    color: #374151;
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

/* 语言切换按钮 - 与主题按钮同等高度 */
.lang-toggle {
    height: 40px;
    min-height: 40px;
    padding: 0 12px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.lang-toggle:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    color: #374151;
}

.lang-toggle:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ========== 深色模式下的工具栏按钮 ========== */
[data-theme="dark"] .theme-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.16);
}

[data-theme="dark"] .theme-toggle-icon {
    color: #9CA3AF;
}

[data-theme="dark"] .theme-toggle:hover .theme-toggle-icon {
    color: #D1D5DB;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .lang-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #9CA3AF;
}

[data-theme="dark"] .lang-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.16);
    color: #D1D5DB;
}

.login-container {
    padding: 2rem 1rem;
    width: 100%;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    border: 1px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

/* 头部 */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo {
    display: inline-flex;
    margin-bottom: 1.5rem;
    animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo svg {
    border-radius: var(--radius-md);
    filter: drop-shadow(0 4px 12px rgba(239, 90, 41, 0.2));
}

.login-title {
    font-size: 2rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
    animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

.login-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: -0.01em;
    animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bootstrap覆盖和自定义样式 */
.input-group {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group-text {
    border-right: 0;
    border-radius: var(--radius-md) 0 0 var(--radius-md) !important;
    color: var(--text-tertiary);
    border-color: var(--border-medium);
    background-color: var(--bg-card);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control {
    border-left: 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
    padding: 0.875rem 1.125rem;
    font-size: 0.9375rem;
    border-color: var(--border-medium);
    color: var(--text-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(239, 90, 41, 0.08);
    outline: none;
}

.input-group:focus-within .input-group-text {
    border-color: var(--border-focus);
    color: var(--primary-color);
    background-color: rgba(239, 90, 41, 0.02);
}

.input-group:hover .input-group-text,
.input-group:hover .form-control {
    border-color: var(--text-tertiary);
}

/* 验证码容器 - Claude风格 */
.captcha-wrapper {
    display: flex;
    gap: 0.875rem;
    align-items: stretch;
}

.captcha-input {
    flex: 1;
    min-width: 0; /* 防止flex溢出 */
}

/* 验证码图片容器 - 精美容器设计 + 强化毛玻璃效果 */
.captcha-image-container {
    position: relative;
    width: 130px;
    min-width: 130px;
    height: auto;
    border-radius: var(--radius-md);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06),
                inset 0 1px 2px rgba(255, 255, 255, 0.5);
    border: 2px solid var(--border-medium);
    /* 增强的毛玻璃效果 */
    background: linear-gradient(135deg,
        rgba(248, 249, 250, 0.6) 0%,
        rgba(233, 236, 239, 0.6) 100%);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
}

.captcha-image-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(239, 90, 41, 0.03) 0%, 
        rgba(245, 158, 11, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    pointer-events: none;
}

.captcha-image-container:hover::before {
    opacity: 1;
}

.captcha-image-container:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 90, 41, 0.15);
}

.captcha-image-container:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 验证码图片本身 */
.captcha-img {
    width: 100%;
    height: 46px;
    display: block;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.9);
    position: relative;
    z-index: 2;
    /* 添加轻微的滤镜效果 */
    filter: contrast(1.05) brightness(0.98);
    transition: filter 0.3s ease;
}

.captcha-image-container:hover .captcha-img {
    filter: contrast(1.1) brightness(1);
}

/* 刷新图标叠加层 - Claude风格 + 毛玻璃效果 */
.captcha-refresh-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px) saturate(1.5);
    -webkit-backdrop-filter: blur(8px) saturate(1.5);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}

.captcha-image-container:hover .captcha-refresh-overlay {
    opacity: 1;
}

.captcha-refresh-overlay i {
    font-size: 1.75rem;
    color: #ffffff;
    animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.captcha-image-container:active .captcha-refresh-overlay i {
    transform: rotate(180deg);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-45deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* 验证码加载动画 */
.captcha-img.loading {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Bootstrap Toast自定义样式 - 更圆润、更大的字体 */
.toast {
    min-width: 320px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-lg) !important;
    border: none;
    backdrop-filter: blur(10px);
}

.toast-header {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: none;
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.toast-header i {
    font-size: 1.4rem;
}

.toast-body {
    font-size: 1.05rem;
    font-weight: 500;
    padding: 1rem 1.25rem;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    line-height: 1.6;
}

/* 错误提示样式 - Claude风格 */
.alert-message {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1.125rem 1.25rem;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
    border: 1.5px solid #f87171;
    border-radius: var(--radius-md);
    color: #991b1b;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(248, 113, 113, 0.15);
    line-height: 1.5;
    font-family: "Söhne", "Source Sans Pro", -apple-system, BlinkMacSystemFont, sans-serif;
}

.alert-message i {
    font-size: 1.375rem;
    flex-shrink: 0;
    color: #dc2626;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
    }
}

/* 成功提示样式 */
.alert-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    border-color: #22c55e !important;
    color: #166534 !important;
}

.alert-success i {
    color: #16a34a !important;
}

/* 登录按钮 */
.btn-login {
    background: linear-gradient(135deg, var(--primary-color) 0%, #F59E0B 100%);
    border: none;
    padding: 0.9375rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    border-radius: var(--radius-md);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-hover) 0%, #D97706 100%);
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-login:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 90, 41, 0.35);
}

.btn-login:hover::before {
    opacity: 1;
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(239, 90, 41, 0.3);
}

.btn-login:disabled {
    background: var(--text-tertiary);
    opacity: 0.6;
    transform: none;
    cursor: not-allowed;
}

.btn-login span {
    position: relative;
    z-index: 1;
}

/* 移除不需要的样式 */

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
    background: #e5e7eb;
    transform: scale(1.05);
}

.theme-toggle-icon {
    font-size: 1.125rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

/* ========== 黑夜模式 - Claude风格（纯黑外层+深黑form+白色输入框）========== */
[data-theme="dark"] {
    --bg-page: #000000;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b4b4b4;
    --text-tertiary: #888888;
    --text-placeholder: #666666;
    --border-light: #2a2a2a;
    --border-medium: #3a3a3a;
    --primary-color: #EF5A29;
    --primary-hover: #D94820;
}

[data-theme="dark"] body {
    background: #000000;
    color: #ffffff;
}

[data-theme="dark"] .theme-toggle {
    background: #2a2a2a;
}

[data-theme="dark"] .theme-toggle:hover {
    background: #3a3a3a;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .login-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
}

[data-theme="dark"] .login-title {
    color: #ffffff;
}

[data-theme="dark"] .login-subtitle {
    color: #b4b4b4;
}

[data-theme="dark"] .input-group-text {
    background-color: #ffffff;
    border-color: #d1d1d6;
    color: #6b6b6b;
}

[data-theme="dark"] .form-control {
    background-color: #ffffff;
    border-color: #d1d1d6;
    color: #000000;
}

[data-theme="dark"] .form-control::placeholder {
    color: #888888;
}

[data-theme="dark"] .form-control:focus {
    border-color: #EF5A29;
    box-shadow: 0 0 0 3px rgba(239, 90, 41, 0.1);
}

[data-theme="dark"] .input-group:focus-within .input-group-text {
    border-color: #EF5A29;
    color: #EF5A29;
}

/* 暗色模式验证码适配 */
[data-theme="dark"] .captcha-image-container {
    border-color: #3a3a3a;
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .captcha-image-container::before {
    background: linear-gradient(135deg, 
        rgba(239, 90, 41, 0.08) 0%, 
        rgba(245, 158, 11, 0.08) 100%);
}

[data-theme="dark"] .captcha-image-container:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(239, 90, 41, 0.25);
}

[data-theme="dark"] .captcha-img {
    background: #ffffff;
}

[data-theme="dark"] .captcha-refresh-overlay {
    background: rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .captcha-wrapper .input-group-text,
[data-theme="dark"] .captcha-wrapper .form-control {
    background: #ffffff;
}

[data-theme="dark"] .btn-login {
    background: #EF5A29;
}

[data-theme="dark"] .btn-login::before {
    background: #D94820;
}

[data-theme="dark"] .btn-login:hover {
    box-shadow: 0 8px 20px rgba(239, 90, 41, 0.35);
}

[data-theme="dark"] .text-muted {
    color: #888888 !important;
}

[data-theme="dark"] a {
    color: #EF5A29 !important;
}

/* 响应式设计 - 移动端优化 */
@media (max-width: 576px) {
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .login-toolbar {
        top: 16px;
        right: 16px;
        gap: 8px;
    }
    
    .theme-toggle {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .lang-toggle {
        height: 36px;
        min-height: 36px;
        padding: 0 10px;
        font-size: 10px;
    }
    
    /* 移动端验证码布局优化 */
    .captcha-wrapper {
        flex-direction: column;
        gap: 0.875rem;
    }

    .captcha-input {
        width: 100%;
    }

    .captcha-image-container {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 56px;
        align-self: stretch;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .captcha-img {
        width: 100%;
        height: auto;
        min-height: 56px;
        max-height: 64px;
        object-fit: contain;
    }
    
    .captcha-refresh-overlay i {
        font-size: 2rem;
    }
    
    /* 移动端验证码刷新按钮优化 */
    .captcha-refresh-overlay {
        /* 移动端始终显示半透明的刷新提示 */
        opacity: 0;
        background: rgba(0, 0, 0, 0.3);
        pointer-events: none;
    }

    /* 移动端点击时显示刷新层 */
    .captcha-image-container:active .captcha-refresh-overlay {
        opacity: 1;
        pointer-events: auto;
        background: rgba(0, 0, 0, 0.6);
    }

    /* 移动端在验证码右上角添加小刷新提示 */
    .captcha-image-container::after {
        content: '';
        position: absolute;
        top: 4px;
        right: 4px;
        width: 26px;
        height: 26px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
        z-index: 4;
        /* 使用背景图代替字体图标 */
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23EF5A29' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z'/%3E%3Cpath d='M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 16px 16px;
        transition: all 0.3s ease;
    }

    .captcha-image-container:active::after {
        background-color: var(--primary-color);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 3a5 5 0 1 0 4.546 2.914.5.5 0 0 1 .908-.417A6 6 0 1 1 8 2v1z'/%3E%3Cpath d='M8 4.466V.534a.25.25 0 0 1 .41-.192l2.36 1.966c.12.1.12.284 0 .384L8.41 4.658A.25.25 0 0 1 8 4.466z'/%3E%3C/svg%3E");
        transform: rotate(180deg);
    }
}

/* 小屏幕额外优化 */
@media (max-width: 360px) {
    .login-card {
        padding: 1.5rem 1.25rem;
    }

    .captcha-image-container {
        min-height: 50px;
    }

    .captcha-img {
        min-height: 50px;
        max-height: 58px;
    }
}

