/* 登录弹窗样式 - 重构版本 */

.qm-login-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.qm-login-modal:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

.qm-login-modal.hidden {
    display: none;
}

/* Hash :target 兜底（在 JS 尚未加载完成时点击登录） */
#qm-login-modal:target {
    display: flex;
    opacity: 1;
    visibility: visible;
}

#qm-login-modal:target .qm-login-modal__backdrop {
    opacity: 1;
}

#qm-login-modal:target .qm-login-modal__content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 背景遮罩 */
.qm-login-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qm-login-modal:not(.hidden) .qm-login-modal__backdrop {
    opacity: 1;
}

/* 容器 */
.qm-login-modal__container {
    position: relative;
    width: 100%;
    max-width: 440px;
    z-index: 1;
}

/* 装饰性背景 */
.qm-login-modal__bg-decoration {
    position: absolute;
    inset: -50px;
    pointer-events: none;
    overflow: hidden;
    border-radius: 32px;
    z-index: 0;
}

.qm-login-modal__bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: qm-orb-float 8s ease-in-out infinite;
}

.qm-login-modal__bg-orb--1 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #e879f9, #f9a8d4);
    top: -50px;
    left: -50px;
    animation-delay: 0s;
}

.qm-login-modal__bg-orb--2 {
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, #f9a8d4, #fdba74);
    bottom: -30px;
    right: -30px;
    animation-delay: 2s;
}

.qm-login-modal__bg-orb--3 {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #fdba74, #e879f9);
    top: 50%;
    right: -40px;
    animation-delay: 4s;
}

@keyframes qm-orb-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(20px, -20px) scale(1.1);
    }
    66% {
        transform: translate(-15px, 15px) scale(0.9);
    }
}

/* 主要内容区域 */
.qm-login-modal__content {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(232, 121, 249, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    z-index: 1;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.qm-login-modal:not(.hidden) .qm-login-modal__content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 关闭按钮 */
.qm-login-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.qm-login-modal__close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg) scale(1.1);
}

.qm-login-modal__close i {
    font-size: 0.875rem;
}

/* 标题区域 */
.qm-login-modal__header {
    text-align: center;
    margin-bottom: 2rem;
}

.qm-login-modal__title {
    margin: 0 0 0.5rem;
    font-size: 1.875rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e879f9, #f9a8d4, #fdba74);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.qm-login-modal__title-text {
    display: inline-block;
    background: linear-gradient(135deg, #e879f9, #f9a8d4, #fdba74);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 8px rgba(232, 121, 249, 0.4));
}

.qm-login-modal__subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 400;
}

/* 表单组 */
.qm-login-modal__form-group {
    margin-bottom: 1.25rem;
}

/* 输入框包装器 */
.qm-login-modal__input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.qm-login-modal__input-icon {
    position: absolute;
    left: 1rem;
    color: rgba(0, 0, 0, 0.4);
    font-size: 0.875rem;
    z-index: 2;
    transition: color 0.3s ease;
    pointer-events: none;
}

.qm-login-modal__input-wrapper:focus-within .qm-login-modal__input-icon {
    color: #e879f9;
}

/* 输入框 */
.qm-login-modal__input {
    width: 100%;
    height: 48px;
    padding: 0 1rem 0 2.75rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 0.9375rem;
    color: #1a1a1a;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.qm-login-modal__input::placeholder {
    color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qm-login-modal__input:focus::placeholder {
    opacity: 1;
}

.qm-login-modal__input:focus {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(232, 121, 249, 0.5);
    box-shadow: 
        0 0 0 3px rgba(232, 121, 249, 0.15),
        0 4px 12px rgba(232, 121, 249, 0.2);
}

.qm-login-modal__input:not(:placeholder-shown) {
    background: rgba(255, 255, 255, 1);
}

/* 标签 */
.qm-login-modal__label {
    position: absolute;
    left: 2.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9375rem;
    color: rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1;
}

.qm-login-modal__input:focus + .qm-login-modal__label,
.qm-login-modal__input:not(:placeholder-shown) + .qm-login-modal__label {
    top: -0.5rem;
    left: 0.75rem;
    font-size: 0.75rem;
    color: #e879f9;
    background: rgba(255, 255, 255, 0.95);
    padding: 0 0.5rem;
    border-radius: 4px;
}

/* 验证码输入框特殊样式 */
.qm-email-code-box .qm-login-modal__input {
    padding-right: 110px;
}

.qm-get-code-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    height: 36px;
    min-width: 90px;
    padding: 0 0.75rem;
    background: linear-gradient(135deg, #e879f9, #f9a8d4);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(232, 121, 249, 0.3);
    z-index: 2;
}

.qm-get-code-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f9a8d4, #fdba74);
    box-shadow: 0 4px 12px rgba(249, 168, 212, 0.4);
    transform: translateY(-50%) scale(1.05);
}

.qm-get-code-btn:active:not(:disabled) {
    transform: translateY(-50%) scale(0.98);
}

.qm-get-code-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background: rgba(148, 163, 184, 0.3);
}

.qm-get-code-btn .btn-text,
.qm-get-code-btn .btn-countdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 选项区域 */
.qm-login-modal__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.qm-login-modal__checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.qm-login-modal__checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0 0.5rem 0 0;
    cursor: pointer;
    accent-color: #f9a8d4;
    flex-shrink: 0;
}

.qm-login-modal__checkbox-label {
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.6);
    transition: color 0.2s ease;
}

.qm-login-modal__checkbox:hover .qm-login-modal__checkbox-label {
    color: rgba(0, 0, 0, 0.8);
}

.qm-login-modal__link {
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.6);
    text-decoration: none;
    transition: all 0.2s ease;
}

.qm-login-modal__link:hover {
    color: #e879f9;
}

/* 消息提示 */
.qm-auth-message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid;
    animation: qm-message-slide-in 0.3s ease;
}

@keyframes qm-message-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qm-auth-message--error {
    background: rgba(254, 242, 242, 0.9);
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.3);
}

.qm-auth-message--success {
    background: rgba(240, 253, 244, 0.9);
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.3);
}

/* 提交按钮 */
.qm-login-modal__btn {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #e879f9, #f9a8d4, #fdba74);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 1.5rem;
    box-shadow: 
        0 4px 16px rgba(232, 121, 249, 0.4),
        0 0 0 0 rgba(232, 121, 249, 0.5);
    overflow: hidden;
}

.qm-login-modal__btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #f9a8d4, #fdba74, #e879f9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qm-login-modal__btn:hover:not(:disabled)::before {
    opacity: 1;
}

.qm-login-modal__btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(232, 121, 249, 0.5),
        0 0 0 4px rgba(232, 121, 249, 0.2);
}

.qm-login-modal__btn:active:not(:disabled) {
    transform: translateY(0);
}

.qm-login-modal__btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.qm-login-modal__btn .btn-text,
.qm-login-modal__btn .btn-loading {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.qm-login-modal__btn .btn-loading i {
    animation: qm-spin 1s linear infinite;
}

@keyframes qm-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 页脚链接 */
.qm-login-modal__footer {
    text-align: center;
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.6);
}

.qm-login-modal__footer-text {
    margin-right: 0.5rem;
}

.qm-login-modal__footer-link {
    color: #e879f9;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-block;
}

.qm-login-modal__footer-link:hover {
    color: #f9a8d4;
    transform: translateX(2px);
}

/* 密码强度指示器 */
.password-strength {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    padding-left: 2.75rem;
    min-height: 1rem;
}

.password-strength.weak {
    color: #dc2626;
}

.password-strength.medium {
    color: #f59e0b;
}

.password-strength.strong {
    color: #16a34a;
}

/* 错误状态 */
.qm-login-modal__input-wrapper.has-error .qm-login-modal__input {
    border-color: rgba(220, 38, 38, 0.5);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.qm-login-modal__input-wrapper.has-error .qm-login-modal__input-icon {
    color: #dc2626;
}

.qm-login-modal__input-wrapper.has-error .qm-login-modal__label {
    color: #dc2626;
}

/* 表单切换动画 */
.qm-auth-form {
    animation: qm-form-fade-in 0.3s ease;
}

@keyframes qm-form-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 640px) {
    .qm-login-modal {
        padding: 0.5rem;
    }

    .qm-login-modal__container {
        max-width: 100%;
    }

    .qm-login-modal__content {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .qm-login-modal__title {
        font-size: 1.5rem;
    }

    .qm-login-modal__bg-decoration {
        inset: -30px;
    }

    .qm-login-modal__bg-orb--1 {
        width: 150px;
        height: 150px;
    }

    .qm-login-modal__bg-orb--2 {
        width: 120px;
        height: 120px;
    }

    .qm-login-modal__bg-orb--3 {
        width: 100px;
        height: 100px;
    }

    .qm-login-modal__options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .qm-login-modal__link {
        align-self: flex-end;
    }
}

@media (max-width: 480px) {
    .qm-login-modal__content {
        padding: 1.5rem 1.25rem;
    }

    .qm-login-modal__title {
        font-size: 1.375rem;
    }

    .qm-login-modal__input {
        height: 44px;
        font-size: 0.875rem;
    }

    .qm-login-modal__btn {
        height: 44px;
        font-size: 0.9375rem;
    }
}

/* 暗色模式 */
.dark .qm-login-modal__backdrop {
    background: rgba(2, 6, 23, 0.8);
}

.dark .qm-login-modal__bg-orb {
    opacity: 0.4;
}

.dark .qm-login-modal__content {
    background: rgba(2, 6, 23, 0.92);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(148, 163, 184, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark .qm-login-modal__close {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
}

.dark .qm-login-modal__close:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
}

.dark .qm-login-modal__subtitle {
    color: rgba(255, 255, 255, 0.6);
}

.dark .qm-login-modal__input-icon {
    color: rgba(255, 255, 255, 0.5);
}

.dark .qm-login-modal__input {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.2);
    color: #e5e7eb;
}

.dark .qm-login-modal__input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.dark .qm-login-modal__input:focus {
    background: rgba(15, 23, 42, 1);
    border-color: rgba(232, 121, 249, 0.6);
    box-shadow:
        0 0 0 3px rgba(232, 121, 249, 0.2),
        0 6px 16px rgba(232, 121, 249, 0.2);
}

.dark .qm-login-modal__label {
    color: rgba(255, 255, 255, 0.55);
}

.dark .qm-login-modal__input:focus + .qm-login-modal__label,
.dark .qm-login-modal__input:not(:placeholder-shown) + .qm-login-modal__label {
    background: rgba(2, 6, 23, 0.95);
}

.dark .qm-login-modal__checkbox-label {
    color: rgba(255, 255, 255, 0.6);
}

.dark .qm-login-modal__checkbox:hover .qm-login-modal__checkbox-label {
    color: rgba(255, 255, 255, 0.85);
}

.dark .qm-login-modal__link {
    color: rgba(255, 255, 255, 0.65);
}

.dark .qm-login-modal__footer {
    color: rgba(255, 255, 255, 0.6);
}

.dark .qm-auth-message--error {
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.4);
}

.dark .qm-auth-message--success {
    background: rgba(20, 83, 45, 0.35);
    color: #bbf7d0;
    border-color: rgba(34, 197, 94, 0.4);
}

/* 按钮文字保持原样 */
.qm-login-modal__btn .btn-text {
    display: inline-flex !important;
}

.qm-login-modal__btn .btn-loading {
    display: none !important;
}

.qm-get-code-btn .btn-text {
    display: inline-flex !important;
}

.qm-get-code-btn .btn-countdown {
    display: none !important;
}

.dark .qm-login-modal__btn,
.dark .qm-login-modal__btn .btn-text {
    color: #ffffff;
}

