* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    background: url('../images/login-bg.png') center/cover no-repeat fixed;
    overflow: hidden;
}

/* 图片背景加载失败时的纯色兜底 */
@supports not (background: url('../images/login-bg.png')) {
    body {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e3a5f 100%);
    }
}

.login-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    background: #3b82f6;
    animation: float 20s infinite ease-in-out;
}

.shape1 {
    width: 400px;
    height: 400px;
    top: 5%;
    left: 5%;
    animation-delay: 0s;
}

.shape2 {
    width: 280px;
    height: 280px;
    bottom: 10%;
    right: 5%;
    animation-delay: 5s;
    background: #8b5cf6;
}

.shape3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 60%;
    animation-delay: 10s;
    background: #06b6d4;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.login-box {
    position: relative;
    width: 420px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 18px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.3);
    padding: 40px;
    z-index: 10;
    backdrop-filter: blur(10px);
}

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

.logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 15px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px;
}

.login-header h1 {
    font-size: 22px;
    color: #0f172a;
    margin-bottom: 5px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.subtitle {
    font-size: 14px;
    color: #64748b;
}

.login-tabs {
    display: flex;
    margin-bottom: 28px;
    border-bottom: 1px solid #e2e8f0;
}

.tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    font-size: 14px;
    color: #94a3b8;
    transition: all 0.2s ease;
    position: relative;
    font-weight: 500;
}

.tab:hover {
    color: #3b82f6;
}

.tab.active {
    color: #3b82f6;
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2.5px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 2px;
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13.5px;
    color: #475569;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14.5px;
    transition: all 0.2s ease;
    background: #f8fafc;
    color: #0f172a;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.btn-login {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
    letter-spacing: 2px;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
}

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

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-footer {
    margin-top: 28px;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: #94a3b8;
}

/* 弹窗样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    min-width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

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

.modal-icon {
    margin-bottom: 20px;
}

.modal-icon.error svg circle,
.modal-icon.error svg line {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.modal-message {
    font-size: 16px;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.6;
}

.modal-btn {
    padding: 10px 40px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

/* 响应式 */
@media (max-width: 480px) {
    .login-box {
        width: calc(100% - 40px);
        padding: 30px 25px;
    }
    
    .login-header h1 {
        font-size: 20px;
    }
    
    .bg-shape {
        opacity: 0.05;
    }
}

/* ===== i18n language switcher (login page) ===== */
.lang-switcher {
    position: relative;
    display: inline-block;
}
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}
.lang-btn:hover {
    background: rgba(255, 255, 255, 0.32);
}
.lang-globe {
    font-size: 15px;
    line-height: 1;
}
.lang-flag {
    width: 18px;
    height: 12px;
    border-radius: 2px;
    object-fit: cover;
    display: inline-block;
    flex: none;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: rgba(255, 255, 255, 0.35);
}
.lang-btn .lang-btn-flag {
    margin: 0 2px;
}
.lang-menu-name {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}
.lang-menu-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lang-caret {
    font-size: 10px;
    opacity: 0.85;
}
.lang-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 172px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 6px;
    z-index: 3000;
    max-height: 72vh;
    overflow: auto;
}
.lang-switcher.open .lang-menu {
    display: block;
}
.lang-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 14px;
    color: #1f2937;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.3;
}
.lang-menu-item:hover {
    background: #eff6ff;
    color: #2563eb;
    text-decoration: none;
}
.lang-menu-item.active {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}
.lang-menu-item.active::after {
    content: "\2713";
    font-size: 12px;
}
.lang-switcher-floating {
    position: fixed;
    top: 14px;
    right: 16px;
    z-index: 3000;
}
html.i18n-switching body {
    opacity: 0.3;
    transition: opacity 0.12s ease-out;
}
html body {
    transition: opacity 0.18s ease-in;
}
html[data-lang="ja"] body {
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Microsoft YaHei", sans-serif;
}
html[data-lang="ko"] body {
    font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Microsoft YaHei", sans-serif;
}
html[data-lang="th"] body {
    font-family: "Noto Sans Thai", Tahoma, "Microsoft YaHei", sans-serif;
}
html[data-lang="hi"] body {
    font-family: "Noto Sans Devanagari", "Mangal", "Nirmala UI", "Microsoft YaHei", sans-serif;
}
