/* ==================== 综合优化样式 ==================== */

/* ==================== 1. 状态提示颜色优化 (白天模式) ==================== */
:root[data-theme="light"] .status-message.info {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.15);
    font-weight: 500;
}

:root[data-theme="light"] .status-message.success {
    color: #15803d;
    background: rgba(34, 197, 94, 0.15);
    font-weight: 500;
}

:root[data-theme="light"] .status-message.error {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.15);
    font-weight: 500;
}

:root[data-theme="light"] .status-message.warning {
    color: #b45309;
    background: rgba(245, 158, 11, 0.15);
    font-weight: 500;
}

/* ==================== 2. 加载动画/骨架屏 ==================== */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-tertiary) 25%,
            var(--bg-secondary) 50%,
            var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-button {
    height: 36px;
    width: 100px;
}

/* 加载指示器 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== 3. 键盘快捷键提示 ==================== */
.kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    font-family: monospace;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

/* ==================== 4. 密码强度指示器 ==================== */
.password-strength-meter {
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: #ef4444;
}

.password-strength-bar.medium {
    width: 66%;
    background: #f59e0b;
}

.password-strength-bar.strong {
    width: 100%;
    background: #22c55e;
}

.password-strength-text {
    font-size: 0.75rem;
    margin-top: 4px;
    color: var(--text-muted);
}

/* ==================== 5. 服务器测试状态 ==================== */
.server-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.server-status.testing {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.server-status.online {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.server-status.offline {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.server-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.server-status.testing .server-status-dot {
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ==================== 6. 移动端触摸优化 ==================== */
@media (max-width: 768px) {

    /* 更大的触摸目标 */
    .btn,
    button {
        min-height: 44px;
        min-width: 44px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
        /* 防止iOS缩放 */
    }

    /* 触摸反馈 */
    .btn:active {
        transform: scale(0.98);
    }
}

/* ==================== 7. 进度条 ==================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* ==================== 8. 登录尝试限制提示 ==================== */
.login-attempts-warning {
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 15px;
}

/* ==================== 9. 快捷键弹窗 ==================== */
.shortcuts-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.shortcuts-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.shortcut-item:last-child {
    border-bottom: none;
}

/* ==================== 10. 优化的过渡效果 ==================== */
* {
    scroll-behavior: smooth;
}

.smooth-appear {
    animation: smoothAppear 0.3s ease;
}

@keyframes smoothAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 11. 焦点状态优化 ==================== */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==================== 12. 链接项悬停效果优化 ==================== */
.link-item {
    transition: all 0.2s ease;
}

.link-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}